simile 0.4.11__py3-none-any.whl → 0.4.12__py3-none-any.whl

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.

Potentially problematic release.


This version of simile might be problematic. Click here for more details.

simile/client.py CHANGED
@@ -1,5 +1,5 @@
1
1
  import httpx
2
- from httpx import AsyncClient
2
+ from httpx import AsyncClient, Limits
3
3
  from typing import List, Dict, Any, Optional, Union, Type, AsyncGenerator
4
4
  import uuid
5
5
  from pydantic import BaseModel
@@ -35,7 +35,7 @@ from .exceptions import (
35
35
  )
36
36
 
37
37
  DEFAULT_BASE_URL = "https://api.simile.ai/api/v1"
38
- TIMEOUT_CONFIG = httpx.Timeout(5.0, read=30.0, write=30.0, pool=30.0)
38
+ TIMEOUT_CONFIG = httpx.Timeout(5.0, read=60.0, write=30.0, pool=30.0)
39
39
 
40
40
 
41
41
  class Simile:
@@ -44,13 +44,26 @@ class Simile:
44
44
  NotFoundError = SimileNotFoundError
45
45
  BadRequestError = SimileBadRequestError
46
46
 
47
- def __init__(self, api_key: str, base_url: str = DEFAULT_BASE_URL):
47
+ def __init__(
48
+ self,
49
+ api_key: str,
50
+ base_url: str = DEFAULT_BASE_URL,
51
+ max_connections: int = 5000,
52
+ max_keepalive_connections: int = 2000,
53
+ keepalive_expiry: float = 300.0,
54
+ ):
48
55
  if not api_key:
49
56
  raise ValueError("API key is required.")
50
57
  self.api_key = api_key
51
58
  self.base_url = base_url.rstrip("/")
59
+
60
+ limits = Limits(
61
+ max_connections=max_connections,
62
+ max_keepalive_connections=max_keepalive_connections,
63
+ keepalive_expiry=keepalive_expiry,
64
+ )
52
65
  self._client = AsyncClient(
53
- headers={"X-API-Key": self.api_key}, timeout=TIMEOUT_CONFIG
66
+ headers={"X-API-Key": self.api_key}, timeout=TIMEOUT_CONFIG, limits=limits,
54
67
  )
55
68
 
56
69
  async def _request(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simile
3
- Version: 0.4.11
3
+ Version: 0.4.12
4
4
  Summary: Package for interfacing with Simile AI agents for simulation
5
5
  Author-email: Simile AI <cqz@simile.ai>
6
6
  License: MIT
@@ -1,11 +1,11 @@
1
1
  simile/__init__.py,sha256=JAYtieyGg6YYiCackJ6YNlGJkFWmhryzbwwVt4K67uI,1360
2
2
  simile/auth_client.py,sha256=ICImmaA5fZX9ADbIPIUh4RED3hBZvLf3XSiaqELDAME,7923
3
- simile/client.py,sha256=QOL0CeQeG1MtncngFrtFhjmRJMEVVZy8q2hBMvQTDRg,30238
3
+ simile/client.py,sha256=9nZo7y_umY52oxF-YszPlbDXEbSI5MfJu0Aq0jYy7CU,30635
4
4
  simile/exceptions.py,sha256=Q1lbfwR7mEn_LYmwjAnsMc8BW79JNPvmCmVoPibYisU,1502
5
5
  simile/models.py,sha256=qDA768d5DtuIXUgHJ8T2dgY3Ypy7IvDDUEumMzX3__Y,12536
6
6
  simile/resources.py,sha256=LSYZSzx1YO69xvShGxxLFVPjQHw1WukHXhdYc1EyuOs,10555
7
- simile-0.4.11.dist-info/licenses/LICENSE,sha256=tpxX3bpODfyOQVyEM6kCMvPHFCpkjFDj0AICRqKqOFA,1066
8
- simile-0.4.11.dist-info/METADATA,sha256=kYW3CNiFGii3W1SSafx8BZeMA_qcpZRF7y1X2027Ufw,1599
9
- simile-0.4.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
- simile-0.4.11.dist-info/top_level.txt,sha256=41lJneubAG4-ZOAs5qn7iDtDb-MDxa6DdvgBKwNX84M,7
11
- simile-0.4.11.dist-info/RECORD,,
7
+ simile-0.4.12.dist-info/licenses/LICENSE,sha256=tpxX3bpODfyOQVyEM6kCMvPHFCpkjFDj0AICRqKqOFA,1066
8
+ simile-0.4.12.dist-info/METADATA,sha256=fHtzZuJGxOk2W_ATBganwqcZZSr0EIKYIE8z5HDhQx8,1599
9
+ simile-0.4.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ simile-0.4.12.dist-info/top_level.txt,sha256=41lJneubAG4-ZOAs5qn7iDtDb-MDxa6DdvgBKwNX84M,7
11
+ simile-0.4.12.dist-info/RECORD,,