-
Notifications
You must be signed in to change notification settings - Fork 447
feat(llmobs): [MLOB-2662] [MLOB-3100] add agent manifest #13311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Bootstrap import analysisComparison of import times between this PR and base. SummaryThe average import time from this PR is: 281 ± 4 ms. The average import time from base is: 281 ± 4 ms. The import time difference between this PR and base is: 0.3 ± 0.2 ms. The difference is not statistically significant (z = 1.84). Import time breakdownThe following import paths have shrunk:
|
BenchmarksBenchmark execution time: 2025-07-11 20:01:33 Comparing candidate commit c8daba4 in PR branch Found 0 performance improvements and 3 performance regressions! Performance is the same for 544 metrics, 3 unstable metrics. scenario:iastaspects-replace_aspect
scenario:iastaspects-rstrip_aspect
scenario:telemetryaddmetric-1-distribution-metric-1-times
|
This pull request has been automatically closed after a period of inactivity. |
if hasattr(tool, "name"): | ||
tool_dict["name"] = tool.name | ||
if hasattr(tool, "description"): | ||
tool_dict["description"] = tool.description | ||
if hasattr(tool, "strict_json_schema"): | ||
tool_dict["strict_json_schema"] = tool.strict_json_schema | ||
if hasattr(tool, "params_json_schema"): | ||
parameter_schema = tool.params_json_schema | ||
required_params = get_required_param_dict(parameter_schema.get("required", [])) | ||
parameters = {} | ||
if "properties" in parameter_schema: | ||
for param, schema in parameter_schema["properties"].items(): | ||
param_dict = {} | ||
if "type" in schema: | ||
param_dict["type"] = schema["type"] | ||
if "title" in schema: | ||
param_dict["title"] = schema["title"] | ||
if param in required_params: | ||
param_dict["required"] = True | ||
parameters[param] = param_dict | ||
tool_dict["parameters"] = parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pydantic AI has a very similar schema for tool definitions. It might be helpful to pull the bulk of this logic out into a shared helper function.
if hasattr(tool, "name"): | ||
tool_dict["name"] = tool.name | ||
if hasattr(tool, "description"): | ||
tool_dict["description"] = tool.description | ||
if hasattr(tool, "strict_json_schema"): | ||
tool_dict["strict_json_schema"] = tool.strict_json_schema | ||
if hasattr(tool, "params_json_schema"): | ||
parameter_schema = tool.params_json_schema | ||
required_params = get_required_param_dict(parameter_schema.get("required", [])) | ||
parameters = {} | ||
for param, schema in parameter_schema.get("properties", {}).items(): | ||
param_dict = {} | ||
if "type" in schema: | ||
param_dict["type"] = schema["type"] | ||
if "title" in schema: | ||
param_dict["title"] = schema["title"] | ||
if param in required_params: | ||
param_dict["required"] = True | ||
parameters[param] = param_dict | ||
tool_dict["parameters"] = parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PydanticAI has a very similar schema for tool definitions. It may be helpful to pull this out into a shared helper function.
@@ -34,6 +51,8 @@ def patch(): | |||
Pin().onto(agents) | |||
|
|||
add_trace_processor(LLMObsTraceProcessor(OpenAIAgentsIntegration(integration_config=config.openai_agents))) | |||
|
|||
wrap(agents.Runner, "_run_single_turn", patched_run_single_turn(agents)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this method may have been moved onto the agents.run.AgentRunner
class. We may need to condition this patching based on the library version.
Checklist
Reviewer Checklist