synth-ai 0.1.4__tar.gz → 0.1.6__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.
Files changed (57) hide show
  1. {synth_ai-0.1.4 → synth_ai-0.1.6}/PKG-INFO +1 -1
  2. {synth_ai-0.1.4 → synth_ai-0.1.6}/setup.py +1 -1
  3. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/__init__.py +1 -1
  4. synth_ai-0.1.6/synth_ai/zyk/lms/tools/__init__.py +3 -0
  5. synth_ai-0.1.6/synth_ai/zyk/lms/tools/base.py +118 -0
  6. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai.egg-info/PKG-INFO +1 -1
  7. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai.egg-info/SOURCES.txt +2 -0
  8. {synth_ai-0.1.4 → synth_ai-0.1.6}/LICENSE +0 -0
  9. {synth_ai-0.1.4 → synth_ai-0.1.6}/README.md +0 -0
  10. {synth_ai-0.1.4 → synth_ai-0.1.6}/setup.cfg +0 -0
  11. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/__init__.py +0 -0
  12. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/__init__.py +0 -0
  13. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/caching/__init__.py +0 -0
  14. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/caching/constants.py +0 -0
  15. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/caching/dbs.py +0 -0
  16. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/caching/ephemeral.py +0 -0
  17. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/caching/handler.py +0 -0
  18. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/caching/initialize.py +0 -0
  19. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/caching/persistent.py +0 -0
  20. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/config.py +0 -0
  21. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/constants.py +0 -0
  22. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/core/__init__.py +0 -0
  23. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/core/all.py +0 -0
  24. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/core/exceptions.py +0 -0
  25. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/core/main.py +0 -0
  26. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/core/vendor_clients.py +0 -0
  27. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/cost/__init__.py +0 -0
  28. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/cost/monitor.py +0 -0
  29. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/cost/statefulness.py +0 -0
  30. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/structured_outputs/__init__.py +0 -0
  31. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/structured_outputs/handler.py +0 -0
  32. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/structured_outputs/inject.py +0 -0
  33. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/structured_outputs/rehabilitate.py +0 -0
  34. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/__init__.py +0 -0
  35. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/base.py +0 -0
  36. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/core/__init__.py +0 -0
  37. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/core/anthropic_api.py +0 -0
  38. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/core/gemini_api.py +0 -0
  39. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/core/mistral_api.py +0 -0
  40. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/core/openai_api.py +0 -0
  41. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/local/__init__.py +0 -0
  42. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/local/ollama.py +0 -0
  43. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/openai_standard.py +0 -0
  44. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/retries.py +0 -0
  45. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/supported/__init__.py +0 -0
  46. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/supported/custom_endpoint.py +0 -0
  47. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/supported/deepseek.py +0 -0
  48. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/supported/groq.py +0 -0
  49. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/supported/ollama.py +0 -0
  50. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai/zyk/lms/vendors/supported/together.py +0 -0
  51. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai.egg-info/dependency_links.txt +0 -0
  52. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai.egg-info/requires.txt +0 -0
  53. {synth_ai-0.1.4 → synth_ai-0.1.6}/synth_ai.egg-info/top_level.txt +0 -0
  54. {synth_ai-0.1.4 → synth_ai-0.1.6}/tests/test_agent.py +0 -0
  55. {synth_ai-0.1.4 → synth_ai-0.1.6}/tests/test_modal_qwen_hello.py +0 -0
  56. {synth_ai-0.1.4 → synth_ai-0.1.6}/tests/test_recursive_structured_outputs.py +0 -0
  57. {synth_ai-0.1.4 → synth_ai-0.1.6}/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.4
3
+ Version: 0.1.6
4
4
  Home-page: https://github.com/synth-laboratories/synth-ai
5
5
  Author: Josh Purtell
6
6
  Author-email: josh@usesynth.com
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
2
2
 
3
3
  setup(
4
4
  name="synth-ai",
5
- version="0.1.4",
5
+ version="0.1.6",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "openai",
@@ -4,5 +4,5 @@ Synth AI - Software for aiding the best and multiplying the will.
4
4
 
5
5
  from synth_ai.zyk import LM # Assuming LM is in zyk.py in the same directory
6
6
 
7
- __version__ = "0.1.4"
7
+ __version__ = "0.1.6"
8
8
  __all__ = ["LM"] # Explicitly define public API
@@ -0,0 +1,3 @@
1
+ from .base import BaseTool
2
+
3
+ __all__ = ["BaseTool"]
@@ -0,0 +1,118 @@
1
+ from typing import Type
2
+
3
+ from pydantic import BaseModel
4
+
5
+
6
+ class BaseTool(BaseModel):
7
+ name: str
8
+ arguments: Type[BaseModel]
9
+ description: str = ""
10
+ strict: bool = True
11
+
12
+ def to_openai_tool(self):
13
+ schema = self.arguments.model_json_schema()
14
+ schema["additionalProperties"] = False
15
+
16
+ if "properties" in schema:
17
+ for prop_name, prop_schema in schema["properties"].items():
18
+ if prop_schema.get("type") == "array":
19
+ items_schema = prop_schema.get("items", {})
20
+ if not isinstance(items_schema, dict) or not items_schema.get("type"):
21
+ prop_schema["items"] = {"type": "string"}
22
+
23
+ elif "anyOf" in prop_schema:
24
+ for sub_schema in prop_schema["anyOf"]:
25
+ if isinstance(sub_schema, dict) and sub_schema.get("type") == "array":
26
+ items_schema = sub_schema.get("items", {})
27
+ if not isinstance(items_schema, dict) or not items_schema.get("type"):
28
+ sub_schema["items"] = {"type": "string"}
29
+
30
+ return {
31
+ "type": "function",
32
+ "function": {
33
+ "name": self.name,
34
+ "description": self.description,
35
+ "parameters": schema,
36
+ "strict": self.strict,
37
+ },
38
+ }
39
+
40
+ def to_anthropic_tool(self):
41
+ schema = self.arguments.model_json_schema()
42
+ schema["additionalProperties"] = False
43
+
44
+ return {
45
+ "name": self.name,
46
+ "description": self.description,
47
+ "input_schema": {
48
+ "type": "object",
49
+ "properties": schema["properties"],
50
+ "required": schema.get("required", []),
51
+ },
52
+ }
53
+
54
+ def to_mistral_tool(self):
55
+ schema = self.arguments.model_json_schema()
56
+ properties = {}
57
+ for prop_name, prop in schema.get("properties", {}).items():
58
+ prop_type = prop["type"]
59
+ if prop_type == "array" and "items" in prop:
60
+ properties[prop_name] = {
61
+ "type": "array",
62
+ "items": prop["items"],
63
+ "description": prop.get("description", ""),
64
+ }
65
+ continue
66
+
67
+ properties[prop_name] = {
68
+ "type": prop_type,
69
+ "description": prop.get("description", ""),
70
+ }
71
+ if "enum" in prop:
72
+ properties[prop_name]["enum"] = prop["enum"]
73
+
74
+ parameters = {
75
+ "type": "object",
76
+ "properties": properties,
77
+ "required": schema.get("required", []),
78
+ "additionalProperties": False,
79
+ }
80
+ return {
81
+ "type": "function",
82
+ "function": {
83
+ "name": self.name,
84
+ "description": self.description,
85
+ "parameters": parameters,
86
+ },
87
+ }
88
+
89
+ def to_gemini_tool(self):
90
+ schema = self.arguments.model_json_schema()
91
+ # Convert Pydantic schema types to Gemini schema types
92
+ properties = {}
93
+ for name, prop in schema["properties"].items():
94
+ prop_type = prop.get("type", "string")
95
+ if prop_type == "array" and "items" in prop:
96
+ properties[name] = {
97
+ "type": "array",
98
+ "items": prop["items"],
99
+ "description": prop.get("description", ""),
100
+ }
101
+ continue
102
+
103
+ properties[name] = {
104
+ "type": prop_type,
105
+ "description": prop.get("description", ""),
106
+ }
107
+ if "enum" in prop:
108
+ properties[name]["enum"] = prop["enum"]
109
+
110
+ return {
111
+ "name": self.name,
112
+ "description": self.description,
113
+ "parameters": {
114
+ "type": "object",
115
+ "properties": properties,
116
+ "required": schema.get("required", []),
117
+ },
118
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synth-ai
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Home-page: https://github.com/synth-laboratories/synth-ai
5
5
  Author: Josh Purtell
6
6
  Author-email: josh@usesynth.com
@@ -30,6 +30,8 @@ synth_ai/zyk/lms/structured_outputs/__init__.py
30
30
  synth_ai/zyk/lms/structured_outputs/handler.py
31
31
  synth_ai/zyk/lms/structured_outputs/inject.py
32
32
  synth_ai/zyk/lms/structured_outputs/rehabilitate.py
33
+ synth_ai/zyk/lms/tools/__init__.py
34
+ synth_ai/zyk/lms/tools/base.py
33
35
  synth_ai/zyk/lms/vendors/__init__.py
34
36
  synth_ai/zyk/lms/vendors/base.py
35
37
  synth_ai/zyk/lms/vendors/openai_standard.py
File without changes
File without changes
File without changes
File without changes