Skip to content

updates to langchain/messages guide - #700

Merged
Lauren Hirata Singh (lnhsingh) merged 13 commits into
mainfrom
cc/messages
Sep 30, 2025
Merged

updates to langchain/messages guide#700
Lauren Hirata Singh (lnhsingh) merged 13 commits into
mainfrom
cc/messages

Conversation

@ccurme

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings September 30, 2025 18:58
@github-actions github-actions Bot added langchain For docs changes to LangChain oss labels Sep 30, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the LangChain messages guide to improve content structure, add token usage documentation, and refactor content blocks. The changes include adding tool call examples, documenting AIMessage token usage metadata, restructuring sections, and simplifying the content blocks explanation.

Key changes:

  • Added comprehensive tool call examples and token usage documentation for AIMessage
  • Restructured content sections and simplified explanations
  • Updated content block specifications for server-side tool execution

@github-actions

Copy link
Copy Markdown
Contributor

Preview ID generated: preview-ccmess-1759258719-c96a049

Comment thread src/oss/langchain/messages.mdx Outdated
Comment thread src/oss/langchain/messages.mdx Outdated
Comment thread src/oss/langchain/messages.mdx Outdated
Co-authored-by: Hunter Lovell <40191806+hntrl@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 30, 2025 19:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

src/oss/langchain/messages.mdx:45

  • The model version 'gpt-5-nano' appears to be fictional or not yet available. Consider using an existing model like 'gpt-4o' or 'gpt-3.5-turbo' for accurate documentation examples.
const model = await initChatModel("openai:gpt-5-nano");

src/oss/langchain/messages.mdx:30

  • The model version 'gpt-5-nano' appears to be fictional or not yet available. Consider using an existing model like 'gpt-4o' or 'gpt-3.5-turbo' for accurate documentation examples.
model = init_chat_model("openai:gpt-5-nano")

src/oss/langchain/messages.mdx:45

  • The model version 'gpt-5-nano' appears to be fictional or not yet available. Consider using an existing model like 'gpt-4o' or 'gpt-3.5-turbo' for accurate documentation examples.
const model = await initChatModel("openai:gpt-5-nano");

@github-actions

Copy link
Copy Markdown
Contributor

Preview ID generated: preview-ccmess-1759259213-abc16af

@eyurtsev Eugene Yurtsev (eyurtsev) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks great!!

Comment thread src/oss/langchain/messages.mdx Outdated
Comment thread src/oss/langchain/messages.mdx Outdated
Comment thread src/oss/langchain/messages.mdx Outdated
Co-authored-by: Eugene Yurtsev <eugene@langchain.dev>
Copilot AI review requested due to automatic review settings September 30, 2025 19:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

src/oss/langchain/messages.mdx:30

  • The model version gpt-5-nano does not exist. OpenAI's current models include gpt-4o, gpt-4, gpt-3.5-turbo, etc. Consider using an existing model like gpt-4o or gpt-4.
model = init_chat_model("openai:gpt-5-nano")

src/oss/langchain/messages.mdx:45

  • The model version gpt-5-nano does not exist. OpenAI's current models include gpt-4o, gpt-4, gpt-3.5-turbo, etc. Consider using an existing model like gpt-4o or gpt-4.
const model = await initChatModel("openai:gpt-5-nano");

@github-actions

Copy link
Copy Markdown
Contributor

Preview ID generated: preview-ccmess-1759260234-9d8700f

@github-actions

Copy link
Copy Markdown
Contributor

Preview ID generated: preview-ccmess-1759260418-63a4642

Copilot AI review requested due to automatic review settings September 30, 2025 19:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

src/oss/langchain/messages.mdx:30

  • The model version 'gpt-5-nano' does not exist. OpenAI's current models include GPT-4 variants but not GPT-5. Consider using a valid model like 'gpt-4o-mini' or 'gpt-4o'.
model = init_chat_model("openai:gpt-5-nano")

src/oss/langchain/messages.mdx:45

  • The model version 'gpt-5-nano' does not exist. OpenAI's current models include GPT-4 variants but not GPT-5. Consider using a valid model like 'gpt-4o-mini' or 'gpt-4o'.
const model = await initChatModel("openai:gpt-5-nano");

@github-actions

Copy link
Copy Markdown
Contributor

Preview ID generated: preview-ccmess-1759260626-5583a8f

@lnhsingh
Lauren Hirata Singh (lnhsingh) merged commit c037f9e into main Sep 30, 2025
11 checks passed
Mason Daugherty (mdrxy) pushed a commit that referenced this pull request Oct 1, 2025
Co-authored-by: Hunter Lovell <40191806+hntrl@users.noreply.github.com>
Co-authored-by: Lauren Hirata Singh <lauren@langchain.dev>
Co-authored-by: Eugene Yurtsev <eugene@langchain.dev>
Nishitha M (imnishitha) added a commit that referenced this pull request Jul 28, 2026
…5056)

## Description
`langchain-ai/deepagents#4969` reverted the alpha `SystemPromptConfig`
(`prefix`/`base`/`suffix` dict) feature, so `system_prompt=` is a plain
`str | SystemMessage` again. This drops the `SystemPromptConfig`
guidance from the Python-side "System prompt" section entirely and fixes
the section intro, which incorrectly claimed a built-in base prompt
ships by default. Also resyncs the Python function-signature snippet
(stale `SystemPromptConfig` reference) and drops the now-stale
`SystemPromptConfig` link-map entry. No changelog changes.

`langchain-ai/deepagentsjs` mirrored the revert (#700, #703), but kept
`SystemPromptConfig` in its type union as a `@deprecated` compatibility
shim slated for removal in the next major release. Dropped it from the
JS signature snippet to match. **Note for reviewers:** that snippet is
normally auto-generated by `scripts/sync_deepagents_signatures.py` from
the live API reference site, which still lists the deprecated type —
don't blindly re-run that script against this one file until
deepagentsjs's next major release actually removes the shim, or it'll
reintroduce `SystemPromptConfig`.

## Test Plan
- [x] `make check-cross-refs`
- [x] `make lint_prose FILES=...` on changed `.mdx` files

Opened collaboratively by Nishitha Madhu and open-swe

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

langchain For docs changes to LangChain oss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants