Skip to content

release: 1.43.0 #1683

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 2 commits into from
Aug 29, 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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.42.0"
".": "1.43.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 68
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-8ff62fa1091460d68fbd36d72c17d91b709917bebf2983c9c4de5784bc384a2e.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-1dbac0e95bdb5a89a0dd3d93265475a378214551b7d8c22862928e0d87ace94b.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.43.0 (2024-08-29)

Full Changelog: [v1.42.0...v1.43.0](https://github.com/openai/openai-python/compare/v1.42.0...v1.43.0)

### Features

* **api:** add file search result details to run steps ([#1681](https://github.com/openai/openai-python/issues/1681)) ([f5449c0](https://github.com/openai/openai-python/commit/f5449c07580ac9707f0387f86f4772fbf0a874b6))

## 1.42.0 (2024-08-20)

Full Changelog: [v1.41.1...v1.42.0](https://github.com/openai/openai-python/compare/v1.41.1...v1.42.0)
Expand Down
3 changes: 2 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ from openai.types.beta.threads.runs import (
RunStepDelta,
RunStepDeltaEvent,
RunStepDeltaMessageDelta,
RunStepInclude,
ToolCall,
ToolCallDelta,
ToolCallDeltaObject,
Expand All @@ -374,7 +375,7 @@ from openai.types.beta.threads.runs import (

Methods:

- <code title="get /threads/{thread_id}/runs/{run_id}/steps/{step_id}">client.beta.threads.runs.steps.<a href="./src/openai/resources/beta/threads/runs/steps.py">retrieve</a>(step_id, \*, thread_id, run_id) -> <a href="./src/openai/types/beta/threads/runs/run_step.py">RunStep</a></code>
- <code title="get /threads/{thread_id}/runs/{run_id}/steps/{step_id}">client.beta.threads.runs.steps.<a href="./src/openai/resources/beta/threads/runs/steps.py">retrieve</a>(step_id, \*, thread_id, run_id, \*\*<a href="src/openai/types/beta/threads/runs/step_retrieve_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/runs/run_step.py">RunStep</a></code>
- <code title="get /threads/{thread_id}/runs/{run_id}/steps">client.beta.threads.runs.steps.<a href="./src/openai/resources/beta/threads/runs/steps.py">list</a>(run_id, \*, thread_id, \*\*<a href="src/openai/types/beta/threads/runs/step_list_params.py">params</a>) -> <a href="./src/openai/types/beta/threads/runs/run_step.py">SyncCursorPage[RunStep]</a></code>

### Messages
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openai"
version = "1.42.0"
version = "1.43.0"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/openai/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "openai"
__version__ = "1.42.0" # x-release-please-version
__version__ = "1.43.0" # x-release-please-version
83 changes: 80 additions & 3 deletions src/openai/resources/beta/threads/runs/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import typing_extensions
from typing import Union, Iterable, Optional, overload
from typing import List, Union, Iterable, Optional, overload
from functools import partial
from typing_extensions import Literal

Expand Down Expand Up @@ -49,6 +49,7 @@
from .....types.beta.threads.run import Run
from .....types.beta.assistant_tool_param import AssistantToolParam
from .....types.beta.assistant_stream_event import AssistantStreamEvent
from .....types.beta.threads.runs.run_step_include import RunStepInclude
from .....types.beta.assistant_tool_choice_option_param import AssistantToolChoiceOptionParam
from .....types.beta.assistant_response_format_option_param import AssistantResponseFormatOptionParam

Expand All @@ -74,6 +75,7 @@ def create(
thread_id: str,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -104,6 +106,14 @@ def create(
[assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
execute this run.

include: A list of additional fields to include in the response. Currently the only
supported value is `step_details.tool_calls[*].file_search.results[*].content`
to fetch the file search result content.

See the
[file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
for more information.

additional_instructions: Appends additional instructions at the end of the instructions for the run. This
is useful for modifying the behavior on a per-run basis without overriding other
instructions.
Expand Down Expand Up @@ -206,6 +216,7 @@ def create(
*,
assistant_id: str,
stream: Literal[True],
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -239,6 +250,14 @@ def create(
events, terminating when the Run enters a terminal state with a `data: [DONE]`
message.

include: A list of additional fields to include in the response. Currently the only
supported value is `step_details.tool_calls[*].file_search.results[*].content`
to fetch the file search result content.

See the
[file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
for more information.

additional_instructions: Appends additional instructions at the end of the instructions for the run. This
is useful for modifying the behavior on a per-run basis without overriding other
instructions.
Expand Down Expand Up @@ -337,6 +356,7 @@ def create(
*,
assistant_id: str,
stream: bool,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -370,6 +390,14 @@ def create(
events, terminating when the Run enters a terminal state with a `data: [DONE]`
message.

include: A list of additional fields to include in the response. Currently the only
supported value is `step_details.tool_calls[*].file_search.results[*].content`
to fetch the file search result content.

See the
[file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
for more information.

additional_instructions: Appends additional instructions at the end of the instructions for the run. This
is useful for modifying the behavior on a per-run basis without overriding other
instructions.
Expand Down Expand Up @@ -467,6 +495,7 @@ def create(
thread_id: str,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -516,7 +545,11 @@ def create(
run_create_params.RunCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"include": include}, run_create_params.RunCreateParams),
),
cast_to=Run,
stream=stream or False,
Expand Down Expand Up @@ -712,6 +745,7 @@ def create_and_poll(
self,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -743,6 +777,7 @@ def create_and_poll(
run = self.create(
thread_id=thread_id,
assistant_id=assistant_id,
include=include,
additional_instructions=additional_instructions,
additional_messages=additional_messages,
instructions=instructions,
Expand Down Expand Up @@ -958,6 +993,7 @@ def stream(
self,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -988,6 +1024,7 @@ def stream(
self,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1018,6 +1055,7 @@ def stream(
self,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1057,6 +1095,7 @@ def stream(
body=maybe_transform(
{
"assistant_id": assistant_id,
"include": include,
"additional_instructions": additional_instructions,
"additional_messages": additional_messages,
"instructions": instructions,
Expand Down Expand Up @@ -1387,6 +1426,7 @@ async def create(
thread_id: str,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1417,6 +1457,14 @@ async def create(
[assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
execute this run.

include: A list of additional fields to include in the response. Currently the only
supported value is `step_details.tool_calls[*].file_search.results[*].content`
to fetch the file search result content.

See the
[file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
for more information.

additional_instructions: Appends additional instructions at the end of the instructions for the run. This
is useful for modifying the behavior on a per-run basis without overriding other
instructions.
Expand Down Expand Up @@ -1519,6 +1567,7 @@ async def create(
*,
assistant_id: str,
stream: Literal[True],
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1552,6 +1601,14 @@ async def create(
events, terminating when the Run enters a terminal state with a `data: [DONE]`
message.

include: A list of additional fields to include in the response. Currently the only
supported value is `step_details.tool_calls[*].file_search.results[*].content`
to fetch the file search result content.

See the
[file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
for more information.

additional_instructions: Appends additional instructions at the end of the instructions for the run. This
is useful for modifying the behavior on a per-run basis without overriding other
instructions.
Expand Down Expand Up @@ -1650,6 +1707,7 @@ async def create(
*,
assistant_id: str,
stream: bool,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1683,6 +1741,14 @@ async def create(
events, terminating when the Run enters a terminal state with a `data: [DONE]`
message.

include: A list of additional fields to include in the response. Currently the only
supported value is `step_details.tool_calls[*].file_search.results[*].content`
to fetch the file search result content.

See the
[file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings)
for more information.

additional_instructions: Appends additional instructions at the end of the instructions for the run. This
is useful for modifying the behavior on a per-run basis without overriding other
instructions.
Expand Down Expand Up @@ -1780,6 +1846,7 @@ async def create(
thread_id: str,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1810,6 +1877,7 @@ async def create(
body=await async_maybe_transform(
{
"assistant_id": assistant_id,
"include": include,
"additional_instructions": additional_instructions,
"additional_messages": additional_messages,
"instructions": instructions,
Expand All @@ -1829,7 +1897,11 @@ async def create(
run_create_params.RunCreateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"include": include}, run_create_params.RunCreateParams),
),
cast_to=Run,
stream=stream or False,
Expand Down Expand Up @@ -2025,6 +2097,7 @@ async def create_and_poll(
self,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -2056,6 +2129,7 @@ async def create_and_poll(
run = await self.create(
thread_id=thread_id,
assistant_id=assistant_id,
include=include,
additional_instructions=additional_instructions,
additional_messages=additional_messages,
instructions=instructions,
Expand Down Expand Up @@ -2303,6 +2377,7 @@ def stream(
self,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -2333,6 +2408,7 @@ def stream(
self,
*,
assistant_id: str,
include: List[RunStepInclude] | NotGiven = NOT_GIVEN,
additional_instructions: Optional[str] | NotGiven = NOT_GIVEN,
additional_messages: Optional[Iterable[run_create_params.AdditionalMessage]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -2374,6 +2450,7 @@ def stream(
body=maybe_transform(
{
"assistant_id": assistant_id,
"include": include,
"additional_instructions": additional_instructions,
"additional_messages": additional_messages,
"instructions": instructions,
Expand Down
Loading