LoongSuite DeepAgents Instrumentation
Project description
LoongSuite DeepAgents Instrumentation
LoongSuite instrumentation for DeepAgents.
Installation
pip install loongsuite-instrumentation-deepagents
Usage
from opentelemetry.instrumentation.deepagents import DeepAgentsInstrumentor
DeepAgentsInstrumentor().instrument()
from deepagents import create_deep_agent
When instrumenting manually, call DeepAgentsInstrumentor().instrument() before
importing or binding deepagents.create_deep_agent. Auto-instrumentation runs
before application imports and does not need this extra ordering step.
What it does
This instrumentation patches deepagents.graph.create_deep_agent so the final
graph returned by DeepAgents is marked with _loongsuite_react_agent = True.
It also marks the graph as a DeepAgents agent and injects the same flags into
call-time RunnableConfig metadata for invoke, ainvoke, stream, and
astream.
The marker is consumed by loongsuite-instrumentation-langchain, which routes
the DeepAgents root graph span as an AGENT span instead of a generic CHAIN
span.
The LangChain tracer also maps each DeepAgents model decision node to a
react step span. Multi-round tool flows end the previous step with
gen_ai.react.finish_reason = "tool_calls" and the final step with "stop".
This package intentionally does not create separate ENTRY spans or GenAI
metrics.
For DeepAgents skills, the framework first loads skill metadata through
SkillsMiddleware.before_agent and exposes the available skills in the system
prompt. Loading the full skill instructions happens when the agent calls the
built-in filesystem tool to read the skill file, for example
read_file(file_path="/skills/foo/SKILL.md"). That execute_tool read_file
span is annotated with gen_ai.skill.name, gen_ai.skill.id,
gen_ai.skill.description, and gen_ai.skill.version when the file path
matches a registered top-level SKILL.md. Reading helper files under the same
skill directory is recorded as a normal file read, not as a skill load.
Compatibility
deepagents >= 0.6.0, < 0.7.0- Python 3.11+
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file loongsuite_instrumentation_deepagents-0.7.0-py3-none-any.whl.
File metadata
- Download URL: loongsuite_instrumentation_deepagents-0.7.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37bc9d6d6d4d40ed65d8bf8ad78328e671c360f5ce8519af1dad10b6774cf97d
|
|
| MD5 |
891056412f6e0f84ffca87319ac7c10a
|
|
| BLAKE2b-256 |
89d90dca21d3a1cd5cbd4b7ba5236c5502b513c1311f0a6448bd35efe208e8d9
|