Skip to content

Commit

Permalink
fix: remove erroneous thread create argument (#1476)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and stainless-app[bot] committed Jun 7, 2024
1 parent 178afa0 commit bf8a453
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 64
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-ff436357b12348b7c1c930469332a79cd23ac6ec537e645c411893c42de42e57.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-c085faf70d6ff059fbe11b7b6b98123a612524cb9b8a6f649c99526e5b0b1bdb.yml
12 changes: 6 additions & 6 deletions src/openai/resources/beta/threads/runs/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def create(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down Expand Up @@ -321,7 +321,7 @@ def create(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down Expand Up @@ -473,7 +473,7 @@ def create(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down Expand Up @@ -1739,7 +1739,7 @@ async def create(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down Expand Up @@ -1895,7 +1895,7 @@ async def create(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down Expand Up @@ -2047,7 +2047,7 @@ async def create(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down
12 changes: 6 additions & 6 deletions src/openai/resources/beta/threads/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def create_and_run(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down Expand Up @@ -497,7 +497,7 @@ def create_and_run(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down Expand Up @@ -648,7 +648,7 @@ def create_and_run(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down Expand Up @@ -1352,7 +1352,7 @@ async def create_and_run(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down Expand Up @@ -1507,7 +1507,7 @@ async def create_and_run(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down Expand Up @@ -1658,7 +1658,7 @@ async def create_and_run(
assistant will be used.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
response_format: Specifies the format that the model must output. Compatible with
Expand Down
12 changes: 6 additions & 6 deletions src/openai/resources/chat/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def create(
choices. Keep `n` as `1` to minimize costs.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
Expand Down Expand Up @@ -316,7 +316,7 @@ def create(
choices. Keep `n` as `1` to minimize costs.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
Expand Down Expand Up @@ -492,7 +492,7 @@ def create(
choices. Keep `n` as `1` to minimize costs.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
Expand Down Expand Up @@ -741,7 +741,7 @@ async def create(
choices. Keep `n` as `1` to minimize costs.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
Expand Down Expand Up @@ -924,7 +924,7 @@ async def create(
choices. Keep `n` as `1` to minimize costs.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
Expand Down Expand Up @@ -1100,7 +1100,7 @@ async def create(
choices. Keep `n` as `1` to minimize costs.
parallel_tool_calls: Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
presence_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens based on
Expand Down
10 changes: 8 additions & 2 deletions src/openai/types/beta/thread_create_and_run_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"ThreadMessage",
"ThreadMessageAttachment",
"ThreadMessageAttachmentTool",
"ThreadMessageAttachmentToolFileSearch",
"ThreadToolResources",
"ThreadToolResourcesCodeInterpreter",
"ThreadToolResourcesFileSearch",
Expand Down Expand Up @@ -112,7 +113,7 @@ class ThreadCreateAndRunParamsBase(TypedDict, total=False):
parallel_tool_calls: bool
"""
Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
"""

Expand Down Expand Up @@ -186,7 +187,12 @@ class ThreadCreateAndRunParamsBase(TypedDict, total=False):
"""


ThreadMessageAttachmentTool = Union[CodeInterpreterToolParam, FileSearchToolParam]
class ThreadMessageAttachmentToolFileSearch(TypedDict, total=False):
type: Required[Literal["file_search"]]
"""The type of tool being defined: `file_search`"""


ThreadMessageAttachmentTool = Union[CodeInterpreterToolParam, ThreadMessageAttachmentToolFileSearch]


class ThreadMessageAttachment(TypedDict, total=False):
Expand Down
9 changes: 7 additions & 2 deletions src/openai/types/beta/thread_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import List, Union, Iterable, Optional
from typing_extensions import Literal, Required, TypedDict

from .file_search_tool_param import FileSearchToolParam
from .code_interpreter_tool_param import CodeInterpreterToolParam
from .threads.message_content_part_param import MessageContentPartParam

Expand All @@ -14,6 +13,7 @@
"Message",
"MessageAttachment",
"MessageAttachmentTool",
"MessageAttachmentToolFileSearch",
"ToolResources",
"ToolResourcesCodeInterpreter",
"ToolResourcesFileSearch",
Expand Down Expand Up @@ -49,7 +49,12 @@ class ThreadCreateParams(TypedDict, total=False):
"""


MessageAttachmentTool = Union[CodeInterpreterToolParam, FileSearchToolParam]
class MessageAttachmentToolFileSearch(TypedDict, total=False):
type: Required[Literal["file_search"]]
"""The type of tool being defined: `file_search`"""


MessageAttachmentTool = Union[CodeInterpreterToolParam, MessageAttachmentToolFileSearch]


class MessageAttachment(TypedDict, total=False):
Expand Down
17 changes: 14 additions & 3 deletions src/openai/types/beta/threads/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@

from ...._models import BaseModel
from .message_content import MessageContent
from ..file_search_tool import FileSearchTool
from ..code_interpreter_tool import CodeInterpreterTool

__all__ = ["Message", "Attachment", "AttachmentTool", "IncompleteDetails"]
__all__ = [
"Message",
"Attachment",
"AttachmentTool",
"AttachmentToolAssistantToolsFileSearchTypeOnly",
"IncompleteDetails",
]

AttachmentTool = Union[CodeInterpreterTool, FileSearchTool]

class AttachmentToolAssistantToolsFileSearchTypeOnly(BaseModel):
type: Literal["file_search"]
"""The type of tool being defined: `file_search`"""


AttachmentTool = Union[CodeInterpreterTool, AttachmentToolAssistantToolsFileSearchTypeOnly]


class Attachment(BaseModel):
Expand Down
10 changes: 7 additions & 3 deletions src/openai/types/beta/threads/message_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
from typing import Union, Iterable, Optional
from typing_extensions import Literal, Required, TypedDict

from ..file_search_tool_param import FileSearchToolParam
from .message_content_part_param import MessageContentPartParam
from ..code_interpreter_tool_param import CodeInterpreterToolParam

__all__ = ["MessageCreateParams", "Attachment", "AttachmentTool"]
__all__ = ["MessageCreateParams", "Attachment", "AttachmentTool", "AttachmentToolFileSearch"]


class MessageCreateParams(TypedDict, total=False):
Expand Down Expand Up @@ -37,7 +36,12 @@ class MessageCreateParams(TypedDict, total=False):
"""


AttachmentTool = Union[CodeInterpreterToolParam, FileSearchToolParam]
class AttachmentToolFileSearch(TypedDict, total=False):
type: Required[Literal["file_search"]]
"""The type of tool being defined: `file_search`"""


AttachmentTool = Union[CodeInterpreterToolParam, AttachmentToolFileSearch]


class Attachment(TypedDict, total=False):
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/beta/threads/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class Run(BaseModel):
parallel_tool_calls: bool
"""
Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
"""

Expand Down
11 changes: 8 additions & 3 deletions src/openai/types/beta/threads/run_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing_extensions import Literal, Required, TypedDict

from ..assistant_tool_param import AssistantToolParam
from ..file_search_tool_param import FileSearchToolParam
from .message_content_part_param import MessageContentPartParam
from ..code_interpreter_tool_param import CodeInterpreterToolParam
from ..assistant_tool_choice_option_param import AssistantToolChoiceOptionParam
Expand All @@ -17,6 +16,7 @@
"AdditionalMessage",
"AdditionalMessageAttachment",
"AdditionalMessageAttachmentTool",
"AdditionalMessageAttachmentToolFileSearch",
"TruncationStrategy",
"RunCreateParamsNonStreaming",
"RunCreateParamsStreaming",
Expand Down Expand Up @@ -110,7 +110,7 @@ class RunCreateParamsBase(TypedDict, total=False):
parallel_tool_calls: bool
"""
Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
"""

Expand Down Expand Up @@ -173,7 +173,12 @@ class RunCreateParamsBase(TypedDict, total=False):
"""


AdditionalMessageAttachmentTool = Union[CodeInterpreterToolParam, FileSearchToolParam]
class AdditionalMessageAttachmentToolFileSearch(TypedDict, total=False):
type: Required[Literal["file_search"]]
"""The type of tool being defined: `file_search`"""


AdditionalMessageAttachmentTool = Union[CodeInterpreterToolParam, AdditionalMessageAttachmentToolFileSearch]


class AdditionalMessageAttachment(TypedDict, total=False):
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/chat/completion_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
parallel_tool_calls: bool
"""
Whether to enable
[parallel function calling](https://platform.openai.com/docs/guides/function-calling)
[parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
during tool use.
"""

Expand Down

0 comments on commit bf8a453

Please sign in to comment.