Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/ai/azure-ai-projects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ with project_client.get_openai_client() as openai_client:

response = openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand All @@ -173,7 +173,7 @@ with project_client.get_openai_client() as openai_client:

response = openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

response = openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand All @@ -71,7 +71,7 @@

response = openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def main() -> None:

response = await openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand All @@ -73,7 +73,7 @@ async def main() -> None:

response = await openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
print(f"Added a user message to the conversation")

response = openai_client.responses.create(
conversation=conversation.id, extra_body={"agent": {"name": agent.name, "type": "agent_reference"}}, input=""
conversation=conversation.id,
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
input="",
)
print(f"Response output: {response.output_text}")
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def main():

response = await openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

with openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
stream=True,
) as response_stream_events:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class CalendarEvent(BaseModel):

response = openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async def main() -> None:

response = await openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@

stream = openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": workflow.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": workflow.name, "type": "agent_reference"}},
input="1 + 1 = ?",
stream=True,
# REMOVE ME? metadata={"x-ms-debug-mode-enabled": "1"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async def main():

stream = await openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": workflow.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": workflow.name, "type": "agent_reference"}},
input="1 + 1 = ?",
stream=True,
# Remove me? metadata={"x-ms-debug-mode-enabled": "1"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

response = openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "id": agent.id, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "id": agent.id, "type": "agent_reference"}},
input="What is the size of France in square miles?",
)
print(f"Response output: {response.output_text}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ def display_conversation_item(item: Any) -> None:
request = "Hello, tell me a joke."
response = openai_client.responses.create(
conversation=conversation.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
input=request,
)
print(f"Answer: {response.output}")

response = openai_client.responses.create(
conversation=conversation.id,
input="Tell another one about computers.",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Answer: {response.output}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
stream=True,
tool_choice="required",
input=user_input,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

for event in stream_response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
stream_response = openai_client.responses.create(
stream=True,
input=user_input,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

for event in stream_response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
stream=True,
tool_choice="required",
input="What is today's date and whether in Seattle?",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

for event in stream_response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
Enter the value 'MSFT', to get information about the Microsoft stock price.
At the top of the resulting page you will see a default chart of Microsoft stock price.
Click on 'YTD' at the top of that chart, and report the percent value that shows up just below it.""",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

for event in stream_response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
response = openai_client.responses.create(
conversation=conversation.id,
input="Could you please create bar chart in TRANSPORTATION sector for the operating profit from the uploaded csv file and provide file to me?",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response completed (id: {response.id})")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def main() -> None:
response = await openai_client.responses.create(
conversation=conversation.id,
input="Could you please create bar chart in TRANSPORTATION sector for the operating profit from the uploaded csv file and provide file to me?",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response completed (id: {response.id})")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
# [END tool_declaration]

agent = project_client.agents.create_version(
agent_name="ComputerUseAgent",
agent_name="MyAgent",
definition=PromptAgentDefinition(
model=os.environ.get("COMPUTER_USE_MODEL_DEPLOYMENT_NAME", "computer-use-preview"),
instructions="""
Expand Down Expand Up @@ -101,7 +101,7 @@
],
}
],
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
truncation="auto",
)

Expand Down Expand Up @@ -151,7 +151,7 @@
},
}
],
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
truncation="auto",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def main():
computer_use_tool = ComputerUsePreviewTool(display_width=1026, display_height=769, environment="windows")

agent = await project_client.agents.create_version(
agent_name="ComputerUseAgent",
agent_name="MyAgent",
definition=PromptAgentDefinition(
model=os.environ.get("COMPUTER_USE_MODEL_DEPLOYMENT_NAME", "computer-use-preview"),
instructions="""
Expand Down Expand Up @@ -103,7 +103,7 @@ async def main():
],
}
],
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
truncation="auto",
)

Expand Down Expand Up @@ -155,7 +155,7 @@ async def main():
},
}
],
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
truncation="auto",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
response = openai_client.responses.create(
tool_choice="required",
input=user_input,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

print(f"Response output: {response.output_text}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
response = openai_client.responses.create(
conversation=conversation.id,
input="Tell me about Contoso products",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Agent response: {response.output_text}")
print("\nCleaning up...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"content": "Tell me about Contoso products and their features in detail. Please search through the available documentation.",
},
],
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

print("Processing streaming file search results...\n")
Expand Down Expand Up @@ -117,7 +117,7 @@
input=[
{"role": "user", "content": "Tell me about Smart Eyewear and its features."},
],
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

print("Processing follow-up streaming response...\n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def main() -> None:
},
],
tool_choice="required",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

print("Processing streaming file search results...\n")
Expand Down Expand Up @@ -122,7 +122,7 @@ async def main() -> None:
},
],
tool_choice="required",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

print("Processing follow-up streaming response...\n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_horoscope(sign: str) -> str:
# Prompt the model with tools defined
response = openai_client.responses.create(
input="What is my horoscope? I am an Aquarius.",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand All @@ -105,7 +105,7 @@ def get_horoscope(sign: str) -> str:
response = openai_client.responses.create(
input=input_list,
previous_response_id=response.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

print(f"Agent response: {response.output_text}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def main():
# Prompt the model with tools defined
response = await openai_client.responses.create(
input="What is my horoscope? I am an Aquarius.",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response output: {response.output_text}")

Expand All @@ -106,7 +106,7 @@ async def main():
response = await openai_client.responses.create(
input=input_list,
previous_response_id=response.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

print(f"Agent response: {response.output_text}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
extra_headers={
"x-ms-oai-image-generation-deployment": image_generation_model
}, # this is required at the moment for image generation
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response created: {response.id}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def main():
extra_headers={
"x-ms-oai-image-generation-deployment": image_generation_model
}, # this is required at the moment for image generation
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)
print(f"Response created: {response.id}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
response = openai_client.responses.create(
conversation=conversation.id,
input="Please summarize the Azure REST API specifications Readme",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

# Process any MCP approval requests that were generated
Expand All @@ -92,7 +92,7 @@
response = openai_client.responses.create(
input=input_list,
previous_response_id=response.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

print(f"Agent response: {response.output_text}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def main():
response = await openai_client.responses.create(
conversation=conversation.id,
input="Please summarize the Azure REST API specifications Readme",
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

# Process any MCP approval requests that were generated
Expand All @@ -96,7 +96,7 @@ async def main():
response = await openai_client.responses.create(
input=input_list,
previous_response_id=response.id,
extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
)

print(f"Agent response: {response.output_text}")
Expand Down
Loading
Loading