openai-agents 0.0.3__py3-none-any.whl → 0.0.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of openai-agents might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openai-agents
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: OpenAI Agents SDK
5
5
  Project-URL: Homepage, https://github.com/openai/openai-agents-python
6
6
  Project-URL: Repository, https://github.com/openai/openai-agents-python
@@ -19,7 +19,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
19
  Classifier: Typing :: Typed
20
20
  Requires-Python: >=3.9
21
21
  Requires-Dist: griffe<2,>=1.5.6
22
- Requires-Dist: openai>=1.66.2
22
+ Requires-Dist: openai>=1.66.5
23
23
  Requires-Dist: pydantic<3,>=2.10
24
24
  Requires-Dist: requests<3,>=2.0
25
25
  Requires-Dist: types-requests<3,>=2.0
@@ -35,7 +35,7 @@ The OpenAI Agents SDK is a lightweight yet powerful framework for building multi
35
35
  ### Core concepts:
36
36
 
37
37
  1. [**Agents**](https://openai.github.io/openai-agents-python/agents): LLMs configured with instructions, tools, guardrails, and handoffs
38
- 2. [**Handoffs**](https://openai.github.io/openai-agents-python/handoffs/): Allow agents to transfer control to other agents for specific tasks
38
+ 2. [**Handoffs**](https://openai.github.io/openai-agents-python/handoffs/): A specialized tool call used by the Agents SDK for transferring control between agents
39
39
  3. [**Guardrails**](https://openai.github.io/openai-agents-python/guardrails/): Configurable safety checks for input and output validation
40
40
  4. [**Tracing**](https://openai.github.io/openai-agents-python/tracing/): Built-in tracking of agent runs, allowing you to view, debug and optimize your workflows
41
41
 
@@ -75,9 +75,11 @@ print(result.final_output)
75
75
 
76
76
  (_If running this, ensure you set the `OPENAI_API_KEY` environment variable_)
77
77
 
78
+ (_For Jupyter notebook users, see [hello_world_jupyter.py](examples/basic/hello_world_jupyter.py)_)
79
+
78
80
  ## Handoffs example
79
81
 
80
- ```py
82
+ ```python
81
83
  from agents import Agent, Runner
82
84
  import asyncio
83
85
 
@@ -144,9 +146,9 @@ When you call `Runner.run()`, we run a loop until we get a final output.
144
146
 
145
147
  1. We call the LLM, using the model and settings on the agent, and the message history.
146
148
  2. The LLM returns a response, which may include tool calls.
147
- 3. If the response has a final output (see below for the more on this), we return it and end the loop.
149
+ 3. If the response has a final output (see below for more on this), we return it and end the loop.
148
150
  4. If the response has a handoff, we set the agent to the new agent and go back to step 1.
149
- 5. We process the tool calls (if any) and append the tool responses messsages. Then we go to step 1.
151
+ 5. We process the tool calls (if any) and append the tool responses messages. Then we go to step 1.
150
152
 
151
153
  There is a `max_turns` parameter that you can use to limit the number of times the loop executes.
152
154
 
@@ -168,7 +170,7 @@ The Agents SDK is designed to be highly flexible, allowing you to model a wide r
168
170
 
169
171
  ## Tracing
170
172
 
171
- The Agents SDK automatically traces your agent runs, making it easy to track and debug the behavior of your agents. Tracing is extensible by design, supporting custom spans and a wide variety of external destinations, including [Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents), [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk), and [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk). For more details about how to customize or disable tracing, see [Tracing](http://openai.github.io/openai-agents-python/tracing).
173
+ The Agents SDK automatically traces your agent runs, making it easy to track and debug the behavior of your agents. Tracing is extensible by design, supporting custom spans and a wide variety of external destinations, including [Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents), [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk), [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk), [Scorecard](https://docs.scorecard.io/docs/documentation/features/tracing#openai-agents-sdk-integration), and [Keywords AI](https://docs.keywordsai.co/integration/development-frameworks/openai-agent). For more details about how to customize or disable tracing, see [Tracing](http://openai.github.io/openai-agents-python/tracing), which also includes a larger list of [external tracing processors](http://openai.github.io/openai-agents-python/tracing/#external-tracing-processors-list).
172
174
 
173
175
  ## Development (only needed if you need to edit the SDK/examples)
174
176
 
@@ -0,0 +1,55 @@
1
+ agents/__init__.py,sha256=vdpHPLytdNImdTlOJUnZi_Wx6Egot3q_InhcFixd6zU,6422
2
+ agents/_config.py,sha256=ANrM7GP2VSQehDkMc9qocxkUlPwqU-i5sieMJyEwxpM,796
3
+ agents/_debug.py,sha256=7OKys2lDjeCtGggTkM53m_8vw0WIr3yt-_JPBDAnsw0,608
4
+ agents/_run_impl.py,sha256=B-YeWxms2vi3SHMSsHPEjif0ZbcpxDetRugo-_mkUVw,31991
5
+ agents/agent.py,sha256=ODhpQ74vZfYpk_8vxExJEXBl1dJVsgudXabY9t069qQ,8324
6
+ agents/agent_output.py,sha256=sUlsur0_C2pPokyvspo5gxIkM0PtcNxdbZmeu_6Z4TE,5379
7
+ agents/computer.py,sha256=XD44UgiUWSfniv-xKwwDP6wFKVwBiZkpaL1hO-0-7ZA,2516
8
+ agents/exceptions.py,sha256=F3AltRt27PGdhbFqKBhRJL9eHqoN4SQx7oxBn0GWmhs,1856
9
+ agents/function_schema.py,sha256=8f90espzzVE4i9cCiOYAzX5zHHhYm195gX9Ytvtr1P4,12908
10
+ agents/guardrail.py,sha256=vWWcApo9s_6aHapQ5AMko08MqC8Jrlk-J5iqIRctCDQ,9291
11
+ agents/handoffs.py,sha256=wRg-HBGKBZev88mOg_mfv6CR8T2kewZM8eX3tb71l1g,9043
12
+ agents/items.py,sha256=xCoX-ZcUUs3WHN90_o8PQSnX8jt8oQ2TJPz7k74ooQ4,8182
13
+ agents/lifecycle.py,sha256=wYFG6PLSKQ7bICKVbB8oGtdoJNINGq9obh2RSKlAkDE,2938
14
+ agents/logger.py,sha256=p_ef7vWKpBev5FFybPJjhrCCQizK08Yy1A2EDO1SNNg,60
15
+ agents/model_settings.py,sha256=4JOqsLswjdrEszNqNEJ_dYjxUMCyt68hOIdgxlXELw0,2169
16
+ agents/result.py,sha256=JOscHoh2EIUY4w-ESO500Z3DnNYq67vtkRrWr70fOr4,8421
17
+ agents/run.py,sha256=SI0u7XQ6e3lEP6v1k530rDDcJJbg8K_DcdK2o0leCqI,37129
18
+ agents/run_context.py,sha256=vuSUQM8O4CLensQY27-22fOqECnw7yvwL9U3WO8b_bk,851
19
+ agents/stream_events.py,sha256=ULgBEcL_H4vklZoxhpY2yomeoxVF0UiXvswsFsjFv4s,1547
20
+ agents/strict_schema.py,sha256=FEyEvF3ZjxIHRLmraBGZyjJjuFiPCZGaCFV22LlwaTQ,5783
21
+ agents/tool.py,sha256=XKeR1khfbaPbyO8DiGsn8WMO_Hkbrmm9NQzGeRsKcPs,11641
22
+ agents/usage.py,sha256=-MZOmSDVdWxA2V_yVVnmUcwVcLdvYFccv0HXZ7Ow3_A,733
23
+ agents/version.py,sha256=bkeg2DaYBS8OnV7R7J6OuF5pNA__0mJ4QZsJjC1DTI0,223
24
+ agents/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ agents/extensions/handoff_filters.py,sha256=2cXxu1JROez96CpTiGuT9PIuaIrIE8ksP01fX83krKM,1977
26
+ agents/extensions/handoff_prompt.py,sha256=oGWN0uNh3Z1L7E-Ev2up8W084fFrDNOsLDy7P6bcmic,1006
27
+ agents/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
+ agents/models/_openai_shared.py,sha256=4Ngwo2Fv2RXY61Pqck1cYPkSln2tDnb8Ai-ao4QG-iE,836
29
+ agents/models/fake_id.py,sha256=lbXjUUSMeAQ8eFx4V5QLUnBClHE6adJlYYav55RlG5w,268
30
+ agents/models/interface.py,sha256=dgIlKyPaCbNRTHXxd6x7OQwJuAelG3F-C19P-aacHWQ,3129
31
+ agents/models/openai_chatcompletions.py,sha256=xs2JdEl0taqz3LIRWL8etr88tzpa_UWggAwAQPTyoxQ,39375
32
+ agents/models/openai_provider.py,sha256=3zKt8stSm0IcDJzX8GqXa3UcECKK79A290Zzem1nlUo,2784
33
+ agents/models/openai_responses.py,sha256=4CowZT0wAMflEzDgi6hEidcMq_0zchIm2uX_vV090TM,13386
34
+ agents/tracing/__init__.py,sha256=pp2_mBCQGL9oN6_czCWHQsV4ZTEOcy1AVxdjQ41PNr0,2424
35
+ agents/tracing/create.py,sha256=xn0n1Zr6Az4SMw0x_OeBNiBHJ1yYxL1FNhA_bLhBodY,12111
36
+ agents/tracing/logger.py,sha256=J4KUDRSGa7x5UVfUwWe-gbKwoaq8AeETRqkPt3QvtGg,68
37
+ agents/tracing/processor_interface.py,sha256=wNyZCwNJko5CrUIWD_lMou5ppQ67CFYwvWRsJRM3up8,1659
38
+ agents/tracing/processors.py,sha256=z3NAwo4ZG8KloEIq7ihIadxMfduL_cECY5XCgOaK1H8,9595
39
+ agents/tracing/scope.py,sha256=84gOESqFfR2E_XCZsT11DLyR-3UTyqxHrfBBjH1Ic44,1373
40
+ agents/tracing/setup.py,sha256=1wRMIVnsMOx5nWWnldqbTXg44a7-ABcC0jZK4q4I-S8,6729
41
+ agents/tracing/span_data.py,sha256=5VOoiHHakviJDeiLcPAQS_jy2hPS__GwKsREAUg8Bd4,4604
42
+ agents/tracing/spans.py,sha256=6vVzocGMsdgIma1ksqkBZmhar91xj4RpgcpUC3iibqg,6606
43
+ agents/tracing/traces.py,sha256=G5LlECSK-DBRFP-bjT8maZjBQulz6SaHILYauUVlfq8,4775
44
+ agents/tracing/util.py,sha256=BsDvn2rjE4SRQvfm55utljT8agdA0Z36KWXd1vdx4hs,392
45
+ agents/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
+ agents/util/_coro.py,sha256=S38XUYFC7bqTELSgMUBsAX1GoRlIrV7coupcUAWH__4,45
47
+ agents/util/_error_tracing.py,sha256=hdkYNx180b18lP0PSB1toE5atNHsMg_Bm9Osw812vLo,421
48
+ agents/util/_json.py,sha256=eKeQeMlQkBXRFeL3ilNZFmszGyfhtzZdW_GW_As6dcg,972
49
+ agents/util/_pretty_print.py,sha256=rRVp24UmTgzCm-W4ritWBOxxnPRinzFdrZlOhTi1KVQ,2227
50
+ agents/util/_transforms.py,sha256=CZe74NOHkHneyo4fHYfFWksCSTn-kXtEyejL9P0_xlA,270
51
+ agents/util/_types.py,sha256=8KxYfCw0gYSMWcQmacJoc3Q7Lc46LmT-AWvhF10KJ-E,160
52
+ openai_agents-0.0.5.dist-info/METADATA,sha256=fHalk7G3p4YxZCj85yRVbOpYX63vgxcR0mIFdEEpfgU,7757
53
+ openai_agents-0.0.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
54
+ openai_agents-0.0.5.dist-info/licenses/LICENSE,sha256=E994EspT7Krhy0qGiES7WYNzBHrh1YDk3r--8d1baRU,1063
55
+ openai_agents-0.0.5.dist-info/RECORD,,
agents/_utils.py DELETED
@@ -1,61 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import re
4
- from collections.abc import Awaitable
5
- from typing import Any, Literal, Union
6
-
7
- from pydantic import TypeAdapter, ValidationError
8
- from typing_extensions import TypeVar
9
-
10
- from .exceptions import ModelBehaviorError
11
- from .logger import logger
12
- from .tracing import Span, SpanError, get_current_span
13
-
14
- T = TypeVar("T")
15
-
16
- MaybeAwaitable = Union[Awaitable[T], T]
17
-
18
-
19
- def transform_string_function_style(name: str) -> str:
20
- # Replace spaces with underscores
21
- name = name.replace(" ", "_")
22
-
23
- # Replace non-alphanumeric characters with underscores
24
- name = re.sub(r"[^a-zA-Z0-9]", "_", name)
25
-
26
- return name.lower()
27
-
28
-
29
- def validate_json(json_str: str, type_adapter: TypeAdapter[T], partial: bool) -> T:
30
- partial_setting: bool | Literal["off", "on", "trailing-strings"] = (
31
- "trailing-strings" if partial else False
32
- )
33
- try:
34
- validated = type_adapter.validate_json(json_str, experimental_allow_partial=partial_setting)
35
- return validated
36
- except ValidationError as e:
37
- attach_error_to_current_span(
38
- SpanError(
39
- message="Invalid JSON provided",
40
- data={},
41
- )
42
- )
43
- raise ModelBehaviorError(
44
- f"Invalid JSON when parsing {json_str} for {type_adapter}; {e}"
45
- ) from e
46
-
47
-
48
- def attach_error_to_span(span: Span[Any], error: SpanError) -> None:
49
- span.set_error(error)
50
-
51
-
52
- def attach_error_to_current_span(error: SpanError) -> None:
53
- span = get_current_span()
54
- if span:
55
- attach_error_to_span(span, error)
56
- else:
57
- logger.warning(f"No span to add error {error} to")
58
-
59
-
60
- async def noop_coroutine() -> None:
61
- pass
@@ -1,49 +0,0 @@
1
- agents/__init__.py,sha256=Qd1eatUlALblGTqHV4o5jL-h65furZ-s0IK8RFNRGWY,5879
2
- agents/_config.py,sha256=5qrDSZuguiL0gCTd_6f9J6ulpsRySueZ3re4lyd4PU0,743
3
- agents/_debug.py,sha256=7OKys2lDjeCtGggTkM53m_8vw0WIr3yt-_JPBDAnsw0,608
4
- agents/_run_impl.py,sha256=QzHStnsTZymjTFy8fKTpkfvMijyW7zWoKg1a2VUzC7U,28549
5
- agents/_utils.py,sha256=L21Hdl20U66Asp-W61yTnahmo8b6X58jsgdUBWb9_Rk,1685
6
- agents/agent.py,sha256=Y0lnIva9qL_WJVUVxDQtSrMa0KuM5IXLWK0q6CzIxas,6297
7
- agents/agent_output.py,sha256=k271F9MgMaoS1nPtsSwsURP8mNxv8VrEOWrv7PJSQT4,5345
8
- agents/computer.py,sha256=XD44UgiUWSfniv-xKwwDP6wFKVwBiZkpaL1hO-0-7ZA,2516
9
- agents/exceptions.py,sha256=F3AltRt27PGdhbFqKBhRJL9eHqoN4SQx7oxBn0GWmhs,1856
10
- agents/function_schema.py,sha256=OgeuiDhLowhYt6T9CU-7Fk05uKIxPaDPgL2hdnMFjpQ,12666
11
- agents/guardrail.py,sha256=3A355heAUkaGBmyKArq-3XVFunydlAZKkFRo8mHuH5w,9290
12
- agents/handoffs.py,sha256=onlvwSCTNJKof2Ftk-qZ5-zxTNT9AimjvyOcxj4Rp38,8999
13
- agents/items.py,sha256=DQPAJQkAVRR9Js-RVDtp4eizxiVaL30bbB0W-8U7GuQ,8069
14
- agents/lifecycle.py,sha256=wYFG6PLSKQ7bICKVbB8oGtdoJNINGq9obh2RSKlAkDE,2938
15
- agents/logger.py,sha256=p_ef7vWKpBev5FFybPJjhrCCQizK08Yy1A2EDO1SNNg,60
16
- agents/model_settings.py,sha256=UqMgm_wuSjY7Mu6fsal9a8nbOUKJDYx957DxWfmYvB8,1426
17
- agents/result.py,sha256=vBLf6wUMIeCVcLKoaXLtxXZzmqK2QYRoba76uRCjAcs,8276
18
- agents/run.py,sha256=GLPPfHH7MswO_5oW27y7RsZVY5rbkvyCBxG4kbN5y-Q,37064
19
- agents/run_context.py,sha256=vuSUQM8O4CLensQY27-22fOqECnw7yvwL9U3WO8b_bk,851
20
- agents/stream_events.py,sha256=ULgBEcL_H4vklZoxhpY2yomeoxVF0UiXvswsFsjFv4s,1547
21
- agents/strict_schema.py,sha256=FEyEvF3ZjxIHRLmraBGZyjJjuFiPCZGaCFV22LlwaTQ,5783
22
- agents/tool.py,sha256=0WU0moxdIBnpbxM-iXpPZXZOd1tMX2f3X5E8qntVJ6U,10671
23
- agents/usage.py,sha256=-MZOmSDVdWxA2V_yVVnmUcwVcLdvYFccv0HXZ7Ow3_A,733
24
- agents/version.py,sha256=bkeg2DaYBS8OnV7R7J6OuF5pNA__0mJ4QZsJjC1DTI0,223
25
- agents/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- agents/extensions/handoff_filters.py,sha256=2cXxu1JROez96CpTiGuT9PIuaIrIE8ksP01fX83krKM,1977
27
- agents/extensions/handoff_prompt.py,sha256=oGWN0uNh3Z1L7E-Ev2up8W084fFrDNOsLDy7P6bcmic,1006
28
- agents/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- agents/models/_openai_shared.py,sha256=4Ngwo2Fv2RXY61Pqck1cYPkSln2tDnb8Ai-ao4QG-iE,836
30
- agents/models/fake_id.py,sha256=lbXjUUSMeAQ8eFx4V5QLUnBClHE6adJlYYav55RlG5w,268
31
- agents/models/interface.py,sha256=dgIlKyPaCbNRTHXxd6x7OQwJuAelG3F-C19P-aacHWQ,3129
32
- agents/models/openai_chatcompletions.py,sha256=pVAS0WnXhCUR1XK90KCDf985TaiWEkfkjgvdiOHamxU,37880
33
- agents/models/openai_provider.py,sha256=0F_tiftdpTx3mDj0fWzthjw8ZC91HAs1kHQs5oEYnDE,2295
34
- agents/models/openai_responses.py,sha256=i8kZJyFcy-JvK8lIuS94-wRCNgp8niyQ-xiX6ygamrg,13171
35
- agents/tracing/__init__.py,sha256=pp2_mBCQGL9oN6_czCWHQsV4ZTEOcy1AVxdjQ41PNr0,2424
36
- agents/tracing/create.py,sha256=PAhfJKAeJ8jbZvxylTiikU_LqAhezYHphR4jG5EdaAE,12110
37
- agents/tracing/logger.py,sha256=J4KUDRSGa7x5UVfUwWe-gbKwoaq8AeETRqkPt3QvtGg,68
38
- agents/tracing/processor_interface.py,sha256=wNyZCwNJko5CrUIWD_lMou5ppQ67CFYwvWRsJRM3up8,1659
39
- agents/tracing/processors.py,sha256=iGtVJMmOZZqpNBr9S7Xbp-rvu7A92DKYOkXwExgkwEE,9706
40
- agents/tracing/scope.py,sha256=x1m-aYilS1DeeV4L7Ckv55LVWod7c_nnTKoCGhJCumk,1372
41
- agents/tracing/setup.py,sha256=P5JaIcHej6m62rb27bSutN2Bqv0XSD9Z_Ki7ynCVdbs,6728
42
- agents/tracing/span_data.py,sha256=UQUPpMQ7Z1XOqKFJNHUxAJUVPwa6JMfGa7dm_NovuhQ,4574
43
- agents/tracing/spans.py,sha256=KWCqcRwUlt85NCZPQp98UIF5vAQAVWuVWQh3tgPK0WE,6605
44
- agents/tracing/traces.py,sha256=GL9EoEQKVk7eo0BcfRfQ6C7tdzlmPhkneQn4fdsCdqA,4774
45
- agents/tracing/util.py,sha256=BsDvn2rjE4SRQvfm55utljT8agdA0Z36KWXd1vdx4hs,392
46
- openai_agents-0.0.3.dist-info/METADATA,sha256=opoAevRMlODIV-a359F0WHOV6CJI2vNzfazw4zYrF7A,7285
47
- openai_agents-0.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
48
- openai_agents-0.0.3.dist-info/licenses/LICENSE,sha256=E994EspT7Krhy0qGiES7WYNzBHrh1YDk3r--8d1baRU,1063
49
- openai_agents-0.0.3.dist-info/RECORD,,