feat(langchain): Broaden AI provider detection beyond OpenAI and Anthropic#5707
feat(langchain): Broaden AI provider detection beyond OpenAI and Anthropic#5707ericapisani wants to merge 2 commits intomasterfrom
Conversation
…ropic Extract _get_ai_system() to generically detect AI providers from LangChain's _type field instead of hardcoding only "anthropic" and "openai". The function splits on "-" and skips non-provider segments (cloud prefixes like "azure" and descriptors like "chat"/"llm") to return the actual provider name. This adds support for Cohere, Ollama, Mistral, Fireworks, HuggingFace, Groq, NVIDIA, xAI, DeepSeek, Google, and any future LangChain providers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@cursoragent please review this |
|
Please finish setting up background agents. Go to Cursor |
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 6.92s 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 14379 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 25.33% 30.25% +4.92%
==========================================
Files 189 189 —
Lines 20613 20614 +1
Branches 6738 6736 -2
==========================================
+ Hits 5222 6235 +1013
- Misses 15391 14379 -1012
- Partials 429 474 +45Generated by Codecov Action |
Codecov Results 📊✅ 9 passed | ⏭️ 1 skipped | Total: 10 | Pass Rate: 90% | Execution Time: 3.63s All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 14771 uncovered lines. Files with missing lines (1)
Generated by Codecov Action |
|
bugbot run |
…s-is Remove string splitting and filtering logic from _get_ai_system. The function now returns the LangChain _type value directly without attempting to extract a provider name from it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Anthropic
Documentation 📚
Internal Changes 🔧
Other
🤖 This preview updates automatically when you update the PR. |
Summary
_get_ai_system()helper that generically detects AI providers from LangChain's_typefield, replacing hardcoded"anthropic"/"openai"checks.Test plan
_llm_typevalues from various providers🤖 Generated with Claude Code