instrument_agent
Adds ioa-observe-sdk instrumentation to Python AI agent files, inserting Observe.init(), SDK imports, and decorators for LlamaIndex, LangGraph, CrewAI, and OpenAI SDK agents, while backing up the original file.
Instructions
Read a Python AI agent file, add ioa-observe-sdk instrumentation, and write it back.
Adds Observe.init(), SDK imports, @tool/@agent/@graph/@workflow decorators, and session_start() — covering LlamaIndex, LangGraph, CrewAI, and raw OpenAI SDK agents. Creates a .bak backup before modifying the file.
Args: file_path: Path to the Python file to instrument. app_name: Optional app name for Observe.init(). Inferred from file if omitted.
Returns: Summary of all changes made, the diff, and next steps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| app_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |