You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When making a generative search query and requesting the id in the latest ts client (2.0.0) available on NPM, it's not possible to get both the ID and a generated singleResult together in a single query.
So the following doesn't work:
constresult=awaitclient.graphql.get().withClassName('Question').withFields('name answer _additional { id}').withGenerate({singlePrompt: 'Explain {answer} as you might to a five-year-old.'}).withLimit(1).do();
This work around appears to work but doesn't align with the expected developer experience:
constgeneratePrompt='Explain {answer} as you might to a five-year-old.'constresult=awaitclient.graphql.get().withClassName('Question').withFields(`name answer { id generate ( singleResult: { prompt:\"${generatePrompt}\"}){error singleResult } }`).withLimit(1).do();
Which produces the desired output of the generated result and the id together.
The text was updated successfully, but these errors were encountered:
Hi there, I'm dealing with this same issue. Thanks for posting the workaround - I can confirm that's working for me, but would be good to get this bug fixed.
When making a generative search query and requesting the id in the latest ts client (2.0.0) available on NPM, it's not possible to get both the ID and a generated singleResult together in a single query.
So the following doesn't work:
This work around appears to work but doesn't align with the expected developer experience:
Which produces the desired output of the generated result and the id together.
The text was updated successfully, but these errors were encountered: