Skip to content

Commit f0fb20b

Browse files
TaoChenOSUglorious-beard
authored andcommitted
Python: Fix agent getting started samples (microsoft#11238)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Fix two Python agent getting started samples. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
1 parent 0c54c4a commit f0fb20b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/samples/getting_started_with_agents/azure_ai_agent/step3_azure_ai_agent_group_chat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async def main():
8585

8686
try:
8787
# 6. Add the task as a message to the group chat
88-
await chat.add_chat_message(messages=TASK)
88+
await chat.add_chat_message(message=TASK)
8989
print(f"# {AuthorRole.USER}: '{TASK}'")
9090
# 7. Invoke the chat
9191
async for content in chat.invoke():

python/samples/getting_started_with_agents/chat_completion/step10_chat_completion_agent_structured_outputs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async def main():
5858
# 4. Invoke the agent for a response
5959
response = await agent.get_response(message=USER_INPUT, thread=thread)
6060
# 5. Validate the response and print the structured output
61-
reasoned_result = Reasoning.model_validate(json.loads(response.content))
61+
reasoned_result = Reasoning.model_validate(json.loads(response.message.content))
6262
print(f"# {response.name}:\n\n{reasoned_result.model_dump_json(indent=4)}")
6363

6464
# 6. Cleanup: Clear the thread

0 commit comments

Comments
 (0)