Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs[minor]: Add missing {context} variable in example #6486

Merged
merged 8 commits into from
Aug 10, 2024

Conversation

kostasx
Copy link
Contributor

@kostasx kostasx commented Aug 9, 2024

The example included under the deprecated RetrievalQAChain method is missing the required {context} variable.

The createStuffDocumentsChain "expects a dictionary as input with a list of Documents being passed under the "context" key." as per the specs.

If one tries to replicate the example without including the {context} variable in the prompt template, the following error is produced:

prompt must include a "context" variable

Which is based on DOCUMENTS_KEY = "context";

I believe the example must include the required variable to avoid any confusion and streamline the process of migrating to the alternative syntax.

Just adding a missing period.
Make the code example cleaner and easier to read by removing unnecessary else/if statements.
`createStuffDocumentsChain` requires a `context` variable to be included in the prompt passed to it. Otherwise, the following error is thrown if one tries to reproduce the example given:

`Error: Prompt must include a "context" variable`
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 9, 2024
Copy link

vercel bot commented Aug 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2024 11:29pm
langchainjs-docs ✅ Ready (Inspect) Visit Preview Aug 9, 2024 11:29pm

@kostasx kostasx changed the title Add missing {context} variable in example docs[minor]: Add missing {context} variable in example Aug 9, 2024
@jacoblee93
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants