Skip to content

Commit 5aba0b5

Browse files
committed
Merge branch 'main' of github.com:openai/openai-agents-python into alex/inline-snapshot
2 parents ecb7d90 + c8f3cdd commit 5aba0b5

24 files changed

+135
-49
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Bug report
3+
about: Report a bug
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
### Please read this first
11+
12+
- **Have you read the docs?**[Agents SDK docs](https://openai.github.io/openai-agents-python/)
13+
- **Have you searched for related issues?** Others may have faced similar issues.
14+
15+
### Describe the bug
16+
A clear and concise description of what the bug is.
17+
18+
### Debug information
19+
- Agents SDK version: (e.g. `v0.0.3`)
20+
- Python version (e.g. Python 3.10)
21+
22+
### Repro steps
23+
24+
Ideally provide a minimal python script that can be run to reproduce the bug.
25+
26+
27+
### Expected behavior
28+
A clear and concise description of what you expected to happen.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
### Please read this first
11+
12+
- **Have you read the docs?**[Agents SDK docs](https://openai.github.io/openai-agents-python/)
13+
- **Have you searched for related issues?** Others may have had similar requesrs
14+
15+
### Describe the feature
16+
What is the feature you're requesting? How would it work? Please provide examples and details if possible.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Question
3+
about: Questions about the SDK
4+
title: ''
5+
labels: question
6+
assignees: ''
7+
8+
---
9+
10+
### Please read this first
11+
12+
- **Have you read the docs?**[Agents SDK docs](https://openai.github.io/openai-agents-python/)
13+
- **Have you searched for related issues?** Others may have had similar requesrs
14+
15+
### Question
16+
Describe your question. Provide details if available.

.github/workflows/issues.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Close inactive issues
2+
on:
3+
schedule:
4+
- cron: "30 1 * * *"
5+
6+
jobs:
7+
close-issues:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
steps:
13+
- uses: actions/stale@v9
14+
with:
15+
days-before-issue-stale: 7
16+
days-before-issue-close: 3
17+
stale-issue-label: "stale"
18+
stale-issue-message: "This issue is stale because it has been open for 7 days with no activity."
19+
close-issue-message: "This issue was closed because it has been inactive for 3 days since being marked as stale."
20+
days-before-pr-stale: -1
21+
days-before-pr-close: -1
22+
any-of-labels: 'question,needs-more-info'
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ When you call `Runner.run()`, we run a loop until we get a final output.
116116

117117
1. We call the LLM, using the model and settings on the agent, and the message history.
118118
2. The LLM returns a response, which may include tool calls.
119-
3. If the response has a final output (see below for the more on this), we return it and end the loop.
119+
3. If the response has a final output (see below for more on this), we return it and end the loop.
120120
4. If the response has a handoff, we set the agent to the new agent and go back to step 1.
121-
5. We process the tool calls (if any) and append the tool responses messsages. Then we go to step 1.
121+
5. We process the tool calls (if any) and append the tool responses messages. Then we go to step 1.
122122

123123
There is a `max_turns` parameter that you can use to limit the number of times the loop executes.
124124

docs/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ from agents import set_default_openai_key
1010
set_default_openai_key("sk-...")
1111
```
1212

13-
Alternatively, you can also configure an OpenAI client to be used. By default, the SDK creates an `AsyncOpenAI` instance, using the API key from the environment variable or the default key set above. You can chnage this by using the [set_default_openai_client()][agents.set_default_openai_client] function.
13+
Alternatively, you can also configure an OpenAI client to be used. By default, the SDK creates an `AsyncOpenAI` instance, using the API key from the environment variable or the default key set above. You can change this by using the [set_default_openai_client()][agents.set_default_openai_client] function.
1414

1515
```python
1616
from openai import AsyncOpenAI
1717
from agents import set_default_openai_client
1818

1919
custom_client = AsyncOpenAI(base_url="...", api_key="...")
20-
set_default_openai_client(client)
20+
set_default_openai_client(custom_client)
2121
```
2222

2323
Finally, you can also customize the OpenAI API that is used. By default, we use the OpenAI Responses API. You can override this to use the Chat Completions API by using the [set_default_openai_api()][agents.set_default_openai_api] function.

docs/guardrails.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Input guardrails run in 3 steps:
2121

2222
## Output guardrails
2323

24-
Output guardrailas run in 3 steps:
24+
Output guardrails run in 3 steps:
2525

2626
1. First, the guardrail receives the same input passed to the agent.
2727
2. Next, the guardrail function runs to produce a [`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput], which is then wrapped in an [`OutputGuardrailResult`][agents.guardrail.OutputGuardrailResult]
@@ -33,7 +33,7 @@ Output guardrailas run in 3 steps:
3333

3434
## Tripwires
3535

36-
If the input or output fails the guardrail, the Guardrail can signal this with a tripwire. As soon as we see a guardail that has triggered the tripwires, we immediately raise a `{Input,Output}GuardrailTripwireTriggered` exception and halt the Agent execution.
36+
If the input or output fails the guardrail, the Guardrail can signal this with a tripwire. As soon as we see a guardrail that has triggered the tripwires, we immediately raise a `{Input,Output}GuardrailTripwireTriggered` exception and halt the Agent execution.
3737

3838
## Implementing a guardrail
3939

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# OpenAI Agents SDK
22

3-
The [OpenAI Agents SDK](https://github.com/openai/openai-agents-python) enables you to build agentic AI apps in a lightweight, easy to use package with very few abstractions. It's a production-ready upgrade of our previous experimentation for agents, [Swarm](https://github.com/openai/swarm/tree/main). The Agents SDK has a very small set of primitives:
3+
The [OpenAI Agents SDK](https://github.com/openai/openai-agents-python) enables you to build agentic AI apps in a lightweight, easy-to-use package with very few abstractions. It's a production-ready upgrade of our previous experimentation for agents, [Swarm](https://github.com/openai/swarm/tree/main). The Agents SDK has a very small set of primitives:
44

55
- **Agents**, which are LLMs equipped with instructions and tools
66
- **Handoffs**, which allow agents to delegate to other agents for specific tasks
77
- **Guardrails**, which enable the inputs to agents to be validated
88

9-
In combination with Python, these primitives are powerful enough to express complex relationships between tools and agents, and allow you to build real world applications without a steep learning curve. In addition, the SDK comes with built-in **tracing** that lets you visualize and debug your agentic flows, as well as evaluate them and even fine-tune models for your application.
9+
In combination with Python, these primitives are powerful enough to express complex relationships between tools and agents, and allow you to build real-world applications without a steep learning curve. In addition, the SDK comes with built-in **tracing** that lets you visualize and debug your agentic flows, as well as evaluate them and even fine-tune models for your application.
1010

1111
## Why use the Agents SDK
1212

docs/models.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Models
22

3-
The Agents SDK comes with out of the box support for OpenAI models in two flavors:
3+
The Agents SDK comes with out-of-the-box support for OpenAI models in two flavors:
44

55
- **Recommended**: the [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel], which calls OpenAI APIs using the new [Responses API](https://platform.openai.com/docs/api-reference/responses).
66
- The [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel], which calls OpenAI APIs using the [Chat Completions API](https://platform.openai.com/docs/api-reference/chat).
@@ -15,7 +15,7 @@ Within a single workflow, you may want to use different models for each agent. F
1515

1616
!!!note
1717

18-
While our SDK supports both the [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] and the[`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] shapes, we recommend using a single model shape for each workflow because the two shapes support a different set of features and tools. If your workflow requires mixing and matching model shapes, make sure that all the features you're using are available on both.
18+
While our SDK supports both the [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] and the [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] shapes, we recommend using a single model shape for each workflow because the two shapes support a different set of features and tools. If your workflow requires mixing and matching model shapes, make sure that all the features you're using are available on both.
1919

2020
```python
2121
from agents import Agent, Runner, AsyncOpenAI, OpenAIChatCompletionsModel
@@ -48,7 +48,7 @@ async def main():
4848
print(result.final_output)
4949
```
5050

51-
1. Sets the the name of an OpenAI model directly.
51+
1. Sets the name of an OpenAI model directly.
5252
2. Provides a [`Model`][agents.models.interface.Model] implementation.
5353

5454
## Using other LLM providers

docs/multi_agent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ This pattern is great when the task is open-ended and you want to rely on the in
2727

2828
## Orchestrating via code
2929

30-
While orchestrating via LLM is powerful, orchestrating via LLM makes tasks more deterministic and predictable, in terms of speed, cost and performance. Common patterns here are:
30+
While orchestrating via LLM is powerful, orchestrating via code makes tasks more deterministic and predictable, in terms of speed, cost and performance. Common patterns here are:
3131

3232
- Using [structured outputs](https://platform.openai.com/docs/guides/structured-outputs) to generate well formed data that you can inspect with your code. For example, you might ask an agent to classify the task into a few categories, and then pick the next agent based on the category.
3333
- Chaining multiple agents by transforming the output of one into the input of the next. You can decompose a task like writing a blog post into a series of steps - do research, write an outline, write the blog post, critique it, and then improve it.
3434
- Running the agent that performs the task in a `while` loop with an agent that evaluates and provides feedback, until the evaluator says the output passes certain criteria.
3535
- Running multiple agents in parallel, e.g. via Python primitives like `asyncio.gather`. This is useful for speed when you have multiple tasks that don't depend on each other.
3636

37-
We have a number of examples in [`examples/agent_patterns`](https://github.com/openai/openai-agents-python/examples/agent_patterns).
37+
We have a number of examples in [`examples/agent_patterns`](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns).

0 commit comments

Comments
 (0)