useMessages (src/selectors.svelte.ts)

langgraphjs · libs/sdk-svelte/src/selectors.svelte.ts · typescript · MIT
ui

Provides reactive Svelte selectors to access and project specific parts of an agentic stream state, such as messages, tool calls, and channel effects.

// Source: https://github.com/langchain-ai/langgraphjs | License: MIT | Copyright 2024 LangChain
// Provided via justclaw.it.com; keep this notice with the code.
import type { BaseMessage } from "@langchain/core/messages";
import {
  NAMESPACE_SEPARATOR,
  DEFAULT_MESSAGES_KEY,
  acquireChannelEffect,
  audioProjection,
  channelProjection,
  extensionProjection,
  filesProjection,
  imagesProjection,
  messagesProjection,
  toolCallsProjection,
  valuesProjection,
  videoProjection,
  type AssembledToolCall,
  type AudioMedia,
  type Channel,
  type ChannelEffectOptions,
  type ChannelProjectionOptions,
  type Event,
  type FileMedia,
  type ImageMedia,
  type InferToolCalls,
  type InferStateType,
  type MessageMetadata,
  type MessageMetadataMap,
  type SubagentDiscoverySnapshot,
  type

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key