pi-sidecar-client 0.1.0.dev2__tar.gz → 0.1.0.dev3__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.
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/PKG-INFO +1 -1
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/pi_sidecar_client/__init__.py +7 -2
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/pi_sidecar_client.egg-info/PKG-INFO +1 -1
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/pyproject.toml +1 -1
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/LICENSE +0 -0
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/README.md +0 -0
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/pi_sidecar_client.egg-info/SOURCES.txt +0 -0
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/pi_sidecar_client.egg-info/dependency_links.txt +0 -0
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/pi_sidecar_client.egg-info/requires.txt +0 -0
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/pi_sidecar_client.egg-info/top_level.txt +0 -0
- {pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/setup.cfg +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import inspect
|
|
3
3
|
import os
|
|
4
|
+
import tempfile
|
|
4
5
|
from collections.abc import Callable
|
|
5
6
|
from dataclasses import dataclass
|
|
6
7
|
from typing import Any
|
|
@@ -11,6 +12,7 @@ from simple_logger.logger import get_logger
|
|
|
11
12
|
logger = get_logger(name=__name__, level=os.environ.get("LOG_LEVEL", "INFO"))
|
|
12
13
|
|
|
13
14
|
SIDECAR_URL = os.environ.get("SIDECAR_URL", "http://127.0.0.1:9100")
|
|
15
|
+
DEFAULT_CWD = tempfile.gettempdir()
|
|
14
16
|
|
|
15
17
|
__all__ = [
|
|
16
18
|
"AIResult",
|
|
@@ -140,7 +142,7 @@ class SidecarClient:
|
|
|
140
142
|
provider: str,
|
|
141
143
|
model: str,
|
|
142
144
|
system_prompt: str,
|
|
143
|
-
cwd: str =
|
|
145
|
+
cwd: str = DEFAULT_CWD,
|
|
144
146
|
custom_tools: list | None = None,
|
|
145
147
|
) -> str:
|
|
146
148
|
"""Create a new AI session. Returns session_id."""
|
|
@@ -250,7 +252,7 @@ async def call_ai(
|
|
|
250
252
|
provider=ai_provider,
|
|
251
253
|
model=ai_model,
|
|
252
254
|
system_prompt=system_prompt or "You are a helpful assistant.",
|
|
253
|
-
cwd=cwd or
|
|
255
|
+
cwd=cwd or DEFAULT_CWD,
|
|
254
256
|
custom_tools=custom_tools,
|
|
255
257
|
)
|
|
256
258
|
created_session = True
|
|
@@ -343,6 +345,9 @@ async def run_parallel_with_limit(
|
|
|
343
345
|
max_concurrency: int = 5,
|
|
344
346
|
) -> list:
|
|
345
347
|
"""Run async tasks in parallel with concurrency limit."""
|
|
348
|
+
if max_concurrency < 1:
|
|
349
|
+
raise ValueError("max_concurrency must be >= 1")
|
|
350
|
+
|
|
346
351
|
semaphore = asyncio.Semaphore(max_concurrency)
|
|
347
352
|
|
|
348
353
|
async def limited(coro):
|
|
File without changes
|
|
File without changes
|
{pi_sidecar_client-0.1.0.dev2 → pi_sidecar_client-0.1.0.dev3}/pi_sidecar_client.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|