Skip to content

Fireworks: reasoning_content is missing #34342

@DragosBobolea

Description

@DragosBobolea

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 posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

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

Example Code (Python)

from langchain_core.messages import HumanMessage
from langchain_core.tools import tool
from langchain_fireworks import ChatFireworks


@tool
def subtract(a: int, b: int) -> int:
    """Subtract two numbers together."""
    return a - b

def main():
    model = ChatFireworks(model="fireworks/glm-4p6")
    model = model.bind_tools([subtract])
    response = model.invoke([HumanMessage(content="What is 123456314532 + 12243756423?")],
    tool_choice="required")

    assert response.additional_kwargs['reasoning_content'] # fails


if __name__ == "__main__":
    main()

Error Message and Stack Trace (if applicable)

Description

reasoning_content should be propagated from the response

System Info

python 3.12
langchain==0.3.27
langchain-fireworks==0.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugRelated to a bug, vulnerability, unexpected error with an existing featurefireworks`langchain-fireworks` package issues & PRslangchain`langchain` package issues & PRs

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions