LoongSuite WildToolBench Instrumentation
Project description
LoongSuite WildToolBench Instrumentation
OpenTelemetry instrumentation for the WildToolBench benchmark framework.
Installation
WildToolBench is not available on PyPI. Install it from source:
pip install -e /path/to/WildToolBench/wild-tool-bench
pip install loongsuite-instrumentation-wildtool
Requirements
- OpenAI provider instrumentation: To produce LLM spans, you must also enable an OpenAI provider instrumentation (e.g.,
opentelemetry-instrumentation-openaior LoongSuite's equivalent). This plugin creates ENTRY/AGENT/CHAIN/STEP/TOOL spans but does not create LLM spans itself.
Usage
from opentelemetry.instrumentation.wildtool import WildToolInstrumentor
WildToolInstrumentor().instrument()
# Run WildToolBench as usual — spans are automatically generated.
Span Topology
ENTRY (enter_ai_application_system)
└── AGENT (invoke_agent wildtool)
└── CHAIN (workflow task_{idx})
└── STEP (react step)
├── [LLM span — provider instrumentation]
└── TOOL (execute_tool {tool_name})
Patch Points
| # | Target | Span Type |
|---|---|---|
| P1 | multi_threaded_inference |
ENTRY |
| P2 | BaseHandler.inference_multi_turn |
AGENT |
| P3 | BaseHandler.inference_and_eval_multi_step |
CHAIN + TOOL |
| P4 | BaseHandler._request_tool_call |
STEP |
| P5 | BaseHandler._parse_api_response |
(token extraction) |
Round 2 fixes (see llm-dev/execute.md § "修订记录 (Round 2 fix)")
- H1: TOOL span is now parented on STEP, not CHAIN. Strategy A enhanced — the chain wrapper holds a
round → STEP spanmap and usestrace.set_span_in_context(step_span)to anchor each post-hoc TOOL span on the matching STEP. STEPSpanContexts remain valid parents even afterend(). - H2 (provider-name fallback):
opentelemetry-instrumentation-openai-v2 == 0.62b1only emits the legacygen_ai.systemattribute on its LLM span; the newgen_ai.provider.nameattribute is missing. As a pure fallback the wildtool plugin writes bothgen_ai.system="openai"andgen_ai.provider.name="openai"on the STEP span (not on the LLM span — that is owned by the OpenAI v2 instrumentation and we do not patch it). Once the OpenAI v2 instrumentation upstream emitsgen_ai.provider.namenatively this fallback can be removed. - M1: CHAIN span now carries
input.value(last user message ininference_data["messages"], truncated to 4096 chars) andoutput.value(JSON ofaction_name_label/task_idx/is_optimal). - M2: STEP span now carries
gen_ai.react.finish_reasonon error paths. Mapping table is inexecute.md§ "M2: gen_ai.react.finish_reason 取值映射". - M3: TOOL span explicitly writes
gen_ai.tool.call.arguments/gen_ai.tool.call.result/gen_ai.tool.description, bypassingOTEL_INSTRUMENTATION_GENAI_CAPTURE_*gating inopentelemetry-util-genai. The customwildtool.tool.execution_mode = "ground_truth_replay"is preserved.
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_wildtool-0.6.0-py3-none-any.whl.
File metadata
- Download URL: loongsuite_instrumentation_wildtool-0.6.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da05f9e28328fd11f782898f2b287e95187feee8a21b087b62b4c72a64b15feb
|
|
| MD5 |
355b46a5da99cb5b72c878c3b82acba3
|
|
| BLAKE2b-256 |
3e78720d56be52237dc361abe623fe395f2a8dcb5a34c10cda0fc7ef0b26d7b8
|
Provenance
The following attestation bundles were made for loongsuite_instrumentation_wildtool-0.6.0-py3-none-any.whl:
Publisher:
loongsuite-release.yml on alibaba/loongsuite-python-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loongsuite_instrumentation_wildtool-0.6.0-py3-none-any.whl -
Subject digest:
da05f9e28328fd11f782898f2b287e95187feee8a21b087b62b4c72a64b15feb - Sigstore transparency entry: 1728079918
- Sigstore integration time:
-
Permalink:
alibaba/loongsuite-python-agent@7d93dfeebed0f9327c7b74f6bf85880ff08fcfc2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/alibaba
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
loongsuite-release.yml@7d93dfeebed0f9327c7b74f6bf85880ff08fcfc2 -
Trigger Event:
workflow_dispatch
-
Statement type: