Skip to content

Commit

Permalink
chore(types): extract run status to a named type (#1178)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and stainless-app[bot] committed Feb 28, 2024
1 parent a7115b5 commit f0b1823
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.repository == 'openai/openai-python'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Rye
run: |
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Methods:
Types:

```python
from openai.types.beta.threads import RequiredActionFunctionToolCall, Run
from openai.types.beta.threads import RequiredActionFunctionToolCall, Run, RunStatus
```

Methods:
Expand Down
1 change: 1 addition & 0 deletions src/openai/types/beta/threads/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

from .run import Run as Run
from .run_status import RunStatus as RunStatus
from .thread_message import ThreadMessage as ThreadMessage
from .run_list_params import RunListParams as RunListParams
from .run_create_params import RunCreateParams as RunCreateParams
Expand Down
5 changes: 2 additions & 3 deletions src/openai/types/beta/threads/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from ...shared import FunctionDefinition
from ...._models import BaseModel
from .run_status import RunStatus
from .required_action_function_tool_call import RequiredActionFunctionToolCall

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

status: Literal[
"queued", "in_progress", "requires_action", "cancelling", "cancelled", "failed", "completed", "expired"
]
status: RunStatus
"""
The status of the run, which can be either `queued`, `in_progress`,
`requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, or
Expand Down
9 changes: 9 additions & 0 deletions src/openai/types/beta/threads/run_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# File generated from our OpenAPI spec by Stainless.

from typing_extensions import Literal

__all__ = ["RunStatus"]

RunStatus = Literal[
"queued", "in_progress", "requires_action", "cancelling", "cancelled", "failed", "completed", "expired"
]

0 comments on commit f0b1823

Please sign in to comment.