Skip to content

Why SelfQueryRetriever.fromLLM is using await? #5096

Closed Answered by dosubot bot
mlegy asked this question in Q&A
Discussion options

You must be logged in to vote

The use of await with SelfQueryRetriever.fromLLM in the documentation is indeed unnecessary since the method is synchronous and does not return a Promise. It should be called without await as follows:

const selfQueryRetriever = SelfQueryRetriever.fromLLM({
   llm: new ChatOpenAI(),
   vectorStore: new PineconeStore(),
   documentContents: "Brief summary of a movie",
   attributeInfo: [],
   structuredQueryTranslator: new PineconeTranslator(),
});

This oversight in the documentation could lead to confusion, and your initiative to correct it by proposing a pull request is valuable. Since the method directly returns a new instance of SelfQueryRetriever without involving any asynchronous ope…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mlegy
Comment options

Answer selected by mlegy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant