applied-cli 0.5.6__tar.gz → 0.5.7__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.
- {applied_cli-0.5.6 → applied_cli-0.5.7}/PKG-INFO +1 -1
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli/client.py +26 -25
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli.egg-info/PKG-INFO +1 -1
- {applied_cli-0.5.6 → applied_cli-0.5.7}/pyproject.toml +1 -1
- {applied_cli-0.5.6 → applied_cli-0.5.7}/README.md +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli/__init__.py +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli/cli.py +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli/credentials.py +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli/formatters.py +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli/tools.py +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli.egg-info/SOURCES.txt +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli.egg-info/dependency_links.txt +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli.egg-info/entry_points.txt +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli.egg-info/requires.txt +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/applied_cli.egg-info/top_level.txt +0 -0
- {applied_cli-0.5.6 → applied_cli-0.5.7}/setup.cfg +0 -0
|
@@ -431,6 +431,7 @@ class AppliedClient:
|
|
|
431
431
|
headers["X-Shop-Id"] = self.shop_id
|
|
432
432
|
|
|
433
433
|
body: dict[str, Any] = {
|
|
434
|
+
"input": message,
|
|
434
435
|
"transcript": [
|
|
435
436
|
{
|
|
436
437
|
"role": "user",
|
|
@@ -460,38 +461,38 @@ class AppliedClient:
|
|
|
460
461
|
response_text = ""
|
|
461
462
|
result_conversation_id = conversation_id
|
|
462
463
|
|
|
463
|
-
async with
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
464
|
+
async with (
|
|
465
|
+
httpx.AsyncClient(timeout=120.0) as client,
|
|
466
|
+
client.stream("POST", url, headers=headers, json=body) as response,
|
|
467
|
+
):
|
|
468
|
+
response.raise_for_status()
|
|
468
469
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
async for line in response.aiter_lines():
|
|
471
|
+
if not line:
|
|
472
|
+
continue
|
|
472
473
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
474
|
+
# Parse SSE format: "data: {...}"
|
|
475
|
+
if line.startswith("data: "):
|
|
476
|
+
data_str = line[6:] # Remove "data: " prefix
|
|
477
|
+
if data_str == "[DONE]":
|
|
478
|
+
break
|
|
478
479
|
|
|
479
|
-
|
|
480
|
-
|
|
480
|
+
try:
|
|
481
|
+
import json
|
|
481
482
|
|
|
482
|
-
|
|
483
|
+
data = json.loads(data_str)
|
|
483
484
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
485
|
+
# Extract conversation_id from first chunk
|
|
486
|
+
if not result_conversation_id:
|
|
487
|
+
result_conversation_id = data.get("conversation_id")
|
|
487
488
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
# Accumulate response content
|
|
490
|
+
if "content" in data:
|
|
491
|
+
response_text += data["content"]
|
|
491
492
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
493
|
+
except (json.JSONDecodeError, KeyError):
|
|
494
|
+
# Skip malformed chunks
|
|
495
|
+
pass
|
|
495
496
|
|
|
496
497
|
return {
|
|
497
498
|
"conversation_id": result_conversation_id,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|