Files
langgraphjs/examples/ai-elements
github-actions[bot] 39ce52f248 chore: version packages (#2436)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @langchain/langgraph-sdk@1.9.7

### Patch Changes

- [#2435](https://github.com/langchain-ai/langgraphjs/pull/2435)
[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(sdk): unwrap Command tool outputs and hide scoped task tools

    Filter wrapper `task` dispatch events from subagent-scoped tool-call
    projections and parse embedded ToolMessage results from LangGraph
    `Command` payloads on `tool-finished`.

- [#2434](https://github.com/langchain-ai/langgraphjs/pull/2434)
[`6b188e8`](https://github.com/langchain-ai/langgraphjs/commit/6b188e80ab989fc8396e1926f729d93b786ca671)
Thanks [@hntrl](https://github.com/hntrl)! - fix(react): avoid eager
stream getter evaluation during object spread

Mark optional `useStream` accessors as non-enumerable so object
spread/rest destructuring does not accidentally read guarded fields like
`history` or opt into additional stream modes.

## @langchain/angular@1.0.7

### Patch Changes

- [#2435](https://github.com/langchain-ai/langgraphjs/pull/2435)
[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(sdk): unwrap Command tool outputs and hide scoped task tools

    Filter wrapper `task` dispatch events from subagent-scoped tool-call
    projections and parse embedded ToolMessage results from LangGraph
    `Command` payloads on `tool-finished`.

- Updated dependencies
\[[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e),
[`6b188e8`](https://github.com/langchain-ai/langgraphjs/commit/6b188e80ab989fc8396e1926f729d93b786ca671)]:
    -   @langchain/langgraph-sdk@1.9.7

## @langchain/react@1.0.7

### Patch Changes

- [#2435](https://github.com/langchain-ai/langgraphjs/pull/2435)
[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(sdk): unwrap Command tool outputs and hide scoped task tools

    Filter wrapper `task` dispatch events from subagent-scoped tool-call
    projections and parse embedded ToolMessage results from LangGraph
    `Command` payloads on `tool-finished`.

- Updated dependencies
\[[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e),
[`6b188e8`](https://github.com/langchain-ai/langgraphjs/commit/6b188e80ab989fc8396e1926f729d93b786ca671)]:
    -   @langchain/langgraph-sdk@1.9.7

## @langchain/svelte@1.0.7

### Patch Changes

- [#2435](https://github.com/langchain-ai/langgraphjs/pull/2435)
[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(sdk): unwrap Command tool outputs and hide scoped task tools

    Filter wrapper `task` dispatch events from subagent-scoped tool-call
    projections and parse embedded ToolMessage results from LangGraph
    `Command` payloads on `tool-finished`.

- Updated dependencies
\[[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e),
[`6b188e8`](https://github.com/langchain-ai/langgraphjs/commit/6b188e80ab989fc8396e1926f729d93b786ca671)]:
    -   @langchain/langgraph-sdk@1.9.7

## @langchain/vue@1.0.7

### Patch Changes

- [#2435](https://github.com/langchain-ai/langgraphjs/pull/2435)
[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(sdk): unwrap Command tool outputs and hide scoped task tools

    Filter wrapper `task` dispatch events from subagent-scoped tool-call
    projections and parse embedded ToolMessage results from LangGraph
    `Command` payloads on `tool-finished`.

- Updated dependencies
\[[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e),
[`6b188e8`](https://github.com/langchain-ai/langgraphjs/commit/6b188e80ab989fc8396e1926f729d93b786ca671)]:
    -   @langchain/langgraph-sdk@1.9.7

## @example/ai-elements@0.1.22

### Patch Changes

- Updated dependencies
\[[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e)]:
    -   @langchain/react@1.0.7

## @examples/assistant-ui-claude@0.1.22

### Patch Changes

- Updated dependencies
\[[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e)]:
    -   @langchain/react@1.0.7

## @examples/ui-angular@0.0.32

### Patch Changes

- Updated dependencies
\[[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e),
[`6b188e8`](https://github.com/langchain-ai/langgraphjs/commit/6b188e80ab989fc8396e1926f729d93b786ca671)]:
    -   @langchain/langgraph-sdk@1.9.7
    -   @langchain/angular@1.0.7

## @examples/ui-multimodal@0.0.8

### Patch Changes

- Updated dependencies
\[[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e)]:
    -   @langchain/react@1.0.7

## @examples/ui-react@0.0.8

### Patch Changes

- Updated dependencies
\[[`cfc8d27`](https://github.com/langchain-ai/langgraphjs/commit/cfc8d274e4dc99cb73ebd9abc4f971622105f08e),
[`6b188e8`](https://github.com/langchain-ai/langgraphjs/commit/6b188e80ab989fc8396e1926f729d93b786ca671)]:
    -   @langchain/langgraph-sdk@1.9.7
    -   @langchain/react@1.0.7

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-26 14:09:43 -07:00
..
2026-05-26 14:09:43 -07:00
2026-05-26 14:09:43 -07:00

AI Elements — Tool-Calling Agent Example

A self-contained chat interface built with AI Elements components and @langchain/react. It demonstrates how to build a production-quality agentic UI using AI Elements' composable component library.

What it shows

  • Tool call rendering — each tool invocation is displayed with Tool + ToolHeader + ToolContent + ToolInput + ToolOutput, updating live as the agent streams tool input and then the result.
  • Reasoning display — when the model emits reasoning tokens, a collapsible Reasoning block auto-opens during streaming and collapses when done.
  • Streaming messagesMessage + MessageContent + MessageResponse renders streaming markdown via Streamdown with full GFM support.
  • Loading skeleton — a Shimmer placeholder appears between the user's message and the first assistant token.
  • Conversation scrollConversation + ConversationContent + ConversationScrollButton auto-scrolls and shows a jump-to-bottom button when you scroll up.
  • Message actionsMessageActions + MessageAction with a copy button appears below the last assistant message once streaming completes.
  • Prompt inputPromptInput + PromptInputBody + PromptInputTextarea + PromptInputFooter + PromptInputSubmit provides a full-featured input bar.
  • SuggestionsSuggestions + Suggestion shows preset prompts before the first message.

Agent

The backing LangGraph agent (packages/agents/src/agents/ai-elements.ts) is a createReactAgent with two simulated tools:

Tool Description
get_weather Returns deterministic simulated weather data for any city
web_search Returns three simulated search result objects for any query

No external API keys are required for the tools.

Setup

Create a .env file in this folder (optional — defaults are provided):

VITE_LANGGRAPH_API_URL=http://localhost:2024   # default when running locally
VITE_LANGGRAPH_ASSISTANT_ID=ai_elements         # matches langgraph.json

Run

Start the LangGraph agent server first:

bun run dev --filter=@langchain/playground-agents

Then start this preview app:

bun run dev --filter=@langchain/playground-preview-ai-elements

Open http://localhost:4600.

AI Elements components used

Component Source file
Conversation, ConversationContent, ConversationScrollButton src/components/ai-elements/conversation.tsx
Message, MessageContent, MessageResponse, MessageActions, MessageAction src/components/ai-elements/message.tsx
PromptInput, PromptInputBody, PromptInputTextarea, PromptInputFooter, PromptInputSubmit src/components/ai-elements/prompt-input.tsx
Tool, ToolHeader, ToolContent, ToolInput, ToolOutput src/components/ai-elements/tool.tsx
Reasoning, ReasoningTrigger, ReasoningContent src/components/ai-elements/reasoning.tsx
Suggestions, Suggestion src/components/ai-elements/suggestion.tsx
Shimmer src/components/ai-elements/shimmer.tsx

Components live in src/components/ai-elements/ and are owned by this package (shadcn/AI Elements registry style — copy-paste, not a node_modules import).

Vite path alias

AI Elements components use bare src/ imports (e.g. import { cn } from "src/lib/utils"). The vite.config.ts maps src./src to resolve these correctly in both dev and production builds.