Description
The docs for the Python Agent constructor describe name as a required str, yet it seems passing None, int works without error:
agent1: Agent = Agent(
None, # passing None for name — code still runs
instructions="You are a helpful assistant.",
model=model
)
result = await Runner.run(agent1, "What is the capital of France?")
print(result.final_output)
output:
DEBUG:openai.agents:Tracing is disabled. Not creating span <agents.tracing.span_data.AgentSpanData object at 0x7fc56a758e90>
Running agent None (turn 1) // It takes agent name as None
Running agent None (turn 1)
DEBUG:openai.agents:Running agent None (turn 1)
Tracing is disabled. Not creating span <agents.tracing.span_data.GenerationSpanData object at 0x7fc56a8a9550>
Tracing is disabled. Not creating span <agents.tracing.span_data.GenerationSpanData object at 0x7fc56a8a9550>
DEBUG:openai.agents:Tracing is disabled. Not creating span <agents.tracing.span_data.GenerationSpanData object at 0x7fc56a8a9550>
[
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"role": "user",
"content": "What is the capital of France?"
}
]
Tools:
[]
Stream: False
Tool choice: NOT_GIVEN
Response format: NOT_GIVEN
[
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"role": "user",
"content": "What is the capital of France?"
}
]
Tools:
[]
Stream: False
Tool choice: NOT_GIVEN
Response format: NOT_GIVEN
DEBUG:openai.agents:[
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"role": "user",
"content": "What is the capital of France?"
}
]
Tools:
[]
Stream: False
Tool choice: NOT_GIVEN
Response format: NOT_GIVEN
LLM resp:
{
"content": "The capital of France is Paris.\n",
"refusal": null,
"role": "assistant",
"annotations": null,
"audio": null,
"function_call": null,
"tool_calls": null
}
LLM resp:
{
"content": "The capital of France is Paris.\n",
"refusal": null,
"role": "assistant",
"annotations": null,
"audio": null,
"function_call": null,
"tool_calls": null
}
DEBUG:openai.agents:LLM resp:
{
"content": "The capital of France is Paris.\n",
"refusal": null,
"role": "assistant",
"annotations": null,
"audio": null,
"function_call": null,
"tool_calls": null
}
Resetting current trace
Resetting current trace
DEBUG:openai.agents:Resetting current trace
The capital of France is Paris.