Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(types): extract run status to a named type #1178

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
]