openai-agents-0.9.3
توضیحات
OpenAI Agents SDK
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | openai-agents-0.9.3 |
| نام | openai-agents |
| نسخه کتابخانه | 0.9.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | OpenAI <support@openai.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/openai-agents/ |
| مجوز | - |
# OpenAI Agents SDK [](https://pypi.org/project/openai-agents/)
The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows. It is provider-agnostic, supporting the OpenAI Responses and Chat Completions APIs, as well as 100+ other LLMs.
<img src="https://cdn.openai.com/API/docs/images/orchestration.png" alt="Image of the Agents Tracing UI" style="max-height: 803px;">
> [!NOTE]
> Looking for the JavaScript/TypeScript version? Check out [Agents SDK JS/TS](https://github.com/openai/openai-agents-js).
### Core concepts:
1. [**Agents**](https://openai.github.io/openai-agents-python/agents): LLMs configured with instructions, tools, guardrails, and handoffs
1. [**Sandbox Agents**](https://openai.github.io/openai-agents-python/sandbox_agents): Agents preconfigured to work with a container to perform work over long time horizons.
1. **[Agents as tools](https://openai.github.io/openai-agents-python/tools/#agents-as-tools) / [Handoffs](https://openai.github.io/openai-agents-python/handoffs/)**: Delegating to other agents for specific tasks
1. [**Tools**](https://openai.github.io/openai-agents-python/tools/): Various Tools let agents take actions (functions, MCP, hosted tools)
1. [**Guardrails**](https://openai.github.io/openai-agents-python/guardrails/): Configurable safety checks for input and output validation
1. [**Human in the loop**](https://openai.github.io/openai-agents-python/human_in_the_loop/): Built-in mechanisms for involving humans across agent runs
1. [**Sessions**](https://openai.github.io/openai-agents-python/sessions/): Automatic conversation history management across agent runs
1. [**Tracing**](https://openai.github.io/openai-agents-python/tracing/): Built-in tracking of agent runs, allowing you to view, debug and optimize your workflows
1. [**Realtime Agents**](https://openai.github.io/openai-agents-python/realtime/quickstart/): Build powerful voice agents with `gpt-realtime-1.5` and full agent features
Explore the [examples](https://github.com/openai/openai-agents-python/tree/main/examples) directory to see the SDK in action, and read our [documentation](https://openai.github.io/openai-agents-python/) for more details.
## Get started
To get started, set up your Python environment (Python 3.10 or newer required), and then install OpenAI Agents SDK package.
### venv
```bash
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install openai-agents
```
For voice support, install with the optional `voice` group: `pip install 'openai-agents[voice]'`. For Redis session support, install with the optional `redis` group: `pip install 'openai-agents[redis]'`.
### uv
If you're familiar with [uv](https://docs.astral.sh/uv/), installing the package would be even easier:
```bash
uv init
uv add openai-agents
```
For voice support, install with the optional `voice` group: `uv add 'openai-agents[voice]'`. For Redis session support, install with the optional `redis` group: `uv add 'openai-agents[redis]'`.
## Run your first Sandbox Agent
[Sandbox Agents](https://openai.github.io/openai-agents-python/sandbox_agents) are new in version 0.14.0. A sandbox agent is an agent that uses a computer environment to perform real work with a filesystem, in an environment you configure and control. Sandbox agents are useful when the agent needs to inspect files, run commands, apply patches, or carry workspace state across longer tasks.
```python
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 this agent on the local filesystem
run_config=RunConfig(sandbox=SandboxRunConfig(client=UnixLocalSandboxClient())),
)
print(result.final_output)
# This project provides a Python SDK for building multi-agent workflows.
```
(_If running this, ensure you set the `OPENAI_API_KEY` environment variable_)
(_For Jupyter notebook users, see [hello_world_jupyter.ipynb](https://github.com/openai/openai-agents-python/blob/main/examples/basic/hello_world_jupyter.ipynb)_)
Explore the [examples](https://github.com/openai/openai-agents-python/tree/main/examples) directory to see the SDK in action, and read our [documentation](https://openai.github.io/openai-agents-python/) for more details.
## Acknowledgements
We'd like to acknowledge the excellent work of the open-source community, especially:
- [Pydantic](https://docs.pydantic.dev/latest/)
- [Requests](https://github.com/psf/requests)
- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk)
- [Griffe](https://github.com/mkdocstrings/griffe)
This library has these optional dependencies:
- [websockets](https://github.com/python-websockets/websockets)
- [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy)
- [any-llm](https://github.com/mozilla-ai/any-llm) and [LiteLLM](https://github.com/BerriAI/litellm)
We also rely on the following tools to manage the project:
- [uv](https://github.com/astral-sh/uv) and [ruff](https://github.com/astral-sh/ruff)
- [mypy](https://github.com/python/mypy) and [Pyright](https://github.com/microsoft/pyright)
- [pytest](https://github.com/pytest-dev/pytest) and [Coverage.py](https://github.com/coveragepy/coveragepy)
- [MkDocs](https://github.com/squidfunk/mkdocs-material)
We're committed to continuing to build the Agents SDK as an open source framework so others in the community can expand on our approach.
نیازمندی
| مقدار | نام |
|---|---|
| - | griffelib<3,>=2 |
| ython_versio | mcp<2,>=1.19.0; |
| - | openai<3,>=2.26.0 |
| - | pydantic<3,>=2.12.2 |
| - | requests<3,>=2.0 |
| - | types-requests<3,>=2.0 |
| - | typing-extensions<5,>=4.12.2 |
| - | websockets<17,>=15.0 |
| ython_versio | any-llm-sdk<2,>=1.11.0; |
| xtr | aiohttp<4,>=3.12; |
| xtr | blaxel>=0.2.50; |
| xtr | aiohttp<4,>=3.12; |
| xtr | dapr>=1.16.0; |
| xtr | grpcio>=1.60.0; |
| xtr | daytona>=0.155.0; |
| xtr | docker>=6.1; |
| xtr | e2b-code-interpreter==2.4.1; |
| xtr | e2b==2.20.0; |
| xtr | cryptography<46,>=45.0; |
| xtr | litellm>=1.83.0; |
| xtr | modal==1.3.5; |
| xtr | pymongo>=4.14; |
| xtr | websockets<17,>=15.0; |
| xtr | redis>=7; |
| xtr | runloop-api-client<2.0.0,>=1.16.0; |
| xtr | boto3>=1.34; |
| xtr | asyncpg>=0.29.0; |
| xtr | sqlalchemy>=2.0; |
| xtr | temporalio==1.26.0; |
| xtr | textual<8.3,>=8.2.3; |
| xtr | vercel<0.6,>=0.5.6; |
| xtr | graphviz>=0.17; |
| ython_versio | numpy<3,>=2.2.0; |
| xtr | websockets<17,>=15.0; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10 | Python |
نحوه نصب
نصب پکیج whl openai-agents-0.9.3:
pip install openai-agents-0.9.3.whl
نصب پکیج tar.gz openai-agents-0.9.3:
pip install openai-agents-0.9.3.tar.gz