weaviate / typescript-client

Official Weaviate TypeScript Client
https://www.npmjs.com/package/weaviate-client
BSD 3-Clause "New" or "Revised" License
65 stars 23 forks source link

'properties' does not exist in type 'HybridArgs' #57

Closed dandv closed 1 year ago

dandv commented 1 year ago

I see that properties is included in HybridArgs in 1.3.0, but the following code snippet fails with

Argument of type '{ query: string; alpha: number; properties: string[]; }' is not assignable to parameter of type 'HybridArgs'. Object literal may only specify known properties, and 'properties' does not exist in type 'HybridArgs'.

import weaviate, { WeaviateClient } from 'weaviate-ts-client';

const client: WeaviateClient = weaviate.client({
  scheme: 'https',
  host: '...',
});

const response = await client.graphql
  .get()
  .withClassName('JeopardyQuestion')
  .withFields('question answer _additional{ score }')
  .withHybrid({
    query: 'Venus',
    properties: ["question"],  // <--
  })
  .do();
parkerduckworth commented 1 year ago

Hey @dandv, the support for this feature existed on master, but hadn't made it into a release yet.

I just made a release which contains hybrid class property support: https://github.com/weaviate/typescript-client/releases/tag/v1.3.1