mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: openai updates (#388)
* openai updates * rebuild of openai structure * updated responses structure * renamed sample * added file id support to code interpreter * added hosted file ids to code interpretor * mypy fixes * removed default az cred from codebase * updated agent name setup * added kwargs to entra methods * and further kwargs * extra comment * updated all samples * readded custom get methods for responses * updated int tests with ad credential * missed one
This commit is contained in:
committed by
GitHub
Unverified
parent
19676978e9
commit
df9d85d1f0
@@ -2,7 +2,7 @@
|
||||
|
||||
import asyncio
|
||||
|
||||
from agent_framework import ChatClientAgent, ChatMessage, ChatRole
|
||||
from agent_framework import ChatMessage, ChatRole
|
||||
from agent_framework.azure import AzureChatClient
|
||||
from agent_framework.workflow import (
|
||||
AgentExecutor,
|
||||
@@ -15,6 +15,7 @@ from agent_framework.workflow import (
|
||||
WorkflowContext,
|
||||
handler,
|
||||
)
|
||||
from azure.identity import DefaultAzureCredential
|
||||
|
||||
"""
|
||||
The following sample demonstrates a basic workflow that simulates
|
||||
@@ -90,10 +91,9 @@ async def main():
|
||||
"""Main function to run the group chat workflow."""
|
||||
|
||||
# Step 1: Create the executors.
|
||||
chat_client = AzureChatClient()
|
||||
chat_client = AzureChatClient(ad_credential=DefaultAzureCredential())
|
||||
writer = AgentExecutor(
|
||||
ChatClientAgent(
|
||||
chat_client,
|
||||
chat_client.create_agent(
|
||||
instructions=(
|
||||
"You are an excellent content writer. You create new content and edit contents based on the feedback."
|
||||
),
|
||||
@@ -101,8 +101,7 @@ async def main():
|
||||
id="writer",
|
||||
)
|
||||
reviewer = AgentExecutor(
|
||||
ChatClientAgent(
|
||||
chat_client,
|
||||
chat_client.create_agent(
|
||||
instructions=(
|
||||
"You are an excellent content reviewer. You review the content and provide feedback to the writer."
|
||||
),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import asyncio
|
||||
|
||||
from agent_framework import ChatClientAgent, ChatMessage, ChatRole
|
||||
from agent_framework import ChatMessage, ChatRole
|
||||
from agent_framework.azure import AzureChatClient
|
||||
from agent_framework.workflow import (
|
||||
AgentExecutor,
|
||||
@@ -17,6 +17,7 @@ from agent_framework.workflow import (
|
||||
WorkflowContext,
|
||||
handler,
|
||||
)
|
||||
from azure.identity import DefaultAzureCredential
|
||||
|
||||
"""
|
||||
The following sample demonstrates a basic workflow that simulates
|
||||
@@ -135,9 +136,9 @@ class CriticGroupChatManager(Executor):
|
||||
async def main():
|
||||
"""Main function to run the group chat workflow."""
|
||||
# Step 1: Create the executors.
|
||||
chat_client = AzureChatClient(ad_credential=DefaultAzureCredential())
|
||||
writer = AgentExecutor(
|
||||
ChatClientAgent(
|
||||
AzureChatClient(),
|
||||
chat_client.create_agent(
|
||||
instructions=(
|
||||
"You are an excellent content writer. You create new content and edit contents based on the feedback."
|
||||
),
|
||||
@@ -146,8 +147,7 @@ async def main():
|
||||
),
|
||||
)
|
||||
reviewer = AgentExecutor(
|
||||
ChatClientAgent(
|
||||
AzureChatClient(),
|
||||
chat_client.create_agent(
|
||||
instructions=(
|
||||
"You are an excellent content reviewer. You review the content and provide feedback to the writer. "
|
||||
"You do not address user requests. Only provide feedback to the writer."
|
||||
|
||||
@@ -7,7 +7,13 @@ from collections import defaultdict
|
||||
from dataclasses import dataclass
|
||||
|
||||
import aiofiles
|
||||
from agent_framework.workflow import Executor, WorkflowBuilder, WorkflowCompletedEvent, WorkflowContext, handler
|
||||
from agent_framework.workflow import (
|
||||
Executor,
|
||||
WorkflowBuilder,
|
||||
WorkflowCompletedEvent,
|
||||
WorkflowContext,
|
||||
handler,
|
||||
)
|
||||
|
||||
"""
|
||||
The following sample demonstrates a basic map reduce workflow that
|
||||
|
||||
Reference in New Issue
Block a user