一键导入
neatlogs-py-dspy
Use when adding neatlogs observability to a Python project that uses DSPy (imports `dspy`, defines `dspy.Module`s / signatures).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when adding neatlogs observability to a Python project that uses DSPy (imports `dspy`, defines `dspy.Module`s / signatures).
用 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 the Google Agent Development Kit (imports `google.adk`, builds an ADK agent/runner).
| name | neatlogs-py-dspy |
| description | Use when adding neatlogs observability to a Python project that uses DSPy (imports `dspy`, defines `dspy.Module`s / signatures). |
| compatibility | Neatlogs Wizard Agent |
| metadata | {"author":"neatlogs","version":"1.0","language":"python","framework":"dspy"} |
This project uses DSPy (dspy.Module, dspy.Predict, dspy.ChainOfThought, dspy.ReAct). Neatlogs instruments it with neatlogs.wrap(module).
neatlogs.wrap(module)neatlogs.wrap() installs DSPy class-level hooks (idempotent, global), so passing ANY module instance — including your own dspy.Module subclass — patches every module call, nested. Span tree:
CHAIN dspy.Module.__call__ (Predict / ChainOfThought / ReAct / custom — every module call, nested)
↳ LLM dspy.LM.__call__ (the underlying model request)
↳ RETRIEVER dspy.Retrieve.__call__ (if used)
Combine with @neatlogs.span / neatlogs.trace / neatlogs.log for your own orchestration. The DSPy CHAIN/LLM spans nest under your manual spans.
references/1-install.mdreferences/2-add-init.mdreferences/3-set-env.mdreferences/4-wrap-module.mdreferences/5-spans-trace-log.mdreferences/6-flush-shutdown.mdneatlogs.init() MUST run BEFORE importing dspy (so class hooks patch at the right time). load_dotenv() runs before init().neatlogs.wrap(module), NOT instrumentations=["dspy"]. wrap() patches DSPy's classes directly and works on ANY DSPy version. The instrumentations=["dspy"] path uses the OpenInference DSPy instrumentor, which requires DSPy ≥ 2.6.0 and silently emits no spans on older DSPy — so prefer wrap(), especially when the project pins DSPy < 2.6.neatlogs.wrap(module) installs GLOBAL DSPy class hooks — calling it once on any module instance traces ALL module/LM calls. Wrapping the top-level pipeline module is enough.wrap() returns the module unchanged; you can keep using your existing variable.@span/trace — the CHAIN span is created by the hook. Use @span for YOUR orchestration only.os.getenv().import neatlogs at module top level.references/5-spans-trace-log.mdreferences/span-kinds.mdreferences/sessions-and-end-users.md