openai-agents 0.0.8__py3-none-any.whl → 0.0.9__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.

agents/mcp/util.py CHANGED
@@ -59,6 +59,11 @@ class MCPUtil:
59
59
  """Convert an MCP tool to an Agents SDK function tool."""
60
60
  invoke_func = functools.partial(cls.invoke_mcp_tool, server, tool)
61
61
  schema, is_strict = tool.inputSchema, False
62
+
63
+ # MCP spec doesn't require the inputSchema to have `properties`, but OpenAI spec does.
64
+ if "properties" not in schema:
65
+ schema["properties"] = {}
66
+
62
67
  if convert_schemas_to_strict:
63
68
  try:
64
69
  schema = ensure_strict_json_schema(schema)
@@ -518,10 +518,8 @@ class OpenAIChatCompletionsModel(Model):
518
518
  f"Response format: {response_format}\n"
519
519
  )
520
520
 
521
- # Match the behavior of Responses where store is True when not given
522
- store = model_settings.store if model_settings.store is not None else True
523
-
524
521
  reasoning_effort = model_settings.reasoning.effort if model_settings.reasoning else None
522
+ store = _Converter.get_store_param(self._get_client(), model_settings)
525
523
 
526
524
  ret = await self._get_client().chat.completions.create(
527
525
  model=self.model,
@@ -537,10 +535,10 @@ class OpenAIChatCompletionsModel(Model):
537
535
  parallel_tool_calls=parallel_tool_calls,
538
536
  stream=stream,
539
537
  stream_options={"include_usage": True} if stream else NOT_GIVEN,
540
- store=store,
538
+ store=self._non_null_or_not_given(store),
541
539
  reasoning_effort=self._non_null_or_not_given(reasoning_effort),
542
540
  extra_headers=_HEADERS,
543
- metadata=model_settings.metadata,
541
+ metadata=self._non_null_or_not_given(model_settings.metadata),
544
542
  )
545
543
 
546
544
  if isinstance(ret, ChatCompletion):
@@ -570,6 +568,12 @@ class OpenAIChatCompletionsModel(Model):
570
568
 
571
569
 
572
570
  class _Converter:
571
+ @classmethod
572
+ def get_store_param(cls, client: AsyncOpenAI, model_settings: ModelSettings) -> bool | None:
573
+ # Match the behavior of Responses where store is True when not given
574
+ default_store = True if str(client.base_url).startswith("https://api.openai.com") else None
575
+ return model_settings.store if model_settings.store is not None else default_store
576
+
573
577
  @classmethod
574
578
  def convert_tool_choice(
575
579
  cls, tool_choice: Literal["auto", "required", "none"] | str | None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openai-agents
3
- Version: 0.0.8
3
+ Version: 0.0.9
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
@@ -28,12 +28,12 @@ agents/extensions/handoff_prompt.py,sha256=oGWN0uNh3Z1L7E-Ev2up8W084fFrDNOsLDy7P
28
28
  agents/extensions/visualization.py,sha256=bHtrkqwapHsp9z3hYfidAJXdhsKnW2KioisQcHRxgzM,4242
29
29
  agents/mcp/__init__.py,sha256=x-4ZFiXNyJPn9Nbwcai6neKgonyRJ7by67HxnOLPgrw,359
30
30
  agents/mcp/server.py,sha256=qbeFEPg2xiUvNKfUlA8qyfDeFsv2yXAJabLG2GhfExQ,11269
31
- agents/mcp/util.py,sha256=0toNfRn6v-RD9pq8RWNHv5KvjhqfxqtgFRvpVGyZsco,5058
31
+ agents/mcp/util.py,sha256=dIEdYDMc7Sjp-DFQnvoc4VWU-B7Heyx0I41bcW7RlEg,5232
32
32
  agents/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  agents/models/_openai_shared.py,sha256=4Ngwo2Fv2RXY61Pqck1cYPkSln2tDnb8Ai-ao4QG-iE,836
34
34
  agents/models/fake_id.py,sha256=lbXjUUSMeAQ8eFx4V5QLUnBClHE6adJlYYav55RlG5w,268
35
35
  agents/models/interface.py,sha256=dgIlKyPaCbNRTHXxd6x7OQwJuAelG3F-C19P-aacHWQ,3129
36
- agents/models/openai_chatcompletions.py,sha256=XfNcE0cGKC-ujnVdWoVKNzo_OlJkdBVF6poGzXHKjCc,39902
36
+ agents/models/openai_chatcompletions.py,sha256=hd_VN_4UcObOiKlW8-whTCVLd9enI46vsB_FCTNXCAA,40261
37
37
  agents/models/openai_provider.py,sha256=NMxTNaoTa329GrA7jj51LC02pb_e2eFh-PCvWADJrkY,3478
38
38
  agents/models/openai_responses.py,sha256=426m0pvVpxWabzVDirzZunprxvV0DxR0j8pm7pr6cmU,13684
39
39
  agents/tracing/__init__.py,sha256=-hJeEiNvgyQdEXpFTrr_qu_XYREvIrF5KyePDtovSak,2804
@@ -69,7 +69,7 @@ agents/voice/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
69
69
  agents/voice/models/openai_model_provider.py,sha256=Khn0uT-VhsEbe7_OhBMGFQzXNwL80gcWZyTHl3CaBII,3587
70
70
  agents/voice/models/openai_stt.py,sha256=rRsldkvkPhH4T0waX1dhccEqIwmPYh-teK_LRvBgiNI,16882
71
71
  agents/voice/models/openai_tts.py,sha256=4KoLQuFDHKu5a1VTJlu9Nj3MHwMlrn9wfT_liJDJ2dw,1477
72
- openai_agents-0.0.8.dist-info/METADATA,sha256=-0WMHr1jJ8nL0Y7UZSkZ53gx2_htTutYY1hc9y35X-c,8133
73
- openai_agents-0.0.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
74
- openai_agents-0.0.8.dist-info/licenses/LICENSE,sha256=E994EspT7Krhy0qGiES7WYNzBHrh1YDk3r--8d1baRU,1063
75
- openai_agents-0.0.8.dist-info/RECORD,,
72
+ openai_agents-0.0.9.dist-info/METADATA,sha256=R8O4XBe-4EjWJhLJWc-K5Kgck34NOUJEXjIGQuLb9a0,8133
73
+ openai_agents-0.0.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
74
+ openai_agents-0.0.9.dist-info/licenses/LICENSE,sha256=E994EspT7Krhy0qGiES7WYNzBHrh1YDk3r--8d1baRU,1063
75
+ openai_agents-0.0.9.dist-info/RECORD,,