I’m currently migrating our app to TypeScript client v3 from v2, and we heavily rely on the QnA Transformers module. However, I couldn’t find any info on how to use it with TypeScript client v3, as all the examples are only for v2 of the library:
Server Setup Information
Weaviate Server Version:
Deployment Method: docker
Multi Node? Number of Running Nodes: 1
Client Language and Version: TypeScript, weaviate-client@3.1.2
await client.graphql
.get()
.withClassName('Article')
.withAsk({
question: 'Who is the king of the Netherlands?',
properties: ['summary'],
})
Without running the raw query. Is this functionality planned for v3?
Because otherwise you’ll have to write a pretty complex wrapper around client.graphql.raw() by yourself if you need e.g. filters and additional params in the query (along with ask).
Thanks for the explanation. To me, it looks more like the issue with the client library’s API and the necessity to write complex raw queries than the need for this module to use the new protocol. Because currently if you want add the ask part in your query, you’ll have to dump all the convenience of the client library with already defined methods for querying, filtering, choosing what to return etc., and write the same stuff by yourself to use the QnA module.
It would be great to write something like
const result = await myCollection.query.fetchObjects({
returnProperties: ['question', 'answer','round', 'points'],
filters: Filters.and(
myCollection.filter.byProperty('round').equal('Double Jeopardy!'),
myCollection.filter.byProperty('points').lessThan(600)
),
limit: 3,
ask: {
question: 'Who is the king of the Netherlands?',
properties: ['summary'],
})
and leave the burden of choosing the internal stuff (e.g. protocol) to the client itself.
To give a bit more context - there are some older features that are rarely used anymore and the ask module is among them. They would need special support in the new GRPC protocoll which is not always easy to do and we decided against adding them. Given our capacity constrains it is unlikely that we will add it.
However you can:
continue to use TS v2 for the forseeable future. We do not have any plans to deprecate it
use TS v2 to build the gql query for you and pipe that into v3 raw gql query