OpenAI Launches Responses API and Agents SDK to Streamline Agent Development 195

小编 ·

OpenAI Launches Responses API and Agents SDK to Streamline Agent Development

On March 11, 2025, OpenAI released the Agents SDK and Responses API to address common pain points in traditional agent development, such as complex prompt engineering and intricate orchestration logic. These tools enable developers and enterprises to easily build practical and reliable AI agents.

OpenAI Launches Responses API and Agents SDK to Streamline Agent Development

Openai released the Agent SDK and Responses API on March 11, 2025. The Agent SDK and Responses API introduced by OpenAI are designed to address pain points in traditional agent development, such as complex prompt engineering and intricate coordination logic. These two tools enable developers and enterprises to easily build practical and reliable AI agents.

What is the Responses API

The Responses API is a powerful API that combines the simplicity of the Chat Completions API with the tool-use capabilities of the Assistants API. It allows developers to integrate multiple tools and functionalities through a single API call, thereby simplifying the handling of complex tasks.

Key Features of the Responses API:

  • Multi-tool Integration: Supports web search, file search, computer operation, and more, allowing developers to perform multiple operations in a single call.

  • Real-time Data Interaction: Through the web search tool, AI can obtain the latest information and provide citations, making it suitable for scenarios requiring real-time data.

  • Multi-turn Conversation Support: Links multiple interactions together through response chains to maintain conversational coherence.

  • Enterprise-grade Data Privacy: Built on Azure's security and compliance standards to ensure data protection.

Responses API Applications

  • Web Search: Powered by the same search engine as ChatGPT, with an accuracy rate of up to 90%, supporting information traceability and citation annotations.

  • File Search: Supports multiple file formats and quickly retrieves massive documents, ideal for enterprise knowledge base management.

  • Computer Control: Allows agents to directly operate computers to complete tasks such as web automation and data entry.

Responses API Usage Code

// 网页搜索示例
const response = await openai.responses.create({
  model: "gpt-4o",
  tools: [{ type: "web_search_preview" }],
  input: "今天发生了什么积极的新闻?"
});
console.log(response.output_text);
// 文件搜索示例
const productDocs = await openai.vectorStores.create({
  name: "产品文档",
  file_ids: [file1.id, file2.id, file3.id],
});
const response = await openai.responses.create({
  model: "gpt-4o-mini",
  tools: [{
    type: "file_search",
    vector_store_ids: [productDocs.id],
  }],
  input: "OpenAI的深度研究是什么?"
});
console.log(response.output_text);
// 电脑控制示例
const response = await openai.responses.create({
  model: "computer-use-preview",
  tools: [{
    type: "computer_use_preview",
    display_width: 1024,
    display_height: 768,
    environment: "browser",
  }],
  truncation: "auto",
  input: "我想买个新相机,帮我找到最好的。",
});
console.log(response.output);

OpenAI发布 Responses API 和 Agents SDK,增强智能体的开发流程.webp

What is the Agents SDK?

The Agents SDK is an open-source framework for managing and coordinating workflows of multiple AI agents. It is an upgrade based on the Swarm framework and supports multi-agent collaboration and orchestration of complex tasks.

Key Features of the Agents SDK:

  • Configurable Agents: Easily define the roles and tools of agents.

  • Intelligent Handoff: Agents can seamlessly hand off tasks to each other for more efficient collaboration.

  • Guardrails: Ensure that agent behavior matches expectations.

  • Tracing & Observability: Monitor the running status of agents in real time for easy debugging and optimization.

Agents SDK Usage Code

from openai_agent import Agent, function_tool
@function_tool
def submit_refund_request(refund_amount: float, reason: str):
    """提交退款申请"""
    print(f"提交退款申请,金额:{refund_amount},原因:{reason}")
    return {"success": True}
# 定义 Agent
shopping_agent = Agent(
    name="Shopping Assistant",
    instructions="你是一个购物助手,可以搜索网络商品信息。",
    tools=[WebSearchTool()],
)
triage_agent = Agent(
    name="Triage Agent",
    instructions="引导用户到正确的客服 Agent。",
)
support_agent = Agent(
    name="Support Agent",
    instructions="你是一个客服 Agent,可以提交退款。",
    tools=[submit_refund_request],
)

Application Scenarios

  • Enterprise Automation: Through the Responses API and Agents SDK, enterprises can build automated AI workflows, such as order processing, customer service, and data handling.

  • Complex Task Handling: In scenarios requiring multi-step operations, such as e-commerce shopping assistants, legal research, or financial modeling, these tools can significantly improve efficiency.

  • Multimodal Interaction: Supports agents in executing tasks through computer operation tools, such as automatically completing searches or filling out forms in a browser.

GitHub Repository:https://github.com/openai/openai-agents-python

The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows. It supports task handoff, guardrails, tool invocation, and built-in tracing, making it ideal for enterprise automation scenarios that require complex agent collaboration.