Skip to content

chore: v1 formatting #32566

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 64 commits into
base: wip-v1.0
Choose a base branch
from
Draft

chore: v1 formatting #32566

wants to merge 64 commits into from

Conversation

mdrxy
Copy link
Collaborator

@mdrxy mdrxy commented Aug 15, 2025

No description provided.

@mdrxy mdrxy requested a review from eyurtsev as a code owner August 15, 2025 17:59
@mdrxy mdrxy added this to the v1 milestone Aug 15, 2025
@mdrxy mdrxy added the linting Linting, formatting, or typing label Aug 15, 2025
Copy link

vercel bot commented Aug 15, 2025

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

Project Deployment Preview Comments Updated (UTC)
langchain Ready Ready Preview Comment Aug 25, 2025 6:37pm

@mdrxy mdrxy added the codspeed-ignore ⚠️ Shouldn't be regularly used! Bypasses Codspeed performance checks label Aug 15, 2025
Copy link

codspeed-hq bot commented Aug 15, 2025

CodSpeed WallTime Performance Report

Merging #32566 will not alter performance

Comparing mdrxy/v1-formatting (cac0554) with master (fe740a9)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-v1.0 (a4e135b) during the generation of this report, so master (fe740a9) 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 15, 2025

CodSpeed Instrumentation Performance Report

Merging #32566 will not alter performance

Comparing mdrxy/v1-formatting (cac0554) with master (fe740a9)1

Summary

✅ 14 untouched benchmarks

Footnotes

  1. No successful run was found on wip-v1.0 (a4e135b) during the generation of this report, so master (fe740a9) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@mdrxy mdrxy changed the title chore: formatting chore: v1 formatting Aug 15, 2025
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
mdrxy and others added 6 commits August 18, 2025 17:24
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.
ccurme and others added 2 commits August 21, 2025 14:12
# 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 <[email protected]>
@mdrxy mdrxy marked this pull request as draft August 21, 2025 21:50
@mdrxy mdrxy force-pushed the mdrxy/v1-formatting branch from 4c2ab66 to 4d19be3 Compare August 25, 2025 18:21
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 linting Linting, formatting, or typing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants