You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/community/langchain_community/retrievers
Renu Rozera 4035a1d234
Add source metadata to bedrock retriever response (#21349)
Thank you for contributing to LangChain!

- [X] **PR title**: "community: Add source metadata to bedrock retriever
response"

- [X] **PR message**: 
- **Description:** Bedrock retrieve API returns extra metadata in the
response which is currently not returned in the retriever response
- **Issue:** The change adds the metadata from bedrock retrieve API
response to the bedrock retriever in a backward compatible way. Renamed
metadata to sourceMetadata as metadata term is being used in the
Document already. This is in sync with what we are doing in llama-index
as well.
    - **Dependencies:** No


- [X] **Add tests and docs**:
  1. Added unit tests
  2. Notebook already exists and does not need any change
3. Response from end to end testing, just to ensure backward
compatibility: `[Document(page_content='Exoplanets.',
metadata={'location': {'s3Location': {'uri':
's3://bucket/file_name.txt'}, 'type': 'S3'}, 'score': 0.46886647,
'source_metadata': {'x-amz-bedrock-kb-source-uri':
's3://bucket/file_name.txt', 'tag': 'space', 'team': 'Nasa', 'year':
1946.0}})]`


- [X] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/

Additional guidelines:
- Make sure optional dependencies are imported within a function.
- Please do not add dependencies to pyproject.toml files (even optional
ones) unless they are required for unit tests.
- Most PRs should not touch more than one package.
- Changes should be backwards compatible.
- If you are adding something to community, do not re-import it in
langchain.

If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, hwchase17.

---------

Co-authored-by: Piyush Jain <piyushjain@duck.com>
4 months ago
..
__init__.py multiple: langchain 0.2 in master (#21191) 4 months ago
arcee.py patch: deprecate (a)get_relevant_documents (#20477) 5 months ago
arxiv.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
azure_ai_search.py Community: Updating Azure Retriever and Docs to be Azure AI Search instead of Azure Cognitive Search (#19925) 5 months ago
bedrock.py Add source metadata to bedrock retriever response (#21349) 4 months ago
bm25.py Community[Patch] Remove docs form bm25 repr (#16110) 8 months ago
breebs.py community[minor]: Breebs docs retriever (#16578) 7 months ago
chaindesk.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
chatgpt_plugin_retriever.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
cohere_rag_retriever.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 4 months ago
databerry.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
docarray.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
dria_index.py community[minor]: Add Dria retriever (#17098) 5 months ago
elastic_search_bm25.py community[minor]: import fix (#20995) 4 months ago
embedchain.py community[patch]: Fixing embedchain document mapping (#18255) 6 months ago
google_cloud_documentai_warehouse.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 4 months ago
google_vertex_ai_search.py (all): update removal in deprecation warnings from 0.2 to 0.3 (#21265) 4 months ago
kay.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
kendra.py community: add Kendra DocumentRelevanceOverrideConfigurations request parameter (#20695) 4 months ago
knn.py community[patch]: Added missing from_documents method to KNNRetriever. (#18411) 5 months ago
llama_index.py community[patch]: removing "response_mode" parameter in llama_index retriever (#18180) 6 months ago
metal.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
milvus.py patch: deprecate (a)get_relevant_documents (#20477) 5 months ago
outline.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
pinecone_hybrid_search.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
pubmed.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
pupmed.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
qdrant_sparse_vector_retriever.py community[patch]: Correct the calling to collection_name in qdrant (#16920) 7 months ago
rememberizer.py community[minor]: Rememberizer retriever (#20052) 4 months ago
remote_retriever.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
svm.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
tavily_search_api.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
tfidf.py docs: remove repetitive words (#21058) 4 months ago
thirdai_neuraldb.py community[minor]: import fix (#20995) 4 months ago
vespa_retriever.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
weaviate_hybrid_search.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
web_research.py multiple: langchain 0.2 in master (#21191) 4 months ago
wikipedia.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
you.py community[patch]: docstrings update (#20301) 5 months ago
zep.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 9 months ago
zilliz.py patch: deprecate (a)get_relevant_documents (#20477) 5 months ago