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

Add: allow arbitrary output_fields when dynamic field is enabled #28

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

DrChristophFH
Copy link
Contributor

  • Don't reject specified output fields that do not match the schema fields if the dynamic field is enabled

This allows to specify arbitrary metadata fields to be included in the output when building a retriever:

retriever = vectorstore.as_retriever(
    search_type="similarity",
    search_kwargs={
        "k": 8,
        "ranker_type": "weighted",
        "ranker_params": {
            "weights": [
                0.5,  # Dense
                0.5,  # Sparse            ],
        },
        "output_fields": [
            "source",
            "section_title",
            "text",
            "pk",
        ],
    },
)

@zc277584121 zc277584121 self-assigned this Dec 11, 2024
@zc277584121 zc277584121 merged commit 1d2c1ab into langchain-ai:main Dec 12, 2024
8 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.

2 participants