mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Properly configure structured outputs based on new options dict (#3213)
* Properly configure structured outputs based on new options dict * Fix mypy
This commit is contained in:
committed by
GitHub
Unverified
parent
620da7a829
commit
15d0c34d9f
@@ -138,7 +138,7 @@ def create_spam_detector_agent() -> ChatAgent:
|
||||
"Include the original email content in email_content."
|
||||
),
|
||||
name="spam_detection_agent",
|
||||
response_format=DetectionResult,
|
||||
default_options={"response_format": DetectionResult},
|
||||
)
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ def create_email_assistant_agent() -> ChatAgent:
|
||||
"Return JSON with a single field 'response' containing the drafted reply."
|
||||
),
|
||||
name="email_assistant_agent",
|
||||
response_format=EmailResponse,
|
||||
default_options={"response_format": EmailResponse},
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ def create_email_analysis_agent() -> ChatAgent:
|
||||
"and 'reason' (string)."
|
||||
),
|
||||
name="email_analysis_agent",
|
||||
response_format=AnalysisResultAgent,
|
||||
default_options={"response_format": AnalysisResultAgent},
|
||||
)
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ def create_email_assistant_agent() -> ChatAgent:
|
||||
return AzureOpenAIChatClient(credential=AzureCliCredential()).create_agent(
|
||||
instructions=("You are an email assistant that helps users draft responses to emails with professionalism."),
|
||||
name="email_assistant_agent",
|
||||
response_format=EmailResponse,
|
||||
default_options={"response_format": EmailResponse},
|
||||
)
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ def create_email_summary_agent() -> ChatAgent:
|
||||
return AzureOpenAIChatClient(credential=AzureCliCredential()).create_agent(
|
||||
instructions=("You are an assistant that helps users summarize emails."),
|
||||
name="email_summary_agent",
|
||||
response_format=EmailSummaryModel,
|
||||
default_options={"response_format": EmailSummaryModel},
|
||||
)
|
||||
|
||||
|
||||
@@ -243,7 +243,8 @@ async def main() -> None:
|
||||
)
|
||||
|
||||
workflow = (
|
||||
workflow_builder.set_start_executor("store_email")
|
||||
workflow_builder
|
||||
.set_start_executor("store_email")
|
||||
.add_edge("store_email", "email_analysis_agent")
|
||||
.add_edge("email_analysis_agent", "to_analysis_result")
|
||||
.add_multi_selection_edge_group(
|
||||
|
||||
@@ -162,7 +162,7 @@ def create_spam_detection_agent() -> ChatAgent:
|
||||
"and 'reason' (string)."
|
||||
),
|
||||
name="spam_detection_agent",
|
||||
response_format=DetectionResultAgent,
|
||||
default_options={"response_format": DetectionResultAgent},
|
||||
)
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ def create_email_assistant_agent() -> ChatAgent:
|
||||
return AzureOpenAIChatClient(credential=AzureCliCredential()).create_agent(
|
||||
instructions=("You are an email assistant that helps users draft responses to emails with professionalism."),
|
||||
name="email_assistant_agent",
|
||||
response_format=EmailResponse,
|
||||
default_options={"response_format": EmailResponse},
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user