Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(core): use tool_calls instead of deprecated function_call in get_buffer_string#34355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
edlsh wants to merge1 commit intolangchain-ai:master
base:master
Choose a base branch
Loading
fromedlsh:fix/get-buffer-string-tool-calls-33970

Conversation

@edlsh
Copy link
Contributor

Summary

Fixes#33970

get_buffer_string was only checking for the deprecatedfunction_call field inadditional_kwargs, which modern LLM providers no longer return. This fix updates the function to check for the moderntool_calls field first, falling back tofunction_call for legacy compatibility.

Changes

  • CheckAIMessage.tool_calls first (modern standard)
  • Fall back toadditional_kwargs["function_call"] (legacy support)
  • Added 3 unit tests covering tool_calls, empty content, and precedence behavior

Testing

# Before fix: tool_calls info was lostmsg=AIMessage(content="Hi",tool_calls=[{"name":"search", ...}])get_buffer_string([msg])# "AI: Hi" (no tool info)# After fix: tool_calls are includedget_buffer_string([msg])# "AI: Hi[{\"name\": \"search\", ...}]"
  • All existingget_buffer_string tests pass
  • Legacyfunction_call behavior preserved

Note

This PR was developed with AI agent assistance (Factory/Droid).

…buffer_stringget_buffer_string now checks for the modern tool_calls field onAIMessage before falling back to the deprecated function_call inadditional_kwargs. This ensures tool call information is properlyincluded in the buffer output for modern LLM providers.Fixeslangchain-ai#33970
@github-actionsgithub-actionsbot added core`langchain-core` package issues & PRs fixFor PRs that implement a fix labelsDec 14, 2025
@codspeed-hq
Copy link

CodSpeed Performance Report

Merging#34355 willnot alter performance

Comparingedlsh:fix/get-buffer-string-tool-calls-33970 (98939ee) withmaster (1a3cd46)1

⚠️Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend usingCodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched
⏩ 21 skipped2

Footnotes

  1. No successful run was found onmaster (0cd72b5) during the generation of this report, so1a3cd46 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase,click here and archive them to remove them from the performance reports.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@eyurtseveyurtsevAwaiting requested review from eyurtseveyurtsev is a code owner

Assignees

No one assigned

Labels

core`langchain-core` package issues & PRsfixFor PRs that implement a fix

Projects

None yet

Milestone

No milestone

1 participant

@edlsh

[8]ページ先頭

©2009-2025 Movatter.jp