langgraph-agent

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LangGraph Agent Skill

LangGraph Agent Skill

This skill provides a LangGraph-based agent framework for consistent tool calling across all OpenAI-compatible LLM providers.
本Skill提供一个基于LangGraph的Agent框架,可在所有OpenAI兼容的LLM提供商中实现一致的工具调用。

When to Use

适用场景

  • You need guaranteed tool calling consistency (especially with GLM-5, Zhipu, or other models with inconsistent tool invocation)
  • You want automatic tool loops that keep calling tools until the task is complete
  • You're working with multiple LLM providers and need a unified interface
  • You need to build custom agents with specific tool sets
  • 你需要确保工具调用的一致性(尤其是在使用GLM-5、智谱或其他工具调用不一致的模型时)
  • 你希望拥有自动工具循环,能够持续调用工具直到任务完成
  • 你正在使用多个LLM提供商,需要一个统一的接口
  • 你需要构建带有特定工具集的自定义Agent

Capabilities

功能特性

  • create_agent: Create a LangGraph agent with custom tools
  • run_agent: Execute a task with the agent
  • add_tool: Add a custom tool to an agent
  • get_agent_result: Retrieve the final result from agent execution
  • create_agent:创建带有自定义工具的LangGraph Agent
  • run_agent:使用Agent执行任务
  • add_tool:向Agent添加自定义工具
  • get_agent_result:从Agent执行中获取最终结果

Environment Variables

环境变量

Required for the agent to function:
  • LLM_API_KEY
    : Your LLM provider API key
  • LLM_BASE_URL
    (optional): Custom base URL for OpenAI-compatible providers (default: OpenAI)
  • LLM_MODEL
    (optional): Model name (default: "gpt-4o")
Agent运行所需的环境变量:
  • LLM_API_KEY
    :你的LLM提供商API密钥
  • LLM_BASE_URL
    (可选):OpenAI兼容提供商的自定义基础URL(默认:OpenAI)
  • LLM_MODEL
    (可选):模型名称(默认:"gpt-4o")

Provider Examples

提供商示例

undefined
undefined

Z.AI / GLM-5

Z.AI / GLM-5

LLM_BASE_URL=https://api.z.ai/api/coding/paas/v4 LLM_MODEL=glm-5
LLM_BASE_URL=https://api.z.ai/api/coding/paas/v4 LLM_MODEL=glm-5

OpenRouter

OpenRouter

LLM_BASE_URL=https://openrouter.ai/api/v1 LLM_MODEL=meta-llama/llama-3-70b-instruct
LLM_BASE_URL=https://openrouter.ai/api/v1 LLM_MODEL=meta-llama/llama-3-70b-instruct

Groq

Groq

LLM_BASE_URL=https://api.groq.com/openai/v1 LLM_MODEL=llama3-70b-8192
LLM_BASE_URL=https://api.groq.com/openai/v1 LLM_MODEL=llama3-70b-8192

Ollama (local)

Ollama (local)

LLM_BASE_URL=http://localhost:11434/v1 LLM_MODEL=llama3
LLM_BASE_URL=http://localhost:11434/v1 LLM_MODEL=llama3

DeepSeek

DeepSeek

LLM_BASE_URL=https://api.deepseek.com LLM_MODEL=deepseek-chat
undefined
LLM_BASE_URL=https://api.deepseek.com LLM_MODEL=deepseek-chat
undefined

Usage Pattern

使用流程

  1. Create an agent with the tools you need
  2. Run the agent with a task prompt
  3. The agent automatically loops through tool calls until completion
  4. Retrieve the final result
  1. 创建带有所需工具的Agent
  2. 使用任务提示词运行Agent
  3. Agent会自动循环调用工具直到任务完成
  4. 获取最终结果