feat(langchain): Broaden AI provider detection beyond OpenAI and Anthropic#5707
Draft
ericapisani wants to merge 1 commit intomasterfrom
Draft
feat(langchain): Broaden AI provider detection beyond OpenAI and Anthropic#5707ericapisani wants to merge 1 commit intomasterfrom
ericapisani wants to merge 1 commit 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>
Member
Author
|
@cursoragent please review this |
|
Please finish setting up background agents. Go to Cursor |
Contributor
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 9.79s All tests are passing successfully. ❌ Patch coverage is 0.00%. Project has 14374 uncovered lines. Files with missing lines (1)
Generated by Codecov Action |
Contributor
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_get_ai_system()helper that generically detects AI providers from LangChain's_typefield, replacing hardcoded"anthropic"/"openai"checks._typeon-and skips non-provider segments (cloud prefixes like"azure"and descriptors like"chat"/"llm") to return the actual provider name.Test plan
_llm_typevalues from 14 providersNone, cloud-prefix-only ("azure"), underscore-separated ("amazon_bedrock_chat")🤖 Generated with Claude Code