feat(cohere): add CohereAzureRanker for rerank models served via Azure AI - #3750
feat(cohere): add CohereAzureRanker for rerank models served via Azure AI#3750Aryan-Pardeshi wants to merge 5 commits into
Conversation
|
Heads-up for maintainers This PR is from a fork and touches integrations whose integration tests require API keys. Affected integrations:
Please run the integration tests locally ( |
|
Hi @Aryan-Pardeshi, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
|
Thanks for signing the CLA, @Aryan-Pardeshi! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
Coverage report (cohere)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
|
Thanks a lot for this @Aryan-Pardesh! I tried the existing Either way, thanks for the effort you put in here. |
Closes #2795.
Adds a ranker for Cohere rerank models served through Azure AI, in the existing
cohereintegration rather than a new one — per the conclusion in the issue thread that these models are reached without any Azure SDK dependency.Built on the reference code @sjrl posted on 2026-04-22, using
httpxrather than the Cohere SDK because of cohere-ai/cohere-python#661, which @bglearning flagged on the issue as blocking the SDK route.Adapted rather than copied — the reference had an import-time
os.getenvdefault, passed a rawSecretthroughto_dict, defined custom exception classes, and carried a__del__with a bare except. This followsCohereRankerinstead:Secrethandling andto_dict/from_dictround-trip,ValueErrorfor validation, anddataclasses.replaceso documents are not mutated in place.Unit tests mock the transport; no credentials or network needed.