Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Agent get_response API #10701

Merged

Conversation

TaoChenOSU
Copy link
Contributor

@TaoChenOSU TaoChenOSU commented Feb 26, 2025

Motivation and Context

With the recent push for improving developer's quality of life, we have decided to make it easier for developers to get started with agents by introducing a new get_response API, that hides the complexity of interacting with agents when developers are ramping up with the Agent concept.

Description

  1. Add the get_response API on all agent types. This API skips hides the intermediate steps of the agent execution and only returns the final results as a single message.
  2. Add tests and samples.
  3. Updates the Agent class to be an ABC, and adds get_response, invoke, and invoke_stream methods as overridable.

Contribution Checklist

@TaoChenOSU TaoChenOSU added python Pull requests for the Python Semantic Kernel agents labels Feb 26, 2025
@TaoChenOSU TaoChenOSU self-assigned this Feb 26, 2025
@TaoChenOSU TaoChenOSU requested a review from a team as a code owner February 26, 2025 19:04
@github-actions github-actions bot changed the title Agent get_repsonse API Python: Agent get_repsonse API Feb 26, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 26, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/agents/autogen
   autogen_conversable_agent.py72790%85, 181–182, 191–194
semantic_kernel/agents/azure_ai
   agent_content_generation.py1482086%68–71, 89, 91, 303, 355–387
   agent_thread_actions.py34112962%142, 144, 179–182, 369, 371, 410–411, 437, 440–444, 447–459, 462–493, 499–506, 509–522, 538–569, 613, 616, 645–679, 742, 747–752, 772–779, 810–819, 862–874
   azure_ai_agent.py1151587%105, 107, 113, 122–127, 129, 131, 152–155, 204, 269, 330
semantic_kernel/agents/bedrock
   bedrock_agent.py2164181%115, 129, 133, 135, 182–195, 261, 285, 302, 335, 354, 370–373, 379, 381, 384, 388, 420, 450–459, 470, 502, 519–520, 522–523, 565, 576–577, 589, 625–636, 647, 664–677
semantic_kernel/agents/chat_completion
   chat_completion_agent.py125894%92, 95, 104–109, 187, 251, 311
semantic_kernel/agents/open_ai
   assistant_thread_actions.py3173888%107, 110, 113, 190, 192, 229–235, 405, 463, 480, 567–576, 612–626, 638–639, 710, 715, 747
   open_ai_assistant_agent.py196697%231, 244, 280, 450, 541, 629
TOTAL18993237887% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3197 5 💤 0 ❌ 0 🔥 1m 31s ⏱️

@eavanvalkenburg eavanvalkenburg changed the title Python: Agent get_repsonse API Python: Agent get_response API Feb 26, 2025
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 27, 2025
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 27, 2025
@moonbox3 moonbox3 enabled auto-merge February 27, 2025 09:24
@moonbox3 moonbox3 added this pull request to the merge queue Feb 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 27, 2025
@moonbox3 moonbox3 merged commit 15ca7a7 into microsoft:main Feb 27, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents documentation python Pull requests for the Python Semantic Kernel
Projects
Status: Sprint: Done
Development

Successfully merging this pull request may close these issues.

4 participants