Python: Fix migration samples (#5015)

* Fix migration samples

* Fix migration samples 2

* Fix formatting

* Comments
This commit is contained in:
Tao Chen
2026-03-31 23:32:30 -07:00
committed by GitHub
Unverified
parent d992febe9b
commit e43fc8ccec
14 changed files with 100 additions and 84 deletions
@@ -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)