0

I have combined AzureOpenAI with Azure Cognitive search as retriever, here's the code:

from langchain.retrievers import AzureCognitiveSearchRetriever

os.environ["AZURE_COGNITIVE_SEARCH_SERVICE_NAME"] = "xxxxxxxxxxx"
os.environ["AZURE_COGNITIVE_SEARCH_INDEX_NAME"] ="xxxxxxxx"
os.environ["AZURE_COGNITIVE_SEARCH_API_KEY"] ="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

retriever = AzureCognitiveSearchRetriever(content_key="content")
retriever.get_relevant_documents("what did george lucas say about star wars?") 

But I get: Error in search request: <Response [400]

I tried changing the parameters but, I could not find the solution

Sanushi Salgado
  • 1,195
  • 1
  • 11
  • 18
  • 400 responses returned when there's an error in the request URI, headers, or body as Azure Cognitive Search stated. Can you please share the full error response with the message? – Rijoanul Hasan Shanto May 23 '23 at 06:58

0 Answers0