Skip to content

Capture raw provider response #33884

@mdrxy

Description

@mdrxy

Checked other resources

  • This is a feature request, not a bug report or usage question.
  • I added a clear and descriptive title that summarizes the feature request.
  • I used the GitHub search to find a similar feature request and didn't find it.
  • I checked the LangChain documentation and API reference to see if this feature already exists.
  • This is not related to the langchain-community package.

Feature Description

Implement a raw_response field on AIMessage responses configurable via include_raw_response=True flag on chat models and per-invocation. Default to False.

During stream chunk merging, responses are kept as a list from each chunk.

Use Case

Debugging

Proposed Solution

Proof of concept: #32926

Alternatives Considered

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.1 candidatecoreRelated to the package `langchain-core`feature requestrequest for an enhancement / additional functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions