oauth-codex 3.2.1__tar.gz → 3.2.2__tar.gz

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.
Files changed (73) hide show
  1. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/PKG-INFO +1 -1
  2. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/pyproject.toml +1 -1
  3. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/_streaming.py +12 -1
  4. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/_version.py +1 -1
  5. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/chat/completions.py +4 -6
  6. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex.egg-info/PKG-INFO +1 -1
  7. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/README.md +0 -0
  8. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/setup.cfg +0 -0
  9. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/__init__.py +0 -0
  10. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/_base_client.py +0 -0
  11. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/_engine.py +0 -0
  12. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/_exceptions.py +0 -0
  13. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/_models.py +0 -0
  14. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/_module_client.py +0 -0
  15. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/_resource.py +0 -0
  16. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/_sdk_client.py +0 -0
  17. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/_types.py +0 -0
  18. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/auth/__init__.py +0 -0
  19. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/auth/_oauth.py +0 -0
  20. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/auth/_provider.py +0 -0
  21. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/auth/config.py +0 -0
  22. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/auth/pkce.py +0 -0
  23. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/auth/store.py +0 -0
  24. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/auth/token_manager.py +0 -0
  25. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/compat_store.py +0 -0
  26. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/core_types.py +0 -0
  27. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/errors.py +0 -0
  28. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/py.typed +0 -0
  29. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/__init__.py +0 -0
  30. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/_wrappers.py +0 -0
  31. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/beta.py +0 -0
  32. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/chat/__init__.py +0 -0
  33. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/files.py +0 -0
  34. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/models.py +0 -0
  35. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/responses/__init__.py +0 -0
  36. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/responses/_helpers.py +0 -0
  37. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/responses/input_tokens.py +0 -0
  38. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/responses/responses.py +0 -0
  39. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/responses.py +0 -0
  40. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/vector_stores/__init__.py +0 -0
  41. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/vector_stores/file_batches.py +0 -0
  42. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/vector_stores/files.py +0 -0
  43. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/resources/vector_stores/vector_stores.py +0 -0
  44. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/store.py +0 -0
  45. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/tooling.py +0 -0
  46. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/__init__.py +0 -0
  47. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/chat/__init__.py +0 -0
  48. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/chat/completions.py +0 -0
  49. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/file_deleted.py +0 -0
  50. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/file_object.py +0 -0
  51. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/responses/__init__.py +0 -0
  52. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/responses/input_token_count_response.py +0 -0
  53. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/responses/response.py +0 -0
  54. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/responses/response_stream_event.py +0 -0
  55. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/shared/__init__.py +0 -0
  56. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/shared/model_capabilities.py +0 -0
  57. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/shared/usage.py +0 -0
  58. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/vector_stores/__init__.py +0 -0
  59. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/vector_stores/vector_store.py +0 -0
  60. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/vector_stores/vector_store_deleted.py +0 -0
  61. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/vector_stores/vector_store_file.py +0 -0
  62. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/vector_stores/vector_store_file_batch.py +0 -0
  63. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/types/vector_stores/vector_store_search_response.py +0 -0
  64. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex/version.py +0 -0
  65. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex.egg-info/SOURCES.txt +0 -0
  66. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex.egg-info/dependency_links.txt +0 -0
  67. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex.egg-info/requires.txt +0 -0
  68. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/src/oauth_codex.egg-info/top_level.txt +0 -0
  69. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/tests/test_beta_chat_completions.py +0 -0
  70. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/tests/test_client_authentication.py +0 -0
  71. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/tests/test_client_resource_surface.py +0 -0
  72. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/tests/test_public_api_docstrings.py +0 -0
  73. {oauth_codex-3.2.1 → oauth_codex-3.2.2}/tests/test_public_surface.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oauth-codex
3
- Version: 3.2.1
3
+ Version: 3.2.2
4
4
  Summary: Codex OAuth-based Python SDK with a single Client and generate-first API
5
5
  Author: Codex
6
6
  Requires-Python: >=3.11
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "oauth-codex"
7
- version = "3.2.1"
7
+ version = "3.2.2"
8
8
  description = "Codex OAuth-based Python SDK with a single Client and generate-first API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -16,7 +16,10 @@ def _extract_event_data(raw_event: str) -> str | None:
16
16
  data_lines: list[str] = []
17
17
  for line in raw_event.split("\n"):
18
18
  if line.startswith("data:"):
19
- data_lines.append(line[5:].lstrip())
19
+ content = line[5:].lstrip()
20
+ if content == "[DONE]":
21
+ return "[DONE]"
22
+ data_lines.append(content)
20
23
 
21
24
  if not data_lines:
22
25
  return None
@@ -41,12 +44,16 @@ class Stream(Generic[T]):
41
44
  while "\n\n" in buffer:
42
45
  raw_event, buffer = buffer.split("\n\n", 1)
43
46
  data = _extract_event_data(raw_event)
47
+ if data == "[DONE]":
48
+ return
44
49
  if data is None:
45
50
  continue
46
51
  yield self._cast_event(data)
47
52
 
48
53
  if buffer:
49
54
  data = _extract_event_data(buffer)
55
+ if data == "[DONE]":
56
+ return
50
57
  if data is not None:
51
58
  yield self._cast_event(data)
52
59
  finally:
@@ -71,12 +78,16 @@ class AsyncStream(Generic[T]):
71
78
  while "\n\n" in buffer:
72
79
  raw_event, buffer = buffer.split("\n\n", 1)
73
80
  data = _extract_event_data(raw_event)
81
+ if data == "[DONE]":
82
+ return
74
83
  if data is None:
75
84
  continue
76
85
  yield self._cast_event(data)
77
86
 
78
87
  if buffer:
79
88
  data = _extract_event_data(buffer)
89
+ if data == "[DONE]":
90
+ return
80
91
  if data is not None:
81
92
  yield self._cast_event(data)
82
93
  finally:
@@ -1,2 +1,2 @@
1
1
  __title__ = "oauth-codex"
2
- __version__ = "3.2.1"
2
+ __version__ = "3.2.2"
@@ -167,7 +167,7 @@ def _parse_tool_arguments(arguments: Any) -> dict[str, Any]:
167
167
  if isinstance(arguments, dict):
168
168
  return arguments
169
169
  if not isinstance(arguments, str) or not arguments.strip():
170
- return {}
170
+ raise ValueError(f"Tool arguments must be a valid JSON object string, got: {arguments!r}")
171
171
 
172
172
  try:
173
173
  parsed = json.loads(arguments)
@@ -175,11 +175,9 @@ def _parse_tool_arguments(arguments: Any) -> dict[str, Any]:
175
175
  parsed = json.loads(parsed)
176
176
  if isinstance(parsed, dict):
177
177
  return parsed
178
- except Exception:
179
- pass
180
-
181
- return {}
182
-
178
+ raise ValueError("Parsed arguments is not a dictionary")
179
+ except Exception as e:
180
+ raise ValueError(f"Failed to parse tool arguments: {arguments!r}") from e
183
181
  def _run_tool_function(*, fn: Any, arguments: Any) -> Any:
184
182
  if isinstance(arguments, dict):
185
183
  return fn(**arguments)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oauth-codex
3
- Version: 3.2.1
3
+ Version: 3.2.2
4
4
  Summary: Codex OAuth-based Python SDK with a single Client and generate-first API
5
5
  Author: Codex
6
6
  Requires-Python: >=3.11
File without changes
File without changes