langsmith-fetch
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFetching LangSmith Traces
获取LangSmith Traces
Requires in project dependencies and in a file.
langsmith-fetchLANGSMITH_API_KEY.env需要项目依赖中包含,且文件中配置有。
langsmith-fetch.envLANGSMITH_API_KEYSetup
配置
First, find the file containing :
.envLANGSMITH_API_KEYbash
find . -name ".env" -type f 2>/dev/null | head -5首先,找到包含的文件:
LANGSMITH_API_KEY.envbash
find . -name ".env" -type f 2>/dev/null | head -5Commands
命令
Use with all commands:
--env-file <path-to-.env>bash
undefined所有命令都需要搭配使用:
--env-file <.env文件路径>bash
undefinedFetch recent traces (uses LANGSMITH_PROJECT from .env, or specify --project-uuid)
Fetch recent traces (uses LANGSMITH_PROJECT from .env, or specify --project-uuid)
uv run --env-file <path> langsmith-fetch traces ./traces --limit 10
uv run --env-file <path> langsmith-fetch traces ./traces --project-uuid <uuid> --limit 10
uv run --env-file <path> langsmith-fetch traces ./traces --limit 10
uv run --env-file <path> langsmith-fetch traces ./traces --project-uuid <uuid> --limit 10
Fetch single trace by ID
Fetch single trace by ID
uv run --env-file <path> langsmith-fetch trace <trace-id>
uv run --env-file <path> langsmith-fetch trace <trace-id>
Include metadata (timing, tokens, costs)
Include metadata (timing, tokens, costs)
uv run --env-file <path> langsmith-fetch trace <trace-id> --include-metadata
undefineduv run --env-file <path> langsmith-fetch trace <trace-id> --include-metadata
undefinedOutput Formats
输出格式
- - Human-readable (default)
--format pretty - - Pretty-printed JSON
--format json - - Compact JSON for piping
--format raw
- - 人类可读格式(默认)
--format pretty - - 格式化输出的JSON
--format json - - 适用于管道传输的紧凑JSON
--format raw
Troubleshooting Workflow
排查工作流
- Find :
.envfind . -name ".env" -type f 2>/dev/null - Fetch recent traces:
uv run --env-file <path> langsmith-fetch traces ./debug --limit 10 - Find relevant trace in saved JSON files
- Check: What tools were called? What did they return? Was it correct/expected?
- 查找文件:
.envfind . -name ".env" -type f 2>/dev/null - 获取最近的traces:
uv run --env-file <path> langsmith-fetch traces ./debug --limit 10 - 在保存的JSON文件中找到相关trace
- 检查:调用了哪些工具?它们的返回结果是什么?是否正确/符合预期?