synth-ai 0.1.0.dev52__tar.gz → 0.1.1__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.
- {synth_ai-0.1.0.dev52/synth_ai.egg-info → synth_ai-0.1.1}/PKG-INFO +2 -2
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/pyproject.toml +2 -2
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/caching/handler.py +1 -1
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/structured_outputs/handler.py +1 -1
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/core/gemini_api.py +13 -3
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1/synth_ai.egg-info}/PKG-INFO +2 -2
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai.egg-info/requires.txt +1 -1
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/LICENSE +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/README.md +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/setup.cfg +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/setup.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/caching/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/caching/constants.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/caching/dbs.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/caching/ephemeral.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/caching/initialize.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/caching/persistent.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/config.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/constants.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/core/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/core/all.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/core/exceptions.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/core/main.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/core/vendor_clients.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/cost/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/cost/monitor.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/cost/statefulness.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/structured_outputs/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/structured_outputs/inject.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/structured_outputs/rehabilitate.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/tools/base.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/base.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/core/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/core/anthropic_api.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/core/mistral_api.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/core/openai_api.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/local/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/local/ollama.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/openai_standard.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/retries.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/supported/__init__.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/supported/deepseek.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/supported/groq.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/supported/ollama.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai/zyk/lms/vendors/supported/together.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai.egg-info/SOURCES.txt +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai.egg-info/dependency_links.txt +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/synth_ai.egg-info/top_level.txt +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/tests/test_agent.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/tests/test_recursive_structured_outputs.py +0 -0
- {synth_ai-0.1.0.dev52 → synth_ai-0.1.1}/tests/test_structured_outputs.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: synth-ai
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.1
|
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
|
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
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "synth-ai"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.1"
|
4
4
|
description = "Software for aiding the best and multiplying the will."
|
5
5
|
readme = "README.md"
|
6
6
|
authors = [{ name = "Josh Purtell", email = "josh@usesynth.ai" }]
|
@@ -22,7 +22,7 @@ dependencies = [
|
|
22
22
|
"google-generativeai",
|
23
23
|
"google-genai",
|
24
24
|
"together>=1.2.12",
|
25
|
-
"langfuse>=2.
|
25
|
+
"langfuse>=2.53.9,<3.0.0",
|
26
26
|
"datasets>=3.2.0",
|
27
27
|
"groq>=0.18.0",
|
28
28
|
"pytest-timeout>=2.3.1",
|
@@ -47,7 +47,7 @@ def map_params_to_key(
|
|
47
47
|
#logger.error(f"Tool schemas: {tool_schemas}")
|
48
48
|
normalized_tools = "".join(tool_schemas)
|
49
49
|
elif tools:
|
50
|
-
logger.error(f"Tools: {tools}")
|
50
|
+
#logger.error(f"Tools: {tools}")
|
51
51
|
normalized_tools = "".join([str(tool) for tool in tools])
|
52
52
|
|
53
53
|
key_str = ""
|
@@ -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 =
|
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
|
-
|
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
|
-
|
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.
|
3
|
+
Version: 0.1.1
|
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
|
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
|
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
|
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
|
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
|
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
|