Token导航 LogoToken导航

Agent Skill · 开发

langchain-structured-output-%26-hitl(LangChain structured output 26 hitl 命令行)

langchain-structured-output-%26-hitl 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

langchain-structured-output-%26-hitl 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,暂无第三方扫描结果,按安装量在开发类的 21,746 个 Skill 里排第 2,295。

总安装 18,631周安装 645GitHub Stars 638下载 5,295核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:langchain-structured-output-%26-hitl(LangChain structured output 26 hitl 命令行)
来源仓库:https://github.com/langchain-ai/langchain-skills
仓库路径:skills/langchain-structured-output-%26-hitl
安装命令:
npx skills add https://github.com/langchain-ai/langchain-skills --skill 'LangChain Structured Output & HITL'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/langchain-ai/langchain-skills --skill 'LangChain Structured Output & HITL'

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于处理 LangChain 结构化输出与人类介入(HITL)流程,适合在需要人机协同的场景中使用。可辅助定义输出格式、校验规则及人工审核节点,提升响应质量与合规性。通过 GitHub 仓库安装,需确认是否会修改配置文件或触发外部服务调用。建议结合实际用例测试其交互逻辑,避免因格式错误导致流程中断。

langchain-structured-output-%26-hitl 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/langchain-structured-output-%26-hitl

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/langchain-ai/langchain-skills --skill 'LangCha…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

langchain-structured-output-%26-hitl 怎么安装?

在终端执行 npx skills add https://github.com/langchain-ai/langchain-skills --skill 'LangChain Structu…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

langchain-structured-output-%26-hitl 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

langchain-structured-output-%26-hitl 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

langchain-structured-output-%26-hitl 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

langchain-structured-output-%26-hitl 用的人多吗?

公开数据是累计安装 18,631 次,近一周安装 645 次,下载 5,295 次,GitHub 638 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

langchain-structured-output-%26-hitl 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
langchain-structured-output-%26-hitl

LangChain structured output 26 hitl 命令行 · 本页

18,631638需要联网未明确未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

  1. Structured Output: Transform unstructured model responses into validated, typed data
  2. Human-in-the-Loop: Add human oversight to agent tool calls, pausing for approval

Key Concepts:

  • response_format: Define expected output schema
  • with_structured_output(): Model method for direct structured output
  • human_in_the_loop_middleware: Pauses execution for human decisions
Use CaseUse Structured Output?
Extract contact info, datesYes
Form fillingYes
API integrationYes
Open-ended Q&ANo

Structured Output

class ContactInfo(BaseModel): name: str email: str = Field(pattern=r"^[^@]+@[^@]+.[^@]+$") phone: str

agent = create_agent(model="gpt-4", response_format=ContactInfo)

result = agent.invoke({"messages": {"role": "user", "content": "Extract: John Doe, [john@example.com, (555) 123-4567"}]}) print(result["structured_response"])

ContactInfo(name='John Doe', email='john@example.com', phone='(555) 123-4567')

</python>
<typescript>
Extract contact information from text using a Zod schema with email validation.

import { ChatOpenAI } from "@langchain/openai"; import { z } from "zod";

const ContactInfo = z.object({ name: z.string(), email: z.string().email(), phone: z.string(), });

const model = new ChatOpenAI({ model: "gpt-4" }); const structuredModel = model.withStructuredOutput(ContactInfo);

const response = await structuredModel.invoke( "Extract: John Doe, john@example.com, (555) 123-4567" ); console.log(response); // { name: 'John Doe', email: 'john@example.com', phone: '(555) 123-4567' }


class Movie(BaseModel): """Movie information.""" title: str = Field(description="Movie title") year: int = Field(description="Release year") director: str rating: float = Field(ge=0, le=10)

model = ChatOpenAI(model="gpt-4") structured_model = model.with_structured_output(Movie)

response = structured_model.invoke("Tell me about Inception") print(response)

# Movie(title="Inception", year=2010, director="Christopher Nolan", rating=8.8)

</python> <typescript> Get movie details as a validated Zod object using withStructuredOutput().

import { ChatOpenAI } from "@langchain/openai";
import { z } from "zod";

const Movie = z.object({
  title: z.string().describe("Movie title"),
  year: z.number().describe("Release year"),
  director: z.string(),
  rating: z.number().min(0).max(10),
});

const model = new ChatOpenAI({ model: "gpt-4" });
const structuredModel = model.withStructuredOutput(Movie);

const response = await structuredModel.invoke("Tell me about Inception");
// { title: "Inception", year: 2010, director: "Christopher Nolan", rating: 8.8 }

class Classification(BaseModel): category: Literal["urgent", "normal", "low"] sentiment: Literal["positive", "neutral", "negative"] confidence: float = Field(ge=0, le=1)

</python>
<typescript>
Define a classification schema with constrained enum values using z.enum().

import { z } from "zod";

const Classification = z.object({ category: z.enum(["urgent", "normal", "low"]), sentiment: z.enum(["positive", "neutral", "negative"]), confidence: z.number().min(0).max(1), });


class Address(BaseModel): street: str city: str state: str zip: str

class Person(BaseModel): name: str age: int = Field(gt=0) email: str address: Address tags: List[str] = Field(default_factory=list)

</python> </ex-complex-nested-schema>


Human-in-the-Loop

<ex-basic-hitl-setup> <python> Set up an agent with HITL middleware that pauses before sending emails for approval.

from langchain.agents import create_agent, human_in_the_loop_middleware
from langgraph.checkpoint.memory import MemorySaver
from langchain.tools import tool

@tool
def send_email(to: str, subject: str, body: str) -> str:
    """Send an email."""
    return f"Email sent to {to}"

agent = create_agent(
    model="gpt-4",
    tools=[send_email],
    checkpointer=MemorySaver(),  # Required for HITL
    middleware=[
        human_in_the_loop_middleware(
            interrupt_on={
                "send_email": {"allowed_decisions": ["approve", "edit", "reject"]},
            }
        )
    ],
)

const sendEmail = tool(async ({to, subject, body}) => Email sent to ${to}, {name: "send_email", description: "Send an email", schema: z.object({to: z.string(), subject: z.string(), body: z.string()}),});

const agent = createReactAgent({llm: model, tools: [sendEmail], checkpointer: new MemorySaver(), // Required for HITL interruptBefore: ["send_email"],});

</typescript>
</ex-basic-hitl-setup>

<ex-running-with-interrupts>
<python>
Run the agent, detect an interrupt, then resume execution after human approval.

from langgraph.types import Command

config = {"configurable": {"thread_id": "session-1"}}

Step 1: Agent runs until it needs to call tool

result1 = agent.invoke({ "messages": [{"role": "user", "content": "Send email to john@example.com"}] }, config=config)

Check for interrupt

if "__interrupt__" in result1: print(f"Waiting for approval: {result1['__interrupt__']}")

Step 2: Human approves

result2 = agent.invoke( Command(resume={"decisions": [{"type": "approve"}]}), config=config )


const config = {configurable: {thread_id: "session-1"}};

// Step 1: Agent runs until it needs to call tool const result1 = await agent.invoke({messages: [{role: "user", content: "Send email to [john@example.com](https://github.com/langchain-ai/langchain-skills/blob/HEAD/config/skills/langchain-output/mailto:john@example.com)"}]}, config);

// Check for interrupt if (result1.**interrupt**) {console.log(`Waiting for approval: ${result1.__interrupt__}`);}

// Step 2: Human approves const result2 = await agent.invoke(new Command({resume: {decisions: [{type: "approve"}]}}), config);

</typescript> </ex-running-with-interrupts>

<ex-editing-tool-arguments> <python> Edit the tool arguments before approving when the original values need correction.

# Human edits the arguments
result2 = agent.invoke(
    Command(resume={
        "decisions": [{
            "type": "edit",
            "args": {
                "to": "alice@company.com",  # Fixed email
                "subject": "Project Meeting - Updated",
                "body": "...",
            },
        }]
    }),
    config=config
)

Structured Output:

  • Schema structure: Any valid Pydantic/Zod model
  • Field validation: Types, ranges, regex, etc.

HITL:

  • Which tools require approval
  • Allowed decisions per tool (approve, edit, reject)

CORRECT

print(result["structured_response"])

</python>
<typescript>
With withStructuredOutput, response IS the structured data.

const response = await structuredModel.invoke("..."); console.log(response); // Directly the parsed object


# CORRECT

class Data(BaseModel): date: str = Field(description="Date in YYYY-MM-DD format") amount: float = Field(description="Amount in USD")

</python> <typescript> Add field descriptions to guide the model on expected formats.

// WRONG
const Data = z.object({ date: z.string(), amount: z.number() });

// CORRECT
const Data = z.object({
  date: z.string().describe("Date in YYYY-MM-DD format"),
  amount: z.number().describe("Amount in USD"),
});

CORRECT

class Data(BaseModel): items: List[str] = Field(default_factory=list)

</python>
</fix-not-using-correct-type-hints>

<fix-missing-checkpointer>
<python>
HITL middleware requires a checkpointer to persist state.

WRONG

agent = create_agent(model="gpt-4", tools=[send_email], middleware=[human_in_the_loop_middleware({...})])

CORRECT

agent = create_agent( model="gpt-4", tools=[send_email], checkpointer=MemorySaver(), # Required middleware=[human_in_the_loop_middleware({...})] )


// CORRECT const agent = createReactAgent({llm: model, tools: [sendEmail], checkpointer: new MemorySaver(), // Required interruptBefore: ["send_email"]});

</typescript> </fix-missing-checkpointer>

<fix-no-thread-id> <python> Always provide thread_id when using HITL to track conversation state.

# WRONG
agent.invoke(input)  # No config!

# CORRECT
agent.invoke(input, config={"configurable": {"thread_id": "user-123"}})

CORRECT

from langgraph.types import Command agent.invoke(Command(resume={"decisions": [{"type": "approve"}]}), config=config)

</python>
<typescript>
Use Command class to resume execution after an interrupt.

// WRONG await agent.invoke({ resume: { decisions: [...] } });

// CORRECT import { Command } from "@langchain/langgraph"; await agent.invoke(new Command({ resume: { decisions: [{ type: "approve" }] } }), config);

平台分布

Codex

34.46%
按下载量换算1,825

Claude

29.35%
按下载量换算1,554

Cursor

19.38%
按下载量换算1,026

Gemini CLI

9.48%
按下载量换算502

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills