一键导入
neatlogs-py-pydantic-ai
Use when adding neatlogs observability to a Python project that uses Pydantic AI (imports `pydantic_ai`, constructs an `Agent`).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when adding neatlogs observability to a Python project that uses Pydantic AI (imports `pydantic_ai`, constructs an `Agent`).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when adding neatlogs observability to a Python project that uses LangChain or LangGraph (imports `langchain*` / `langgraph`, builds chains, runnables, or a graph).
Use when adding neatlogs observability to a TypeScript/Node.js project that uses LangChain or LangGraph (depends on `@langchain/*` / `@langchain/langgraph`).
Use when adding neatlogs observability to a Python project that uses CrewAI (imports `crewai`, builds a Crew/Flow with agents and tasks).
Use when adding neatlogs observability to a Go project — Google Gemini (genai), Google ADK agents, or custom code. Covers Init, WrapGenAI, ADK passthrough, Trace, and Identify (sessions & end-users).
Use when adding neatlogs observability to a Python project that uses the Agno agent framework (imports `agno`, constructs Agno `Agent`s).
Use when adding neatlogs observability to a Python project that uses DSPy (imports `dspy`, defines `dspy.Module`s / signatures).
| name | neatlogs-py-pydantic-ai |
| description | Use when adding neatlogs observability to a Python project that uses Pydantic AI (imports `pydantic_ai`, constructs an `Agent`). |
| compatibility | Neatlogs Wizard Agent |
| metadata | {"author":"neatlogs","version":"1.0","language":"python","framework":"pydantic-ai"} |
This project uses Pydantic AI (pydantic_ai.Agent). Neatlogs instruments it with neatlogs.wrap(agent) — wrap each Agent instance once and its run/model/tool calls are auto-traced.
neatlogs.wrap(agent)neatlogs.wrap() detects the Pydantic AI Agent and patches run / run_sync / run_stream / iter, plus installs class-level model (LLM) and tool (TOOL) hooks. Wrapping produces a nested span tree:
AGENT (agent.run / run_sync / run_stream / iter)
↳ LLM (Model.request / request_stream — one per model call)
↳ TOOL (one per tool invocation)
Combine it with the manual primitives for your own orchestration code:
@neatlogs.span(kind="WORKFLOW"|"CHAIN"|...) — decorate functions that orchestrate agent calls.neatlogs.trace("name") — group multiple operations / track prompt templates.neatlogs.log("msg {x}", x=...) — timestamped steps inside a span.The wrapper's AGENT/LLM/TOOL spans nest correctly under whatever @span/trace is active.
references/1-install.mdreferences/2-add-init.mdreferences/3-set-env.mdreferences/4-wrap-agent.mdreferences/5-spans-trace-log.mdreferences/6-flush-shutdown.mdneatlogs.init() MUST run BEFORE importing pydantic_ai (so class-level hooks patch at the right time). If load_dotenv() exists, it runs before init().Agent instance whose runs you want traced: agent = neatlogs.wrap(agent). wrap() returns the same instance (also patches in place); use the returned reference.wrap() already creates the AGENT/LLM/TOOL spans — do NOT also wrap a single agent.run() in @span/trace. Use @span only for YOUR surrounding orchestration functions.os.getenv().import neatlogs at module top level, never inside functions.references/5-spans-trace-log.mdreferences/span-kinds.mdreferences/sessions-and-end-users.md