Skip to content

Commit 249ecbd

Browse files
chore(types): extract run status to a named type (#1178)
1 parent a7115b5 commit 249ecbd

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
if: github.repository == 'openai/openai-python'
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818

1919
- name: Install Rye
2020
run: |

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Methods:
224224
Types:
225225

226226
```python
227-
from openai.types.beta.threads import RequiredActionFunctionToolCall, Run
227+
from openai.types.beta.threads import RequiredActionFunctionToolCall, Run, RunStatus
228228
```
229229

230230
Methods:

src/openai/types/beta/threads/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from .run import Run as Run
6+
from .run_status import RunStatus as RunStatus
67
from .thread_message import ThreadMessage as ThreadMessage
78
from .run_list_params import RunListParams as RunListParams
89
from .run_create_params import RunCreateParams as RunCreateParams

src/openai/types/beta/threads/run.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from ...shared import FunctionDefinition
77
from ...._models import BaseModel
8+
from .run_status import RunStatus
89
from .required_action_function_tool_call import RequiredActionFunctionToolCall
910

1011
__all__ = [
@@ -142,9 +143,7 @@ class Run(BaseModel):
142143
started_at: Optional[int] = None
143144
"""The Unix timestamp (in seconds) for when the run was started."""
144145

145-
status: Literal[
146-
"queued", "in_progress", "requires_action", "cancelling", "cancelled", "failed", "completed", "expired"
147-
]
146+
status: RunStatus
148147
"""
149148
The status of the run, which can be either `queued`, `in_progress`,
150149
`requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, or
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# File generated from our OpenAPI spec by Stainless.
2+
3+
from typing_extensions import Literal
4+
5+
__all__ = ["RunStatus"]
6+
7+
RunStatus = Literal[
8+
"queued", "in_progress", "requires_action", "cancelling", "cancelled", "failed", "completed", "expired"
9+
]

0 commit comments

Comments
 (0)