Skip to content

Commit 18f834a

Browse files
feat(api): api update
1 parent 00b2091 commit 18f834a

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 152
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-7c540cce6eb30401259f4831ea9803b6d88501605d13734f98212cbb3b199e10.yml
3-
openapi_spec_hash: 06e656be22bbb92689954253668b42fc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-64c6ba619ccbf87e56b4f464230d04401fd78ad924d2606176309d19ca281af5.yml
3+
openapi_spec_hash: 5e4f2073040a12c26ce58e86a72fe47e
44
config_hash: 1a88b104658b6c854117996c080ebe6b

src/openai/resources/responses/responses.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,7 @@ def compact(
16861686
instructions: Optional[str] | Omit = omit,
16871687
previous_response_id: Optional[str] | Omit = omit,
16881688
prompt_cache_key: Optional[str] | Omit = omit,
1689+
prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit,
16891690
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
16901691
# The extra values given here take precedence over values defined on the client or passed to this method.
16911692
extra_headers: Headers | None = None,
@@ -1723,6 +1724,8 @@ def compact(
17231724
17241725
prompt_cache_key: A key to use when reading from or writing to the prompt cache.
17251726
1727+
prompt_cache_retention: How long to retain a prompt cache entry created by this request.
1728+
17261729
extra_headers: Send extra headers
17271730
17281731
extra_query: Add additional query parameters to the request
@@ -1740,6 +1743,7 @@ def compact(
17401743
"instructions": instructions,
17411744
"previous_response_id": previous_response_id,
17421745
"prompt_cache_key": prompt_cache_key,
1746+
"prompt_cache_retention": prompt_cache_retention,
17431747
},
17441748
response_compact_params.ResponseCompactParams,
17451749
),
@@ -3367,6 +3371,7 @@ async def compact(
33673371
instructions: Optional[str] | Omit = omit,
33683372
previous_response_id: Optional[str] | Omit = omit,
33693373
prompt_cache_key: Optional[str] | Omit = omit,
3374+
prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | Omit = omit,
33703375
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
33713376
# The extra values given here take precedence over values defined on the client or passed to this method.
33723377
extra_headers: Headers | None = None,
@@ -3404,6 +3409,8 @@ async def compact(
34043409
34053410
prompt_cache_key: A key to use when reading from or writing to the prompt cache.
34063411
3412+
prompt_cache_retention: How long to retain a prompt cache entry created by this request.
3413+
34073414
extra_headers: Send extra headers
34083415
34093416
extra_query: Add additional query parameters to the request
@@ -3421,6 +3428,7 @@ async def compact(
34213428
"instructions": instructions,
34223429
"previous_response_id": previous_response_id,
34233430
"prompt_cache_key": prompt_cache_key,
3431+
"prompt_cache_retention": prompt_cache_retention,
34243432
},
34253433
response_compact_params.ResponseCompactParams,
34263434
),

src/openai/types/responses/response_compact_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,6 @@ class ResponseCompactParams(TypedDict, total=False):
140140

141141
prompt_cache_key: Optional[str]
142142
"""A key to use when reading from or writing to the prompt cache."""
143+
144+
prompt_cache_retention: Optional[Literal["in_memory", "24h"]]
145+
"""How long to retain a prompt cache entry created by this request."""

tests/api_resources/test_responses.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ def test_method_compact_with_all_params(self, client: OpenAI) -> None:
388388
instructions="instructions",
389389
previous_response_id="resp_123",
390390
prompt_cache_key="prompt_cache_key",
391+
prompt_cache_retention="in_memory",
391392
)
392393
assert_matches_type(CompactedResponse, response, path=["response"])
393394

@@ -799,6 +800,7 @@ async def test_method_compact_with_all_params(self, async_client: AsyncOpenAI) -
799800
instructions="instructions",
800801
previous_response_id="resp_123",
801802
prompt_cache_key="prompt_cache_key",
803+
prompt_cache_retention="in_memory",
802804
)
803805
assert_matches_type(CompactedResponse, response, path=["response"])
804806

0 commit comments

Comments
 (0)