Skip to content

Conversation

mdrxy
Copy link
Collaborator

@mdrxy mdrxy commented Aug 8, 2025

Updates the name field documentation in v1 messages to provide message-type-specific guidance instead of generic descriptions. The current documentation incorrectly presents the field as purely "human-readable" when it serves critical functional purposes that vary by message type.

  • ToolMessage.name is effectively required by most providers despite being typed as Optional[str]
  • AIMessage.name is critical for multi-agent systems but optional for single-agent scenarios

Examples

langchain-openai

langgraph-supervisor-py

langchain-google

langchain-community

mdrxy and others added 23 commits July 28, 2025 10:39
Co-authored-by: Maxime Grenu <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: jmaillefaud <[email protected]>
Co-authored-by: Eugene Yurtsev <[email protected]>
Co-authored-by: tanwirahmad <[email protected]>
Co-authored-by: Christophe Bornet <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: niceg <[email protected]>
Co-authored-by: Chaitanya varma <[email protected]>
Co-authored-by: dishaprakash <[email protected]>
Co-authored-by: Chester Curme <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Kanav Bansal <[email protected]>
Co-authored-by: Aleksandr Filippov <[email protected]>
Co-authored-by: Alex Feel <[email protected]>
# Conflicts:
#	.github/workflows/_integration_test.yml
#	.github/workflows/_release.yml
#	.github/workflows/api_doc_build.yml
#	.github/workflows/people.yml
#	.github/workflows/run_notebooks.yml
#	.github/workflows/scheduled_test.yml
#	SECURITY.md
#	docs/docs/integrations/vectorstores/pgvectorstore.ipynb
#	libs/langchain_v1/langchain/chat_models/base.py
#	libs/langchain_v1/tests/integration_tests/chat_models/test_base.py
#	libs/langchain_v1/tests/unit_tests/chat_models/test_chat_models.py
Co-authored-by: Mason Daugherty <[email protected]>
Co-authored-by: Eugene Yurtsev <[email protected]>
Co-authored-by: Mason Daugherty <[email protected]>
Co-authored-by: Nuno Campos <[email protected]>
Co-authored-by: Kanav Bansal <[email protected]>
Co-authored-by: Pranav Bhartiya <[email protected]>
Co-authored-by: Nelson Sproul <[email protected]>
Co-authored-by: John Bledsoe <[email protected]>
Resolves #32215

---------

Co-authored-by: Chester Curme <[email protected]>
Co-authored-by: Eugene Yurtsev <[email protected]>
Co-authored-by: Nuno Campos <[email protected]>
Adds backward compat for `.text()` on messages while keeping `.text`
access

_The kicker:_

Any previous use of `.text()` will now need a `# type: ignore[operator]`
to silence type checkers. However, it will still behave as expected at
runtime. Deprecating in v0.4.0, to be removed in v2.0.0.
To prevent polluting future PRs
# Conflicts:
#	libs/core/langchain_core/version.py
#	libs/core/pyproject.toml
#	libs/core/uv.lock
#	libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py
#	libs/partners/openai/uv.lock
@mdrxy mdrxy requested a review from eyurtsev as a code owner August 8, 2025 17:20
Copy link

vercel bot commented Aug 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 8, 2025 5:27pm

Copy link

codspeed-hq bot commented Aug 8, 2025

CodSpeed WallTime Performance Report

Merging #32469 will not alter performance

Comparing mdrxy/messages-name-docs (56379fb) with wip-v0.4 (2f0c642)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 using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

Footnotes

  1. No successful run was found on wip-v0.4 (7f989d3) during the generation of this report, so 132ed67 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link

codspeed-hq bot commented Aug 8, 2025

CodSpeed Instrumentation Performance Report

Merging #32469 will not alter performance

Comparing mdrxy/messages-name-docs (56379fb) with wip-v0.4 (2f0c642)1

Summary

✅ 14 untouched benchmarks

Footnotes

  1. No successful run was found on wip-v0.4 (7f989d3) during the generation of this report, so 132ed67 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@mdrxy mdrxy added the core Related to the package `langchain-core` label Aug 8, 2025
@mdrxy mdrxy requested a review from ccurme August 8, 2025 20:54
@mdrxy mdrxy added this to the v1 milestone Aug 13, 2025
@mdrxy mdrxy changed the base branch from wip-v0.4 to wip-v1.0 September 8, 2025 20:55
@mdrxy mdrxy requested a review from baskaryan as a code owner September 8, 2025 20:55
@mdrxy mdrxy mentioned this pull request Sep 8, 2025
15 tasks
@mdrxy mdrxy self-assigned this Sep 8, 2025
@mdrxy mdrxy closed this Sep 24, 2025
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`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants