Closed na-stewart closed 1 year ago
Generated by a 🤖
The content_key
parameter in the AzureCognitiveSearchRetriever
is used to specify the key in the retrieved result that should be set as the Document
's page_content
. In your case, you should set the content_key
parameter to the key in your Azure Cognitive Search index that corresponds to the content you want to retrieve.
For example, if your Azure Cognitive Search index has a field named "text" that contains the content you want to use as page_content
, you should initialize the AzureCognitiveSearchRetriever
with content_key="text"
:
retriever = AzureCognitiveSearchRetriever(content_key="text")
retriever.get_relevant_documents("what is langchain")
Make sure to replace "text" with the appropriate key from your Azure Cognitive Search index.
This response is meant to be helpful and save users time. It is not meant to be a precise solution.
Please leave a 👍 if this is helpful and 👎 if it is irrelevant
Hi, @na-stewart! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.
From what I understand, you were experiencing a KeyError in the LangChain library when using the AzureCognitiveSearchRetriever
. Devstein, one of the maintainers, provided a helpful response explaining that the content_key
parameter should be set to the key in the Azure Cognitive Search index that corresponds to the content you want to retrieve. You confirmed that the response was helpful.
Before we close this issue, we wanted to check if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
Thank you for your understanding and contribution to the LangChain project!
System Info
langchain=0.0.199 Python=3.9.13
Who Can Help
@eyurtsev @hwchase17
Information
Related Components
Reproduction
Expected behavior
I am attempting to use
AzureCognitiveSearchRetriever
to no avail. There is little guidance or documentation that I could find to make this functionality work. I don't know what value I'm supposed to set the parametercontent_key
to in order to make this work.My overall goal is to retrieve data from Azure Cognitive Search and use it to determine the output served by the chatbot based on user query.
Thanks!