Skip to content

Conversation

keenborder786
Copy link
Contributor

  • Description: The root cause of this issue is that when a user defines model_config in a BaseModel, the {"type": <tool_name>} value is derived from the title specified in model_config when the results are parsed here. However, tool.name uses the class name (in uppercase) of the BaseModel, resulting in a KeyError when a custom title is provided in model_config.

The Best Solution will be to use the title provided in model_config attribute if provided one since that is what type will be parsed to, if not then use tool.__name__. But need to make sure that this works only for Pydantic V2.

@github-actions github-actions bot added core Related to the package `langchain-core` fix labels Oct 14, 2025
@keenborder786
Copy link
Contributor Author

@eyurtsev

Copy link

codspeed-hq bot commented Oct 14, 2025

CodSpeed Performance Report

Merging #33479 will not alter performance

Comparing keenborder786:fix/tool_name_dict (5a4e193) with master (6e25e18)

⚠️ 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 using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched
⏩ 21 skipped1

Footnotes

  1. 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.

Copy link
Collaborator

@eyurtsev eyurtsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keenborder786 awesome! could you add a unit test?

@keenborder786
Copy link
Contributor Author

@eyurtsev Added Unit Tests

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

Labels

core Related to the package `langchain-core` fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants