synth-ai 0.1.0.dev53__py3-none-any.whl → 0.1.2__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.
@@ -44,6 +44,9 @@ groq_naming_regexes: List[Pattern] = [
44
44
  re.compile(r"^llama-3.2-3b-preview$"),
45
45
  re.compile(r"^llama-3.2-11b-vision-preview$"),
46
46
  re.compile(r"^llama-3.2-90b-vision-preview$"),
47
+ re.compile(r"^meta-llama/llama-4-scout-17b-16e-instruct$"),
48
+ re.compile(r"^meta-llama/llama-4-maverick-17b-128e-instruct$"),
49
+ re.compile(r"^qwen/qwen3-32b$"),
47
50
  ]
48
51
 
49
52
  mistral_naming_regexes: List[Pattern] = [
@@ -174,7 +174,7 @@ class StringifiedJSONHandler(StructuredHandlerBase):
174
174
  type(raw_text_response_or_cached_hit) in [str, BaseLMResponse]
175
175
  ), f"Expected str or BaseLMResponse, got {type(raw_text_response_or_cached_hit)}"
176
176
  if type(raw_text_response_or_cached_hit) == BaseLMResponse:
177
- print("Got cached hit, returning directly")
177
+ #print("Got cached hit, returning directly")
178
178
  raw_text_response = raw_text_response_or_cached_hit.raw_response
179
179
  else:
180
180
  raw_text_response = raw_text_response_or_cached_hit
@@ -24,7 +24,7 @@ ALIASES = {
24
24
  }
25
25
 
26
26
  logger = logging.getLogger(__name__)
27
- _CLIENT = genai.Client() # one client for everything
27
+ _CLIENT = None # Initialize lazily when needed
28
28
  GEMINI_EXCEPTIONS_TO_RETRY: Tuple[Type[Exception], ...] = (ResourceExhausted,)
29
29
  logging.getLogger("google.genai").setLevel(logging.ERROR)
30
30
  os.environ["GRPC_VERBOSITY"] = "ERROR"
@@ -39,6 +39,14 @@ SAFETY_SETTINGS = {
39
39
  }
40
40
 
41
41
 
42
+ def _get_client():
43
+ """Get or create the Gemini client lazily."""
44
+ global _CLIENT
45
+ if _CLIENT is None:
46
+ _CLIENT = genai.Client()
47
+ return _CLIENT
48
+
49
+
42
50
  class GeminiAPI(VendorBase):
43
51
  used_for_structured_outputs: bool = True
44
52
  exceptions_to_retry: Tuple[Type[Exception], ...] = GEMINI_EXCEPTIONS_TO_RETRY
@@ -119,7 +127,8 @@ class GeminiAPI(VendorBase):
119
127
  tool_config=lm_config.get("tool_config") if lm_config else None,
120
128
  tools=self._tools_to_genai(tools) if tools else None
121
129
  )
122
- resp = await _CLIENT.aio.models.generate_content(
130
+ client = _get_client()
131
+ resp = await client.aio.models.generate_content(
123
132
  model=model_name,
124
133
  contents=self._msg_to_contents(messages),
125
134
  config=generation_config,
@@ -150,7 +159,8 @@ class GeminiAPI(VendorBase):
150
159
  tools=self._tools_to_genai(tools) if tools else None
151
160
  )
152
161
 
153
- resp = _CLIENT.models.generate_content(
162
+ client = _get_client()
163
+ resp = client.models.generate_content(
154
164
  model=model_name,
155
165
  contents=self._msg_to_contents(messages),
156
166
  safety_settings=SAFETY_SETTINGS,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synth-ai
3
- Version: 0.1.0.dev53
3
+ Version: 0.1.2
4
4
  Summary: Software for aiding the best and multiplying the will.
5
5
  Home-page: https://github.com/synth-laboratories/synth-ai
6
6
  Author: Josh Purtell
@@ -45,7 +45,7 @@ Requires-Dist: google-api-core
45
45
  Requires-Dist: google-generativeai
46
46
  Requires-Dist: google-genai
47
47
  Requires-Dist: together>=1.2.12
48
- Requires-Dist: langfuse>=2.56.1
48
+ Requires-Dist: langfuse<3.0.0,>=2.53.9
49
49
  Requires-Dist: datasets>=3.2.0
50
50
  Requires-Dist: groq>=0.18.0
51
51
  Requires-Dist: pytest-timeout>=2.3.1
@@ -14,12 +14,12 @@ synth_ai/zyk/lms/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
14
14
  synth_ai/zyk/lms/core/all.py,sha256=wakK0HhvYRuaQZmxClURyNf3vUkTbm3OABw3TgpMjOQ,1185
15
15
  synth_ai/zyk/lms/core/exceptions.py,sha256=K0BVdAzxVIchsvYZAaHEH1GAWBZvpxhFi-SPcJOjyPQ,205
16
16
  synth_ai/zyk/lms/core/main.py,sha256=pLz7COTdvDWQivYaA1iYYF2onUOosD_sFaPJG48bdKM,10598
17
- synth_ai/zyk/lms/core/vendor_clients.py,sha256=1h428pLiP6VeHvLOYRCtxfmuwJceYp30jPF5Fr48JtI,2783
17
+ synth_ai/zyk/lms/core/vendor_clients.py,sha256=2uOF8npvY8epCovL3HRRpDaHTtmj4QhwWAIYl9q5Cg4,2952
18
18
  synth_ai/zyk/lms/cost/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  synth_ai/zyk/lms/cost/monitor.py,sha256=cSKIvw6WdPZIRubADWxQoh1MdB40T8-jjgfNUeUHIn0,5
20
20
  synth_ai/zyk/lms/cost/statefulness.py,sha256=TOsuXL8IjtKOYJ2aJQF8TwJVqn_wQ7AIwJJmdhMye7U,36
21
21
  synth_ai/zyk/lms/structured_outputs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- synth_ai/zyk/lms/structured_outputs/handler.py,sha256=TKN38zHFdVnAJoYqUgaXuUzTVFj9XBBJHx45whGjVeE,16918
22
+ synth_ai/zyk/lms/structured_outputs/handler.py,sha256=4DboLNZyXpqNB5YNCSgGHBsNbWqFk-8uwV944nOYNo8,16919
23
23
  synth_ai/zyk/lms/structured_outputs/inject.py,sha256=Fy-zDeleRxOZ8ZRM6IuZ6CP2XZnMe4K2PEn4Q9c_KPY,11777
24
24
  synth_ai/zyk/lms/structured_outputs/rehabilitate.py,sha256=ecKGWrgWYUSplqHzK40KdohwaN8gBV0xl4LUReLN_vg,7910
25
25
  synth_ai/zyk/lms/tools/base.py,sha256=i-AIVRlitiQ4JMJ_BBFRSpUcWgxWIUYoHxAqfxHN_7E,4056
@@ -29,7 +29,7 @@ synth_ai/zyk/lms/vendors/openai_standard.py,sha256=dgHC7RWrxwaWto6_frKdfEKazKvvA
29
29
  synth_ai/zyk/lms/vendors/retries.py,sha256=m-WvAiPix9ovnO2S-m53Td5VZDWBVBFuHuSK9--OVxw,38
30
30
  synth_ai/zyk/lms/vendors/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  synth_ai/zyk/lms/vendors/core/anthropic_api.py,sha256=AdlKHK4jiOxb3QxS7my7EfmGCuugPljvGNN3JBkiDfQ,13689
32
- synth_ai/zyk/lms/vendors/core/gemini_api.py,sha256=LER31s5iQCrsHdi_Y8GFK5XBini-xwcsXt3xLUyCsJg,10947
32
+ synth_ai/zyk/lms/vendors/core/gemini_api.py,sha256=f7MBvrwNr-vsFgKfV3iL-8DmTWOW9kV2ZuiXfucXuXA,11167
33
33
  synth_ai/zyk/lms/vendors/core/mistral_api.py,sha256=eoEaxiMuKQEY0K4rGHA2_ZG6sBnzEm-8hBWO_JqW96M,12080
34
34
  synth_ai/zyk/lms/vendors/core/openai_api.py,sha256=O5KbRpy0pDDofVjxgZdeU69ueUl6S1DAuKykcH3gThg,6784
35
35
  synth_ai/zyk/lms/vendors/local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -39,8 +39,8 @@ synth_ai/zyk/lms/vendors/supported/deepseek.py,sha256=BElW0NGpkSA62wOqzzMtDw8XR3
39
39
  synth_ai/zyk/lms/vendors/supported/groq.py,sha256=Fbi7QvhdLx0F-VHO5PY-uIQlPR0bo3C9h1MvIOx8nz0,388
40
40
  synth_ai/zyk/lms/vendors/supported/ollama.py,sha256=K30VBFRTd7NYyPmyBVRZS2sm0UB651AHp9i3wd55W64,469
41
41
  synth_ai/zyk/lms/vendors/supported/together.py,sha256=Ni_jBqqGPN0PkkY-Ew64s3gNKk51k3FCpLSwlNhKbf0,342
42
- synth_ai-0.1.0.dev53.dist-info/licenses/LICENSE,sha256=ynhjRQUfqA_RdGRATApfFA_fBAy9cno04sLtLUqxVFM,1069
43
- synth_ai-0.1.0.dev53.dist-info/METADATA,sha256=ksQWs4SyK37RTDtnfSphikNIvSl9CsCpROO-S0liDzM,2759
44
- synth_ai-0.1.0.dev53.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
45
- synth_ai-0.1.0.dev53.dist-info/top_level.txt,sha256=fBmtZyVHuKaGa29oHBaaUkrUIWTqSpoVMPiVdCDP3k8,9
46
- synth_ai-0.1.0.dev53.dist-info/RECORD,,
42
+ synth_ai-0.1.2.dist-info/licenses/LICENSE,sha256=ynhjRQUfqA_RdGRATApfFA_fBAy9cno04sLtLUqxVFM,1069
43
+ synth_ai-0.1.2.dist-info/METADATA,sha256=lpUYgIXMnNL3if9t7GzC6-N40nroLhEJIxDJQThPwWU,2760
44
+ synth_ai-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
+ synth_ai-0.1.2.dist-info/top_level.txt,sha256=fBmtZyVHuKaGa29oHBaaUkrUIWTqSpoVMPiVdCDP3k8,9
46
+ synth_ai-0.1.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5