Skip to content

fix: remove erroneous thread create argument #1476

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

Merged
merged 1 commit into from
Jun 7, 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 .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 @@ -154,7 +154,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 @@ -310,7 +310,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 @@ -462,7 +462,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 @@ -1048,7 +1048,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 @@ -1204,7 +1204,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 @@ -1356,7 +1356,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 @@ -333,7 +333,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 @@ -488,7 +488,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 @@ -639,7 +639,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 @@ -1065,7 +1065,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 @@ -1220,7 +1220,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 @@ -1371,7 +1371,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