Skip to content

Commit

Permalink
chore(sdk): only support v1.32+ (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
mharrisb1 authored Jun 12, 2024
1 parent fb16e8a commit 843e85f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

Pytest plugin for automatically mocking OpenAI requests. Powered by [RESPX](https://github.com/lundberg/respx).

[![sdk support](https://img.shields.io/badge/SDK_Support-v1.25+-white?logo=openai&logoColor=black&labelColor=white)](https://github.com/openai/openai-python)
[![sdk support](https://img.shields.io/badge/SDK_Support-v1.32+-white?logo=openai&logoColor=black&labelColor=white)](https://github.com/openai/openai-python)

> [!NOTE]
> For working with OpenAI Python SDK versions `>=1.25,<1.32` please use version `0.6` or earlier for this library
## Supported Endpoints

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ openai_responses = "openai_responses.plugin"
python = ">=3.9,<4.0"
faker = ">=24.2.0,<25.0.0"
faker-openai-api-provider = "0.2.0"
openai = ">=1.25,<1.32"
openai = ">=1.32,<1.35"
requests-toolbelt = "^1.0.0"
respx = "^0.20.2"

Expand Down
1 change: 1 addition & 0 deletions src/openai_responses/_routes/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def _build(partial: PartialRun, request: httpx.Request) -> Run:
"created_at": utcnow_unix_timestamp_s(),
"instructions": "",
"object": "thread.run",
"parallel_tool_calls": True,
"status": "queued",
}
return model_parse(Run, defaults | partial | content)
Expand Down
1 change: 1 addition & 0 deletions src/openai_responses/_types/partials/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class PartialRun(TypedDict):
metadata: NotRequired[Dict[str, str]]
model: NotRequired[str]
object: NotRequired[Literal["thread.run"]]
parallel_tool_calls: NotRequired[bool]
required_action: NotRequired[PartialRequiredAction]
response_format: NotRequired[
Union[Literal["none", "auto"], PartialAssistantResponseFormat]
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_state_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def test_run_store(state_store: StateStore):
instructions="",
model="",
object="thread.run",
parallel_tool_calls=True,
status="in_progress",
thread_id="thread_abc123",
tools=[],
Expand All @@ -193,6 +194,7 @@ def test_run_store(state_store: StateStore):
instructions="",
model="",
object="thread.run",
parallel_tool_calls=True,
status="in_progress",
thread_id="thread_abc123",
tools=[],
Expand Down

0 comments on commit 843e85f

Please sign in to comment.