Skip to content

reasoning parameter not working as expected in chatollama #33041

@mudassir206

Description

@mudassir206

Checked other resources

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Example Code

if model_cfg.SUPPORTS_THINKING:
return ChatOllama(
model=llm_model_name,
temperature=temperature,
api_key=api_key,
base_url=api_url,
disable_streaming=not streaming,
reasoning=enable_think,
keep_alive=0,
)
else:
return ChatOllama(
model=llm_model_name,
temperature=temperature,
api_key=api_key,
base_url=api_url,
disable_streaming=not streaming,
keep_alive=0,
)

Error Message and Stack Trace (if applicable)

No response

Description

we have been uisng chatollama while invoking the ollama models.
here we are facing one issue.whenever we want to disable think content in the response body we are passing false flag to reasoning parameter,even though we are getting think content in the response body.

System Info

System Information

OS: Linux
OS Version: #29~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Aug 14 16:52:50 UTC 2
Python Version: 3.11.11 (main, Dec 11 2024, 16:28:39) [GCC 11.2.0]

Package Information

langchain_core: 0.3.72
langsmith: 0.4.9
langgraph_sdk: 0.2.0

Optional packages not installed

langserve

Other Dependencies

httpx: 0.28.1
httpx>=0.25.2: Installed. No version info available.
jsonpatch<2.0,>=1.33: Installed. No version info available.
langsmith-pyo3: Installed. No version info available.
langsmith>=0.3.45: Installed. No version info available.
openai-agents: Installed. No version info available.
opentelemetry-api: Installed. No version info available.
opentelemetry-exporter-otlp-proto-http: Installed. No version info available.
opentelemetry-sdk: Installed. No version info available.
orjson: 3.11.1
orjson>=3.10.1: Installed. No version info available.
packaging: 24.2
packaging>=23.2: Installed. No version info available.
pydantic: 2.10.3
pydantic>=2.7.4: Installed. No version info available.
pytest: 8.3.4
PyYAML>=5.3: Installed. No version info available.
requests: 2.32.3
requests-toolbelt: 1.0.0
rich: 13.9.4
tenacity!=8.4.0,<10.0.0,>=8.1.0: Installed. No version info available.
typing-extensions>=4.7: Installed. No version info available.
zstandard: 0.23.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugRelated to a bug, vulnerability, unexpected error with an existing featureunable-to-reproduceLangChain's maintainers are not able to reproduce this issue and consequently cannot work on it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions