Repository navigation
feat: support Anthropic, DeepSeek, Mistral and Gemini models (backport #172) - #173
Open
mergify[bot] wants to merge 1 commit into
Open
mergify[bot] wants to merge 1 commit into
mergify[bot] wants to merge 1 commit into
Conversation
* feat: support Anthropic, DeepSeek, Mistral and Gemini models Build chat and vision models with LangChain's `init_chat_model` instead of `ChatOpenAI` and any-llm completions. - LLM Provider and Vision LLM Provider are Autocomplete fields with OpenAI, Anthropic, DeepSeek, Mistral and Gemini. Validate the value on save. - Register the harness profile for the provider that the model reports, so write and execute tools stay excluded for all providers. - Do not send a temperature. Newer models reject non-default values. - Make Base URL and Vision API Key optional. - Show Reasoning Effort only for OpenAI. - Add a patch that changes "OpenAI" and "OpenAI Compatible" to "openai". * fix: make provider credentials optional and test document extraction - Remove the remaining mandatory conditions from Base URL, Vision Base URL and Vision API Key. A separate vision model can now read its credentials from the environment, and the old "OpenAI Compatible" conditions could no longer be true. - Add tests for document extraction with a shared and a separate vision model. They check the credentials, the image message and the parsed model response. * feat: support reasoning effort for Anthropic and Gemini Each integration takes the Reasoning Effort setting under its own name: OpenAI as `reasoning_effort`, Anthropic as `effort` and Gemini as `thinking_level`. Gemini has no level above "high", so "xhigh" and "max" become "high". DeepSeek and Mistral get no reasoning argument. The warning for unsupported levels stays OpenAI-only, because only LangChain's OpenAI model data lists the supported levels. * refactor: move provider patch out of the v1_0 folder (cherry picked from commit 9f16aea)
Contributor
[Medium impact] The backport appears safe to merge; no actionable defect was identified.
|
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
Ask ALYF can now use models from OpenAI, Anthropic, DeepSeek, Mistral and Gemini. Chat and vision models are built with LangChain's
init_chat_modelinstead ofChatOpenAIand any-llm completions.Changes
init_chat_modelprovider key, for example "google_genai". On save, the value must be one of the options.build_chat_modelusesinit_chat_model. It sends the API key and the base URL only when they are set. The Responses API stays for OpenAI only.ainvoke. The OpenAI-style image block stays, because the integrations convert it and it keepsdetail: "high".reasoning_effort, Anthropic useseffortand Gemini usesthinking_level. Gemini has no level above "high", so "xhigh" and "max" become "high". DeepSeek and Mistral get no reasoning argument, and the field is hidden for them. The warning for unsupported levels stays OpenAI-only, because only LangChain's OpenAI model data lists the levels.write_file,edit_fileandexecuteagain. The profile is now registered for the provider of the model that is built.langchain-anthropic,langchain-deepseek,langchain-google-genai,langchain-mistralaiandany-llm-sdk[mistral].Migration
Install the new Python requirements (for example
bench setup requirements), then runbench migrate.Known limits
response_format=json_object, which only OpenAI supports. It uses the prompt and the existing JSON parser.Tests
This is an automatic backport of pull request #172 done by [Mergify](https://mergify.com).