From 249ecbdeb6566a385ec46dfd5000b4eaa03965f0 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:17:19 -0500 Subject: [PATCH] chore(types): extract run status to a named type (#1178) --- .github/workflows/ci.yml | 2 +- api.md | 2 +- src/openai/types/beta/threads/__init__.py | 1 + src/openai/types/beta/threads/run.py | 5 ++--- src/openai/types/beta/threads/run_status.py | 9 +++++++++ 5 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 src/openai/types/beta/threads/run_status.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e50bfbdd7e..ec10edfe36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: if: github.repository == 'openai/openai-python' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rye run: | diff --git a/api.md b/api.md index 86b972d14e..34352e6e72 100644 --- a/api.md +++ b/api.md @@ -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: diff --git a/src/openai/types/beta/threads/__init__.py b/src/openai/types/beta/threads/__init__.py index 8c77466dec..a71cbde3e3 100644 --- a/src/openai/types/beta/threads/__init__.py +++ b/src/openai/types/beta/threads/__init__.py @@ -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 diff --git a/src/openai/types/beta/threads/run.py b/src/openai/types/beta/threads/run.py index 9c875a9242..79e4f6a444 100644 --- a/src/openai/types/beta/threads/run.py +++ b/src/openai/types/beta/threads/run.py @@ -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__ = [ @@ -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 diff --git a/src/openai/types/beta/threads/run_status.py b/src/openai/types/beta/threads/run_status.py new file mode 100644 index 0000000000..587e3d7810 --- /dev/null +++ b/src/openai/types/beta/threads/run_status.py @@ -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" +]