mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Fix migration samples (#5015)
* Fix migration samples * Fix migration samples 2 * Fix formatting * Comments
This commit is contained in:
committed by
GitHub
Unverified
parent
d992febe9b
commit
e43fc8ccec
+3
-12
@@ -23,7 +23,7 @@ load_dotenv()
|
||||
|
||||
|
||||
async def run_semantic_kernel() -> None:
|
||||
from semantic_kernel.agents import ChatCompletionAgent, ChatHistoryAgentThread
|
||||
from semantic_kernel.agents import ChatCompletionAgent
|
||||
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion
|
||||
from semantic_kernel.functions import kernel_function
|
||||
|
||||
@@ -39,11 +39,7 @@ async def run_semantic_kernel() -> None:
|
||||
instructions="Answer menu questions accurately.",
|
||||
plugins=[SpecialsPlugin()],
|
||||
)
|
||||
thread = ChatHistoryAgentThread()
|
||||
response = await agent.get_response(
|
||||
messages="What soup can I order today?",
|
||||
thread=thread,
|
||||
)
|
||||
response = await agent.get_response("What soup can I order today?")
|
||||
print("[SK]", response.message.content)
|
||||
|
||||
|
||||
@@ -62,12 +58,7 @@ async def run_agent_framework() -> None:
|
||||
instructions="Answer menu questions accurately.",
|
||||
tools=[specials],
|
||||
)
|
||||
session = chat_agent.create_session()
|
||||
reply = await chat_agent.run(
|
||||
"What soup can I order today?",
|
||||
session=session,
|
||||
tool_choice="auto",
|
||||
)
|
||||
reply = await chat_agent.run("What soup can I order today?")
|
||||
print("[AF]", reply.text)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user