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