Skip to content

Commit abfdca1

Browse files
committed
SDK regeneration
1 parent 410b862 commit abfdca1

File tree

4 files changed

+276
-2
lines changed

4 files changed

+276
-2
lines changed

reference.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,6 +2411,76 @@ client.user.get_threads(
24112411
</dl>
24122412

24132413

2414+
</dd>
2415+
</dl>
2416+
</details>
2417+
2418+
<details><summary><code>client.user.<a href="src/zep_cloud/user/client.py">warm_user_cache</a>(...)</code></summary>
2419+
<dl>
2420+
<dd>
2421+
2422+
#### 📝 Description
2423+
2424+
<dl>
2425+
<dd>
2426+
2427+
<dl>
2428+
<dd>
2429+
2430+
Hints TurboPuffer to warm cache for this user's graph namespaces for low-latency search
2431+
</dd>
2432+
</dl>
2433+
</dd>
2434+
</dl>
2435+
2436+
#### 🔌 Usage
2437+
2438+
<dl>
2439+
<dd>
2440+
2441+
<dl>
2442+
<dd>
2443+
2444+
```python
2445+
from zep_cloud import Zep
2446+
2447+
client = Zep(
2448+
api_key="YOUR_API_KEY",
2449+
)
2450+
client.user.warm_user_cache(
2451+
user_id="userId",
2452+
)
2453+
2454+
```
2455+
</dd>
2456+
</dl>
2457+
</dd>
2458+
</dl>
2459+
2460+
#### ⚙️ Parameters
2461+
2462+
<dl>
2463+
<dd>
2464+
2465+
<dl>
2466+
<dd>
2467+
2468+
**user_id:** `str` — User ID
2469+
2470+
</dd>
2471+
</dl>
2472+
2473+
<dl>
2474+
<dd>
2475+
2476+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
2477+
2478+
</dd>
2479+
</dl>
2480+
</dd>
2481+
</dl>
2482+
2483+
24142484
</dd>
24152485
</dl>
24162486
</details>

src/zep_cloud/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def __init__(
2222

2323
def get_headers(self) -> typing.Dict[str, str]:
2424
headers: typing.Dict[str, str] = {
25-
"User-Agent": "zep-cloud/3.4.1",
25+
"User-Agent": "zep-cloud/3.5.0",
2626
"X-Fern-Language": "Python",
2727
"X-Fern-SDK-Name": "zep-cloud",
28-
"X-Fern-SDK-Version": "3.4.1",
28+
"X-Fern-SDK-Version": "3.5.0",
2929
**(self.get_custom_headers() or {}),
3030
}
3131
headers["Authorization"] = f"Api-Key {self.api_key}"

src/zep_cloud/user/client.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,39 @@ def get_threads(
325325
_response = self._raw_client.get_threads(user_id, request_options=request_options)
326326
return _response.data
327327

328+
def warm_user_cache(
329+
self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
330+
) -> SuccessResponse:
331+
"""
332+
Hints TurboPuffer to warm cache for this user's graph namespaces for low-latency search
333+
334+
Parameters
335+
----------
336+
user_id : str
337+
User ID
338+
339+
request_options : typing.Optional[RequestOptions]
340+
Request-specific configuration.
341+
342+
Returns
343+
-------
344+
SuccessResponse
345+
Cache warm hint accepted
346+
347+
Examples
348+
--------
349+
from zep_cloud import Zep
350+
351+
client = Zep(
352+
api_key="YOUR_API_KEY",
353+
)
354+
client.user.warm_user_cache(
355+
user_id="userId",
356+
)
357+
"""
358+
_response = self._raw_client.warm_user_cache(user_id, request_options=request_options)
359+
return _response.data
360+
328361

329362
class AsyncUserClient:
330363
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -692,3 +725,44 @@ async def main() -> None:
692725
"""
693726
_response = await self._raw_client.get_threads(user_id, request_options=request_options)
694727
return _response.data
728+
729+
async def warm_user_cache(
730+
self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
731+
) -> SuccessResponse:
732+
"""
733+
Hints TurboPuffer to warm cache for this user's graph namespaces for low-latency search
734+
735+
Parameters
736+
----------
737+
user_id : str
738+
User ID
739+
740+
request_options : typing.Optional[RequestOptions]
741+
Request-specific configuration.
742+
743+
Returns
744+
-------
745+
SuccessResponse
746+
Cache warm hint accepted
747+
748+
Examples
749+
--------
750+
import asyncio
751+
752+
from zep_cloud import AsyncZep
753+
754+
client = AsyncZep(
755+
api_key="YOUR_API_KEY",
756+
)
757+
758+
759+
async def main() -> None:
760+
await client.user.warm_user_cache(
761+
user_id="userId",
762+
)
763+
764+
765+
asyncio.run(main())
766+
"""
767+
_response = await self._raw_client.warm_user_cache(user_id, request_options=request_options)
768+
return _response.data

src/zep_cloud/user/raw_client.py

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,71 @@ def get_threads(
566566
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
567567
)
568568

569+
def warm_user_cache(
570+
self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
571+
) -> HttpResponse[SuccessResponse]:
572+
"""
573+
Hints TurboPuffer to warm cache for this user's graph namespaces for low-latency search
574+
575+
Parameters
576+
----------
577+
user_id : str
578+
User ID
579+
580+
request_options : typing.Optional[RequestOptions]
581+
Request-specific configuration.
582+
583+
Returns
584+
-------
585+
HttpResponse[SuccessResponse]
586+
Cache warm hint accepted
587+
"""
588+
_response = self._client_wrapper.httpx_client.request(
589+
f"users/{jsonable_encoder(user_id)}/warm",
590+
method="GET",
591+
request_options=request_options,
592+
)
593+
try:
594+
if 200 <= _response.status_code < 300:
595+
_data = typing.cast(
596+
SuccessResponse,
597+
parse_obj_as(
598+
type_=SuccessResponse, # type: ignore
599+
object_=_response.json(),
600+
),
601+
)
602+
return HttpResponse(response=_response, data=_data)
603+
if _response.status_code == 404:
604+
raise NotFoundError(
605+
headers=dict(_response.headers),
606+
body=typing.cast(
607+
types_api_error_ApiError,
608+
parse_obj_as(
609+
type_=types_api_error_ApiError, # type: ignore
610+
object_=_response.json(),
611+
),
612+
),
613+
)
614+
if _response.status_code == 500:
615+
raise InternalServerError(
616+
headers=dict(_response.headers),
617+
body=typing.cast(
618+
types_api_error_ApiError,
619+
parse_obj_as(
620+
type_=types_api_error_ApiError, # type: ignore
621+
object_=_response.json(),
622+
),
623+
),
624+
)
625+
_response_json = _response.json()
626+
except JSONDecodeError:
627+
raise core_api_error_ApiError(
628+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
629+
)
630+
raise core_api_error_ApiError(
631+
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
632+
)
633+
569634

570635
class AsyncRawUserClient:
571636
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -1109,3 +1174,68 @@ async def get_threads(
11091174
raise core_api_error_ApiError(
11101175
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
11111176
)
1177+
1178+
async def warm_user_cache(
1179+
self, user_id: str, *, request_options: typing.Optional[RequestOptions] = None
1180+
) -> AsyncHttpResponse[SuccessResponse]:
1181+
"""
1182+
Hints TurboPuffer to warm cache for this user's graph namespaces for low-latency search
1183+
1184+
Parameters
1185+
----------
1186+
user_id : str
1187+
User ID
1188+
1189+
request_options : typing.Optional[RequestOptions]
1190+
Request-specific configuration.
1191+
1192+
Returns
1193+
-------
1194+
AsyncHttpResponse[SuccessResponse]
1195+
Cache warm hint accepted
1196+
"""
1197+
_response = await self._client_wrapper.httpx_client.request(
1198+
f"users/{jsonable_encoder(user_id)}/warm",
1199+
method="GET",
1200+
request_options=request_options,
1201+
)
1202+
try:
1203+
if 200 <= _response.status_code < 300:
1204+
_data = typing.cast(
1205+
SuccessResponse,
1206+
parse_obj_as(
1207+
type_=SuccessResponse, # type: ignore
1208+
object_=_response.json(),
1209+
),
1210+
)
1211+
return AsyncHttpResponse(response=_response, data=_data)
1212+
if _response.status_code == 404:
1213+
raise NotFoundError(
1214+
headers=dict(_response.headers),
1215+
body=typing.cast(
1216+
types_api_error_ApiError,
1217+
parse_obj_as(
1218+
type_=types_api_error_ApiError, # type: ignore
1219+
object_=_response.json(),
1220+
),
1221+
),
1222+
)
1223+
if _response.status_code == 500:
1224+
raise InternalServerError(
1225+
headers=dict(_response.headers),
1226+
body=typing.cast(
1227+
types_api_error_ApiError,
1228+
parse_obj_as(
1229+
type_=types_api_error_ApiError, # type: ignore
1230+
object_=_response.json(),
1231+
),
1232+
),
1233+
)
1234+
_response_json = _response.json()
1235+
except JSONDecodeError:
1236+
raise core_api_error_ApiError(
1237+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
1238+
)
1239+
raise core_api_error_ApiError(
1240+
status_code=_response.status_code, headers=dict(_response.headers), body=_response_json
1241+
)

0 commit comments

Comments
 (0)