mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Fixed SK migration samples (#4046)
* Fixed sk migration provider samples * Fixes to SK migration samples
This commit is contained in:
committed by
GitHub
Unverified
parent
aab80d9ed9
commit
c23bc1371c
@@ -25,7 +25,7 @@ async def run_semantic_kernel() -> None:
|
||||
async with AzureCliCredential() as credential, AzureAIAgent.create_client(credential=credential) as client:
|
||||
settings = AzureAIAgentSettings() # Reads env vars for region/deployment.
|
||||
# SK builds the remote agent definition then wraps it with AzureAIAgent.
|
||||
definition = await client.agents.as_agent(
|
||||
definition = await client.agents.create_agent(
|
||||
model=settings.model_deployment_name,
|
||||
name="Support",
|
||||
instructions="Answer customer questions in one paragraph.",
|
||||
|
||||
+2
-4
@@ -25,7 +25,7 @@ async def run_semantic_kernel() -> None:
|
||||
async with AzureCliCredential() as credential, AzureAIAgent.create_client(credential=credential) as client:
|
||||
settings = AzureAIAgentSettings()
|
||||
# Register the hosted code interpreter tool with the remote agent.
|
||||
definition = await client.agents.as_agent(
|
||||
definition = await client.agents.create_agent(
|
||||
model=settings.model_deployment_name,
|
||||
name="Analyst",
|
||||
instructions="Use the code interpreter for numeric work.",
|
||||
@@ -46,9 +46,7 @@ async def run_agent_framework() -> None:
|
||||
AzureCliCredential() as credential,
|
||||
AzureAIAgentsProvider(credential=credential) as provider,
|
||||
):
|
||||
# Create a client to access hosted tool factory methods
|
||||
client = AzureAIAgentClient(agents_client=provider._agents_client)
|
||||
code_interpreter_tool = client.get_code_interpreter_tool()
|
||||
code_interpreter_tool = AzureAIAgentClient.get_code_interpreter_tool()
|
||||
|
||||
agent = await provider.create_agent(
|
||||
name="Analyst",
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ async def run_semantic_kernel() -> None:
|
||||
|
||||
async with AzureCliCredential() as credential, AzureAIAgent.create_client(credential=credential) as client:
|
||||
settings = AzureAIAgentSettings()
|
||||
definition = await client.agents.as_agent(
|
||||
definition = await client.agents.create_agent(
|
||||
model=settings.model_deployment_name,
|
||||
name="Planner",
|
||||
instructions="Track follow-up questions within the same thread.",
|
||||
|
||||
Reference in New Issue
Block a user