Skip to content
New issue

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

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

Already on GitHub? # to your account

Python: Introduce the OpenAI Responses Agent #11240

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

moonbox3
Copy link
Contributor

@moonbox3 moonbox3 commented Mar 27, 2025

Motivation and Context

OpenAI recently released their Responses API, which is their newest core API and an agentic API primitive, combining the simplicity of Chat Completions with the ability to do more agentic tasks. Azure OpenAI also recently released the Responses API, with close-to feature parity with OpenAI's SDK. It gives us enough to introduce an AzureResponsesAgent and an OpenAIResponsesAgent to Semantic Kernel.

Description

This PR introduces:

  • The AzureResponsesAgent and OpenAIResponsesAgent
  • Allows use of the web search tool with OpenAI (Azure OpenAI currently doesn't support this).
  • Allows use of the file search tool with both OpenAI and Azure OpenAI.
  • Provides getting started samples for both agent types.

TODO:

  • Add unit test coverage for the ResponsesAgentThreadActions class.
  • Add support for the computer user agent tool.
  • Improve typing in the ResponsesAgentThreadActions class.
  • Closes Python: OpenAI Response Agent #11026

Contribution Checklist

@moonbox3 moonbox3 self-assigned this Mar 27, 2025
@moonbox3 moonbox3 requested a review from a team as a code owner March 27, 2025 22:24
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel documentation labels Mar 27, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Mar 27, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel
   kernel.py2024777%143, 154, 158, 308–311, 427, 441–484
semantic_kernel/agents
   __init__.py10280%34, 38
semantic_kernel/agents/open_ai
   azure_responses_agent.py37370%3–118
   openai_responses_agent.py3007176%92–96, 100, 105, 110, 115, 121, 126–133, 138–143, 148–152, 158–170, 174–178, 270, 274, 278, 280, 286, 299, 301, 303, 305, 307, 400, 408, 411, 415, 417, 420, 443–450, 460, 500, 525, 536, 625, 742, 779, 856, 897–900, 915
   responses_agent_thread_actions.py3028572%158, 175, 186, 194, 226–227, 359, 373–385, 403–408, 449–452, 455, 473–484, 505–527, 608–672, 754–763, 793–794, 802–806, 813–819, 883
semantic_kernel/connectors/ai
   function_calling_utils.py50394%66, 181, 186
semantic_kernel/connectors/ai/open_ai/settings
   azure_open_ai_settings.py27485%126–129
semantic_kernel/contents
   annotation_content.py47198%64
   function_call_content.py110496%124, 201, 229–230
   function_result_content.py90199%94
TOTAL21671267188% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3363 5 💤 0 ❌ 0 🔥 1m 37s ⏱️

@TaoChenOSU
Copy link
Contributor

I see a mix of Responses Agent and Response Agent in code and comments. We should probably fix them.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
agents documentation python Pull requests for the Python Semantic Kernel
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Python: OpenAI Response Agent
4 participants