Skip to content

Consider model_settings on create_agent #34031

@sydney-runkle

Description

@sydney-runkle

Privileged issue

  • I am a LangChain maintainer, or was asked directly by a LangChain maintainer to create an issue here.

Issue Content

See #34026 as an example implementation

The vast majority of model settings can be set on a model directly, ex

ChatOpenAI("gpt-4.1-mini", temperature=1)

However, there are a few settings like strict (for tool calling) that you must currently set via middleware's model_settings.

We could consider adding a model_settings arg to create_agent, but this creates another redundant way to do the same thing.

Right now everything you might desire is possible via middleware, but it's more verbose certainly.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-cli
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-perplexity
  • langchain-prompty
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions