█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

OpenAI Agents SDK

Multi-agent workflows बनाने के लिए tools, handoffs और guardrails वाला हल्का Python SDK

Multi-Agent Systemsओपन सोर्स
भाषा
Python
कवरेज
1 story
संक्षेप में

OpenAI Agents SDK क्या है?

OpenAI Agents SDK Multi-agent workflows बनाने के लिए tools, handoffs और guardrails वाला हल्का Python SDK. यह Agents & Automation टूल्स की Multi-Agent Systems श्रेणी में आता है; ओपन सोर्स है और Python में लिखा गया है। शुरू करने के लिए: venv और pip से इंस्टॉल कैसे करें.

सारांश

OpenAI Agents SDK एक हल्का Python framework है, जिसकी मदद से multi-agent workflows बनाए जा सकते हैं। इसमें आप agents को LLM के रूप में परिभाषित करते हैं, जिन्हें instructions, tools, guardrails और handoffs के साथ configure किया जाता है, और फिर वे किसी task को पूरा करने के लिए एक-दूसरे को काम सौंप सकते हैं।

यह provider-agnostic है: यह OpenAI Responses और Chat Completions APIs के साथ-साथ 100+ अन्य LLMs के साथ भी काम करता है। Built-in sessions runs के बीच conversation history संभालते हैं, और tracing की मदद से आप अपने workflows को देख, debug और optimize कर सकते हैं।

यह core को छोटा और explicit रखकर multi-agent systems के क्षेत्र में फिट बैठता है। किसी भारी orchestration layer के बजाय, आप agents, tools और handoffs को सीधे Python में compose करते हैं, जो उन developers के लिए उपयुक्त है जो agents के coordinate होने के तरीके पर नियंत्रण चाहते हैं।

यह क्या करता है

  • Agents: instructions, tools, guardrails और handoffs के साथ configure किए गए LLMs
  • Handoffs और agents-as-tools, जिनसे किसी खास task को दूसरे agents को सौंपा जा सके
  • Tools support: Python functions, MCP और hosted tools
  • Input और output validation के लिए guardrails, साथ ही human-in-the-loop controls
  • Automatic conversation history के लिए sessions, और debugging के लिए built-in tracing
  • OpenAI Responses, Chat Completions और 100+ अन्य LLMs के साथ provider-agnostic

शुरू करें

Python 3.10 या उसके बाद का संस्करण ज़रूरी है। एक virtual environment बनाएं, package इंस्टॉल करें, और एक agent चलाएं।

venv और pip से इंस्टॉल कैसे करें

एक virtual environment सेट करें और openai-agents package इंस्टॉल करें।

bashbash
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install openai-agents

या uv से इंस्टॉल करें

अगर आप uv इस्तेमाल करते हैं, तो इंस्टॉल के लिए बस एक add command काफ़ी है।

bashbash
uv init
uv add openai-agents

अपनी API key सेट करें

किसी agent को चलाने से पहले OPENAI_API_KEY export करें। Voice support के लिए 'voice' extra, और Redis sessions के लिए 'redis' extra इंस्टॉल करें।

bashbash
export OPENAI_API_KEY=sk-...

Sandbox Agent चलाएं

Sandbox agents (0.14.0 में नए) filesystem वाले computer environment में चलते हैं। यह उदाहरण local filesystem पर चलता है और एक repo का सारांश बनाता है।

pythonpython
from agents import Runner
from agents.run import RunConfig
from agents.sandbox import Manifest, SandboxAgent, SandboxRunConfig
from agents.sandbox.entries import GitRepo
from agents.sandbox.sandboxes import UnixLocalSandboxClient

agent = SandboxAgent(
    name="Workspace Assistant",
    instructions="Inspect the sandbox workspace before answering.",
    default_manifest=Manifest(
        entries={
            "repo": GitRepo(repo="openai/openai-agents-python", ref="main"),
        }
    ),
)

result = Runner.run_sync(
    agent,
    "Inspect the repo README and summarize what this project does.",
    run_config=RunConfig(sandbox=SandboxRunConfig(client=UnixLocalSandboxClient())),
)
print(result.final_output)

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • एक workflow में कई specialized agents को जोड़ें, जो एक-दूसरे को task सौंपते हैं
  • किसी agent को tools (Python functions, MCP या hosted tools) दें, ताकि वह असली actions ले सके
  • Full agent features के साथ realtime models से voice agents बनाएं
  • Agent के input और output की जाँच के लिए guardrails और human-in-the-loop checks जोड़ें

How OpenAI Agents SDK compares

OpenAI Agents SDK alongside other open-source multi-agent systems tools AI/TLDR tracks, ranked by GitHub stars.

टूलस्टारयह क्या करता है
Paperclip★ 119kएक सेल्फ-होस्टेड कंट्रोल प्लेन, जो AI एजेंट्स की टीम को कंपनी की तरह चलाता है, जिसमें ऑर्गनाइज़ेशन चार्ट, टास्क, बजट और अप्रूवल शामिल हैं
Ruflo★ 82.8kClaude Code और Codex के लिए एक एजेंट मेटा-हार्नेस
MetaGPT★ 71.6kएक multi-agent framework जो एक ही prompt से पूरी LLM-आधारित software company का काम करता है
AutoGen★ 62kऐसे multi-agent AI apps बनाएं जिनमें agents एक-दूसरे, tools और इंसानों के साथ बातचीत करें
CrewAI★ 61.4kRole-playing AI agents की टीमें बनाएं जो काम बांटें और एक लक्ष्य के लिए मिलकर काम करें
AgentScope★ 37.1kप्रोडक्शन में चलने वाले मल्टी-एजेंट ऐप्स बनाने के लिए एक Python फ़्रेमवर्क
OpenAI Agents SDK★ 31kMulti-agent workflows बनाने के लिए tools, handoffs और guardrails वाला हल्का Python SDK
A2A★ 26.8kअलग-अलग frameworks के बीच agent discovery और collaboration के लिए खुला Agent2Agent protocol