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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pi-sidecar-client
3
- Version: 0.1.0.dev2
3
+ Version: 0.1.0.dev3
4
4
  Summary: Python client for the Pi SDK sidecar service
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Repository, https://github.com/myk-org/pi-sidecar
@@ -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 = "/tmp",
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 "/tmp",
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pi-sidecar-client
3
- Version: 0.1.0.dev2
3
+ Version: 0.1.0.dev3
4
4
  Summary: Python client for the Pi SDK sidecar service
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Repository, https://github.com/myk-org/pi-sidecar
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pi-sidecar-client"
7
- version = "0.1.0.dev2"
7
+ version = "0.1.0.dev3"
8
8
  description = "Python client for the Pi SDK sidecar service"
9
9
  license = "Apache-2.0"
10
10
  requires-python = ">=3.10"