Summary
The Python langchain-groq package supports reasoning_effort as a first-class constructor parameter and passes it to the Groq API via _default_params. The JS/TS @langchain/groq package does not — there is no way to set reasoning_effort through the constructor or call options.
Current behavior (JS @langchain/groq)
ChatGroq has reasoningFormat (maps to reasoning_format) but no reasoningEffort field. The invocationParams() method constructs the request body explicitly and does not forward arbitrary kwargs, so there's no workaround via extra fields.
// This does NOT work — reasoningEffort is silently ignored
const model = new ChatGroq({
model: 'openai/gpt-oss-120b',
reasoningEffort: 'low', // ← not a recognized field
});
Expected behavior
ChatGroq should accept reasoningEffort (or reasoning_effort) as a constructor param and include it in the API request body, matching the Python implementation:
# Python langchain-groq — this works
model = ChatGroq(
model="openai/gpt-oss-120b",
reasoning_effort="low",
)
Proposed changes
- Add
reasoningEffort field to ChatGroqInput interface
- Add class field with type from groq-sdk
- Store it on the class instance (in constructor)
- Include it in
invocationParams() output
- Add to
CREATE_PARAMS_BASE_CALL_KEYS for call options support
- Add to
lc_serialized_keys for serialization
Reference
Summary
The Python
langchain-groqpackage supportsreasoning_effortas a first-class constructor parameter and passes it to the Groq API via_default_params. The JS/TS@langchain/groqpackage does not — there is no way to setreasoning_effortthrough the constructor or call options.Current behavior (JS
@langchain/groq)ChatGroqhasreasoningFormat(maps toreasoning_format) but noreasoningEffortfield. TheinvocationParams()method constructs the request body explicitly and does not forward arbitrary kwargs, so there's no workaround via extra fields.Expected behavior
ChatGroqshould acceptreasoningEffort(orreasoning_effort) as a constructor param and include it in the API request body, matching the Python implementation:Proposed changes
reasoningEffortfield toChatGroqInputinterfaceinvocationParams()outputCREATE_PARAMS_BASE_CALL_KEYSfor call options supportlc_serialized_keysfor serializationReference
langchain-groqalready has this:reasoning_effortfield passed via_default_paramsopenai/gpt-oss-20b,openai/gpt-oss-120b,qwen/qwen3-32b