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

community: fix azure cosmosdb no sql #29693

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ianchi
Copy link
Contributor

@ianchi ianchi commented Feb 9, 2025

Fixes error when using custom field names

Custom fields are already aliased in the sql query, so they are no longer present in the response item. Reference the fields by the aliases.

Adds posibility to customize metadata fields.
Currently it only works if the collection has a single key with an object containing all metadata.
This adds more alternatives:

metadata_key: Field(s) to use for metadata. It can be:
- "*": all fields in the document will go in metadata.
- a string: field in the document that contains the metadata.
It must be of object data type (compatible with current behavior)
(it's properties will go in metadata).
- a list of strings: fields in the document to add to metadata.
Use this if metadata is spread across multiple fields.
- a dictionary: same as list but allows to alias.
A mapping of fields in the document to aliases to add as metadata
(e.g., {"field1": "alias1", "field2": "alias2"}).
- None: no metadata will be added.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 9, 2025
Copy link

vercel bot commented Feb 9, 2025

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Feb 9, 2025 3:56pm

@dosubot dosubot bot added community Related to langchain-community Ɑ: vector store Related to vector store module 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Feb 9, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Feb 9, 2025
Fixes error when using custom field names
Adds possibility to customize metadata.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature community Related to langchain-community size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: vector store Related to vector store module
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

1 participant