Skip to content

Conversation

mdrxy
Copy link
Collaborator

@mdrxy mdrxy commented Aug 15, 2025

Warning

  • BREAKING: All partner packages must now translate from v1 content blocks to SDK requests and vice versa
  • Deprecated: .text() method. .text property on messages is now the recommended usage. .text() will be removed in v2.

Tool Calls

  • ToolCall and InvalidToolCall moved to content.py
  • index on ToolCall and ToolCallChunk now NotRequired instead of Optional

Standard Content

  • WIP

Message & Block IDs

  • TL;DR: provider provided > langchain auto-generated > None
  • ensure_id(id) now in base.py
  • Tests in test_messages.py

Translators

TODO

Normalization

Key Changes:

  • Consistent multimodal handling:
    • OpenAI image_url blocks pass through unchanged (broad compatibility) unless convert_all is set in _normalize_messages() (default False)
    • OpenAI input_audio and file blocks convert to v1 standard equivalents
    • Legacy v0 multimodal blocks convert to v1 standard
    • Everything else passes through unchanged
  • Partner packages must update content block parsing logic
  • Stripping IDs from messages to fix some caching issues: feat: _strip_ids_from_messages #32622

Partner Updates

output_version affects how messages are serialized into .content. _normalize_messages() will now upgrade v0 content to v1, so, all partners now receive v1 format input regardless of output_version.

Migration:

  • Partner packages must update to handle v1 input content blocks
  • output_version still controls serialization format of responses (unchanged)

TODO

#32694 output version at invoke

@mdrxy mdrxy added this to the v1 milestone Aug 15, 2025
@mdrxy mdrxy requested a review from eyurtsev as a code owner August 15, 2025 18:31
@mdrxy mdrxy added ignore-lint-pr-title ⚠️ Shouldn't be regularly used! Bypasses the Validate PR Title linting action core Related to the package `langchain-core` codspeed-ignore ⚠️ Shouldn't be regularly used! Bypasses Codspeed performance checks labels Aug 15, 2025
Copy link

vercel bot commented Aug 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langchain Ignored Ignored Preview Aug 26, 2025 10:04pm

@mdrxy mdrxy requested a review from sydney-runkle August 21, 2025 21:49
Comment on lines 160 to 163
# Subsequent passes: attempt to unpack non-standard blocks
blocks = _convert_v0_multimodal_input_to_v1(blocks)
# blocks = _convert_to_v1_from_anthropic_input(blocks)
# ...
Copy link
Member

Choose a reason for hiding this comment

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

am confused why we need this subsequent step. isn't the multimodal conversion already happening in the above loop? or are those somehow funneling into non standard blocks?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we will fix this

@mdrxy mdrxy force-pushed the cc/1.0/standard_content branch from a5cb24f to 4e0fd33 Compare August 25, 2025 18:48
@ccurme ccurme marked this pull request as ready for review August 26, 2025 19:10
@mdrxy mdrxy changed the title v1: standard content, IDs, translators, & normalization feat: standard content, IDs, translators, & normalization Aug 26, 2025
@mdrxy mdrxy removed ignore-lint-pr-title ⚠️ Shouldn't be regularly used! Bypasses the Validate PR Title linting action codspeed-ignore ⚠️ Shouldn't be regularly used! Bypasses Codspeed performance checks labels Aug 26, 2025
Copy link

codspeed-hq bot commented Aug 26, 2025

CodSpeed WallTime Performance Report

Merging #32569 will degrade performances by 27.21%

Comparing cc/1.0/standard_content (2d450d4) with wip-v1.0 (a2322f6)

⚠️ 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

❌ 1 regressions
✅ 12 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_import_time[HumanMessage] 208.3 ms 286.1 ms -27.21%

Copy link

codspeed-hq bot commented Aug 26, 2025

CodSpeed Instrumentation Performance Report

Merging #32569 will not alter performance

Comparing cc/1.0/standard_content (2d450d4) with wip-v1.0 (a2322f6)

Summary

✅ 14 untouched benchmarks

@ccurme ccurme merged commit 2428815 into wip-v1.0 Aug 27, 2025
181 checks passed
@ccurme ccurme deleted the cc/1.0/standard_content branch August 27, 2025 13:31
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