Skip to content

Conversation

mdrxy
Copy link
Collaborator

@mdrxy mdrxy commented Aug 21, 2025

TODO

  • bump dep on core (1.0)

ccurme and others added 30 commits August 11, 2025 14:52
mdrxy and others added 14 commits August 15, 2025 16:39
re: #32589 cc: @ccurme
- Rename namespace: `messages.content_blocks` -> `messages.content`
- Prefixes and ID logic are now in `messages.common` instead of
`AIMessage` since the logic is shared between messages and message
content. Did this instead of `utils` due to circular import problems
that were hairy
Put in `core.utils` this time to prevent other circular import issues
present in the `normalize()` rfc:

`base` imports `content`
`content` imports `ensure_id()` from `base`
…ders (#32602)

Extensible registry system for translating AI message content blocks
from various model providers. Refactors the way provider-specific
content is handled, moving from hardcoded logic to a plugin-like
architecture.
# Conflicts:
#	libs/core/langchain_core/messages/ai.py
… IDs from messages (#32572)

> [!WARNING]
> **BREAKING:** Simplifies message normalization to single consistent
path, requiring partner package updates

**Key Changes:**
- Consistent multimodal handling:
- OpenAI `image_url` blocks pass through unchanged (broad compatibility)
- 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

**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)

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
@mdrxy mdrxy requested a review from eyurtsev as a code owner August 21, 2025 19:49
@mdrxy mdrxy added the integration Related to a provider partner package integration label Aug 21, 2025
@mdrxy mdrxy added this to the v1 milestone Aug 21, 2025
Copy link

vercel bot commented Aug 21, 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 22, 2025 3:21pm

Copy link

codspeed-hq bot commented Aug 21, 2025

CodSpeed WallTime Performance Report

Merging #32644 will degrade performances by 29.8%

Comparing mdrxy/1.0/ollama (67d9c31) with cc/1.0/standard_content (d111965)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

❌ 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] 211.8 ms 301.7 ms -29.8%

Footnotes

  1. No successful run was found on cc/1.0/standard_content (5bcf7d0) during the generation of this report, so 823c15c 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 21, 2025

CodSpeed Instrumentation Performance Report

Merging #32644 will degrade performances by 60.46%

Comparing mdrxy/1.0/ollama (67d9c31) with cc/1.0/standard_content (d111965)1

Summary

⚡ 1 improvements
❌ 1 regressions
✅ 12 untouched benchmarks

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

Benchmarks breakdown

Benchmark BASE HEAD Change
test_stream_time 15.9 ms 40.2 ms -60.46%
test_stream_time 1,209.3 ms 942.6 ms +28.31%

Footnotes

  1. No successful run was found on cc/1.0/standard_content (5bcf7d0) during the generation of this report, so 823c15c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@mdrxy mdrxy added the codspeed-ignore ⚠️ Shouldn't be regularly used! Bypasses Codspeed performance checks label Aug 21, 2025
@mdrxy mdrxy marked this pull request as draft August 21, 2025 21:48
@mdrxy mdrxy self-assigned this Aug 21, 2025
@mdrxy mdrxy requested a review from ccurme August 21, 2025 21:48
Base automatically changed from cc/1.0/standard_content to wip-v1.0 August 27, 2025 13:31
@mdrxy mdrxy mentioned this pull request Sep 8, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codspeed-ignore ⚠️ Shouldn't be regularly used! Bypasses Codspeed performance checks integration Related to a provider partner package integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants