mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Create/Get Agent API - fixes and example improvements (#3246)
This commit is contained in:
committed by
GitHub
Unverified
parent
975884f32d
commit
b773830e4b
@@ -33,7 +33,7 @@ async def main() -> None:
|
||||
agent = await provider.create_agent(
|
||||
name="ProductMarketerAgent",
|
||||
instructions="Return launch briefs as structured JSON.",
|
||||
# Specify type to use as response
|
||||
# Specify Pydantic model for structured output via default_options
|
||||
default_options={"response_format": ReleaseBrief},
|
||||
)
|
||||
|
||||
|
||||
+10
-8
@@ -37,17 +37,19 @@ async def main() -> None:
|
||||
AzureCliCredential() as credential,
|
||||
AzureAIProjectAgentProvider(credential=credential) as provider,
|
||||
):
|
||||
# Pass response_format at agent creation time using dict schema format
|
||||
# Pass response_format via default_options using dict schema format
|
||||
agent = await provider.create_agent(
|
||||
name="WeatherDigestAgent",
|
||||
instructions="Return sample weather digest as structured JSON.",
|
||||
response_format={
|
||||
"type": "json_schema",
|
||||
"json_schema": {
|
||||
"name": runtime_schema["title"],
|
||||
"strict": True,
|
||||
"schema": runtime_schema,
|
||||
},
|
||||
default_options={
|
||||
"response_format": {
|
||||
"type": "json_schema",
|
||||
"json_schema": {
|
||||
"name": runtime_schema["title"],
|
||||
"strict": True,
|
||||
"schema": runtime_schema,
|
||||
},
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user