assistant-runtime-sdk 1.12.1__tar.gz → 1.13.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/PKG-INFO +1 -1
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/__init__.py +1 -1
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/async_client.py +9 -0
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/base.py +13 -0
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/client.py +9 -0
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/pyproject.toml +1 -1
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/LICENSE +0 -0
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/README.md +0 -0
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/auth.py +0 -0
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/exceptions.py +0 -0
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/skills.py +0 -0
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/streaming.py +0 -0
- {assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/types.py +0 -0
{assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/async_client.py
RENAMED
|
@@ -385,11 +385,18 @@ class AsyncAssistantRuntimeClient(BaseAssistantRuntimeClient):
|
|
|
385
385
|
web_search: Optional[bool] = None,
|
|
386
386
|
thinking_enabled: Optional[bool] = None,
|
|
387
387
|
reasoning_effort: Optional[str] = None,
|
|
388
|
+
confirm_low_balance: Optional[bool] = None,
|
|
389
|
+
low_balance_preview: bool = True,
|
|
388
390
|
) -> AsyncGenerator[Dict[str, Any], None]:
|
|
389
391
|
"""Async version of AssistantRuntimeClient.stream_chat.
|
|
390
392
|
|
|
391
393
|
On ``stream_complete``, ``event['session_state']`` is the updated signed
|
|
392
394
|
blob — store it and pass it as ``session_state`` on the next turn.
|
|
395
|
+
|
|
396
|
+
``confirm_low_balance`` proceeds after the user acknowledged a low-balance
|
|
397
|
+
warning (sent as ``1``; omitted otherwise). ``low_balance_preview`` declares
|
|
398
|
+
that this client can show the low-balance "Send anyway" preview (sent as
|
|
399
|
+
``1`` by default); pass False only for a client that cannot.
|
|
393
400
|
"""
|
|
394
401
|
session = self._ensure_session()
|
|
395
402
|
payload = self._prepare_stream_payload(
|
|
@@ -402,6 +409,8 @@ class AsyncAssistantRuntimeClient(BaseAssistantRuntimeClient):
|
|
|
402
409
|
web_search=web_search,
|
|
403
410
|
thinking_enabled=thinking_enabled,
|
|
404
411
|
reasoning_effort=reasoning_effort,
|
|
412
|
+
confirm_low_balance=confirm_low_balance,
|
|
413
|
+
low_balance_preview=low_balance_preview,
|
|
405
414
|
)
|
|
406
415
|
url = self._build_endpoint_url("streaming.stream_chat")
|
|
407
416
|
payload = self._with_site_url(payload)
|
|
@@ -317,6 +317,8 @@ class BaseAssistantRuntimeClient:
|
|
|
317
317
|
web_search: Optional[bool] = None,
|
|
318
318
|
thinking_enabled: Optional[bool] = None,
|
|
319
319
|
reasoning_effort: Optional[str] = None,
|
|
320
|
+
confirm_low_balance: Optional[bool] = None,
|
|
321
|
+
low_balance_preview: bool = True,
|
|
320
322
|
) -> Dict[str, Any]:
|
|
321
323
|
"""
|
|
322
324
|
Prepare JSON payload for stream_chat POST request.
|
|
@@ -350,6 +352,11 @@ class BaseAssistantRuntimeClient:
|
|
|
350
352
|
thinking_enabled: Optional explicit extended-thinking toggle for this turn
|
|
351
353
|
reasoning_effort: Optional thinking level for this turn — "off", "low", "medium",
|
|
352
354
|
"high", "xhigh" or "max"
|
|
355
|
+
confirm_low_balance: Set True to proceed with this turn after the user
|
|
356
|
+
acknowledged a low-balance warning (sent as ``1``; omitted otherwise)
|
|
357
|
+
low_balance_preview: Declares that this client can show the low-balance
|
|
358
|
+
"Send anyway" preview (sent as ``1`` by default). Pass False only for
|
|
359
|
+
a client that cannot, so the server does not refuse the turn.
|
|
353
360
|
|
|
354
361
|
Returns:
|
|
355
362
|
Payload dict ready for JSON body
|
|
@@ -406,6 +413,12 @@ class BaseAssistantRuntimeClient:
|
|
|
406
413
|
if reasoning_effort is not None:
|
|
407
414
|
payload["reasoning_effort"] = str(reasoning_effort).strip().lower()
|
|
408
415
|
|
|
416
|
+
if confirm_low_balance:
|
|
417
|
+
payload["confirm_low_balance"] = 1
|
|
418
|
+
|
|
419
|
+
if low_balance_preview:
|
|
420
|
+
payload["low_balance_preview"] = 1
|
|
421
|
+
|
|
409
422
|
return payload
|
|
410
423
|
|
|
411
424
|
def _prepare_resource_params(
|
{assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/client.py
RENAMED
|
@@ -330,6 +330,8 @@ class AssistantRuntimeClient(BaseAssistantRuntimeClient):
|
|
|
330
330
|
web_search: Optional[bool] = None,
|
|
331
331
|
thinking_enabled: Optional[bool] = None,
|
|
332
332
|
reasoning_effort: Optional[str] = None,
|
|
333
|
+
confirm_low_balance: Optional[bool] = None,
|
|
334
|
+
low_balance_preview: bool = True,
|
|
333
335
|
) -> Generator[Dict[str, Any], None, None]:
|
|
334
336
|
"""
|
|
335
337
|
Stream chat response from Assistant Runtime.
|
|
@@ -365,6 +367,11 @@ class AssistantRuntimeClient(BaseAssistantRuntimeClient):
|
|
|
365
367
|
reasoning_effort: Optional thinking level for this turn — "off", "low", "medium",
|
|
366
368
|
"high", "xhigh" or "max". Servers that predate it ignore it, so callers
|
|
367
369
|
should also send thinking_enabled.
|
|
370
|
+
confirm_low_balance: Set True to proceed after the user acknowledged a
|
|
371
|
+
low-balance warning (sent as ``1``; omitted otherwise)
|
|
372
|
+
low_balance_preview: Declares that this client can show the low-balance
|
|
373
|
+
"Send anyway" preview (sent as ``1`` by default). Pass False only for
|
|
374
|
+
a client that cannot, so the server does not refuse the turn.
|
|
368
375
|
|
|
369
376
|
Yields:
|
|
370
377
|
Parsed SSE events with structure:
|
|
@@ -395,6 +402,8 @@ class AssistantRuntimeClient(BaseAssistantRuntimeClient):
|
|
|
395
402
|
web_search=web_search,
|
|
396
403
|
thinking_enabled=thinking_enabled,
|
|
397
404
|
reasoning_effort=reasoning_effort,
|
|
405
|
+
confirm_low_balance=confirm_low_balance,
|
|
406
|
+
low_balance_preview=low_balance_preview,
|
|
398
407
|
)
|
|
399
408
|
url = self._build_endpoint_url("streaming.stream_chat")
|
|
400
409
|
payload = self._with_site_url(payload)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/exceptions.py
RENAMED
|
File without changes
|
{assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/skills.py
RENAMED
|
File without changes
|
{assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/streaming.py
RENAMED
|
File without changes
|
{assistant_runtime_sdk-1.12.1 → assistant_runtime_sdk-1.13.0}/assistant_runtime_sdk/types.py
RENAMED
|
File without changes
|