stanfordnlp / dspy

DSPy: The framework for programming—not prompting—language models
https://dspy.ai
MIT License
18.84k stars 1.44k forks source link

Fix AzureAISearchRM Error when doing vector/hybrid search #1484

Closed jeffreyrubi closed 2 months ago

jeffreyrubi commented 2 months ago

In hybrid/vector search case, when calling client.search, get_embedding() is returning List[VectorQueries]: https://github.com/stanfordnlp/dspy/blob/main/dspy/retrieve/azureaisearch_rm.py#L380

It can directly passed to the client.search.

Currently, an extra '[]' is added when passing the vector_query to the client.search: https://github.com/stanfordnlp/dspy/blob/main/dspy/retrieve/azureaisearch_rm.py#L258

Results in serialization error from AISearch library.

The fix is to remove that extra []. Test is done with positive result after fix.

arnavsinghvi11 commented 2 months ago

Thanks @jeffreyrubi !