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

Adding metadata to information when calling chain.execute(string) #431

Merged
merged 4 commits into from Jan 10, 2024

Conversation

mateusscheper
Copy link
Contributor

The goal of this change is to allow the user to add extra information when appending the retrieved docs informations on chain.execute(string).
Example:

chain = ConversationalRetrievalChain.builder()               
                .metadata(List.of("file_name"))
                [...]
                .build();
String response = chain.execute("My question");

When building the prompt, it will include the information like:

information -> ...file_name: my_file.pdf
Content: my first retrieved content....

...file_name: my_file.pdf
Content: my second retrieved content...

Since it's my first contribution here, please let me know if something's wrong. Thanks!

Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mateusscheper thanks a lot for your contribution! Please check my comments.

Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mateusscheper looks great, thank you!

@langchain4j langchain4j merged commit 086e600 into langchain4j:main Jan 10, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants