[GH-ISSUE #989] [langsmith]: How to provide custom context input in LangSmith Studio (raw JSON/YAML mode) #125

Open
opened 2026-02-17 17:19:14 -05:00 by yindo · 3 comments
Owner

Originally created by @d0lwl0b on GitHub (Oct 19, 2025).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/989

Type of issue

question

Language

JavaScript

Description

I'm trying to figure out how to provide a custom context input in LangSmith Studio, especially when using raw JSON or YAML input.

Image
Originally created by @d0lwl0b on GitHub (Oct 19, 2025). Original GitHub issue: https://github.com/langchain-ai/docs/issues/989 ### Type of issue question ### Language JavaScript ### Description I'm trying to figure out **how to provide a custom `context` input in LangSmith Studio**, especially when using **raw JSON or YAML** input. <img width="1573" height="786" alt="Image" src="https://github.com/user-attachments/assets/b64df6fa-fe63-4405-9924-0aada5cad2b9" />
yindo added the langsmithexternal labels 2026-02-17 17:19:14 -05:00
Author
Owner

@d0lwl0b commented on GitHub (Oct 19, 2025):

// src/lib/ai/utils/types.ts

import { MessagesZodState } from "@langchain/langgraph";
import { z } from "zod";

export const CustomContextSchema = z.object({
  userId: z.string(),
  clientType: z.enum(["telegram-bot", "web"]),
});

export const CustomStateSchema = z.object({
  messages: MessagesZodState.shape.messages,
});

// === Types ===
export type CustomState = z.infer<typeof CustomStateSchema>;
export type CustomContext = z.infer<typeof CustomContextSchema>;
    "@langchain/core": "1.0",
    "@langchain/langgraph": "^1.0",
    "@langchain/langgraph-checkpoint-postgres": "^1.0",
    "@langchain/mcp-adapters": "^1.0",
    "@langchain/openai": "^1.0",
    "langchain": "1.0",
@d0lwl0b commented on GitHub (Oct 19, 2025): ```ts // src/lib/ai/utils/types.ts import { MessagesZodState } from "@langchain/langgraph"; import { z } from "zod"; export const CustomContextSchema = z.object({ userId: z.string(), clientType: z.enum(["telegram-bot", "web"]), }); export const CustomStateSchema = z.object({ messages: MessagesZodState.shape.messages, }); // === Types === export type CustomState = z.infer<typeof CustomStateSchema>; export type CustomContext = z.infer<typeof CustomContextSchema>; ``` ```json "@langchain/core": "1.0", "@langchain/langgraph": "^1.0", "@langchain/langgraph-checkpoint-postgres": "^1.0", "@langchain/mcp-adapters": "^1.0", "@langchain/openai": "^1.0", "langchain": "1.0", ```
Author
Owner

@d0lwl0b commented on GitHub (Oct 19, 2025):

The distinction between context and state is a bit confusing.
Could you please consider adding a dedicated section that clarifies how

store and checkpointer,
context and state,
runtime and config

relate to each other?

@d0lwl0b commented on GitHub (Oct 19, 2025): The distinction between `context` and `state` is a bit confusing. Could you please consider adding a dedicated section that clarifies how `store` and `checkpointer`, `context` and `state`, `runtime` and `config` relate to each other?
yindo changed title from [langsmith]: How to provide custom `context` input in LangSmith Studio (raw JSON/YAML mode) to [GH-ISSUE #989] [langsmith]: How to provide custom `context` input in LangSmith Studio (raw JSON/YAML mode) 2026-06-05 17:25:12 -04:00
Author
Owner

@mvisser-sdu commented on GitHub (Apr 7, 2026):

I'd like to know this as well!

<!-- gh-comment-id:4199699594 --> @mvisser-sdu commented on GitHub (Apr 7, 2026): I'd like to know this as well!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#125