ailoy-py 0.0.3__cp313-cp313-win_amd64.whl → 0.0.5__cp313-cp313-win_amd64.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 ailoy-py might be problematic. Click here for more details.

ailoy/__init__.py CHANGED
@@ -1,12 +1,12 @@
1
1
  """""" # start delvewheel patch
2
- def _delvewheel_patch_1_10_1():
2
+ def _delvewheel_patch_1_11_0():
3
3
  import os
4
4
  if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'ailoy_py.libs'))):
5
5
  os.add_dll_directory(libs_dir)
6
6
 
7
7
 
8
- _delvewheel_patch_1_10_1()
9
- del _delvewheel_patch_1_10_1
8
+ _delvewheel_patch_1_11_0()
9
+ del _delvewheel_patch_1_11_0
10
10
  # end delvewheel patch
11
11
 
12
12
  if __doc__ is None:
ailoy/agent.py CHANGED
@@ -216,8 +216,11 @@ class ToolParameters(BaseModel):
216
216
  required: Optional[list[str]] = []
217
217
 
218
218
 
219
+ JsonSchemaTypes = Literal["string", "integer", "number", "boolean", "object", "array", "null"]
220
+
221
+
219
222
  class ToolParametersProperty(BaseModel):
220
- type: Literal["string", "number", "boolean", "object", "array", "null"]
223
+ type: JsonSchemaTypes | list[JsonSchemaTypes]
221
224
  description: Optional[str] = None
222
225
  model_config = ConfigDict(extra="allow")
223
226
 
@@ -506,7 +509,9 @@ class Agent:
506
509
  raise RuntimeError("Tool not found")
507
510
  tool_result = tool_.call(**tool_call.function.arguments)
508
511
  return ToolMessage(
509
- content=[TextContent(text=json.dumps(tool_result))],
512
+ content=[
513
+ TextContent(text=tool_result if isinstance(tool_result, str) else json.dumps(tool_result))
514
+ ],
510
515
  tool_call_id=tool_call.id,
511
516
  )
512
517
 
Binary file
ailoy/models/api_model.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import Literal, Optional, Self, get_args
1
+ from typing import Literal, Optional, get_args
2
2
 
3
3
  from pydantic import model_validator
4
4
  from pydantic.dataclasses import dataclass
@@ -34,7 +34,20 @@ ClaudeModelId = Literal[
34
34
  "claude-3-haiku-20240307",
35
35
  ]
36
36
 
37
- APIModelProvider = Literal["openai", "gemini", "claude"]
37
+ GrokModelId = Literal[
38
+ "grok-4",
39
+ "grok-4-0709",
40
+ "grok-3",
41
+ "grok-3-fast",
42
+ "grok-3-mini",
43
+ "grok-3-mini-fast",
44
+ "grok-2",
45
+ "grok-2-1212",
46
+ "grok-2-vision-1212",
47
+ "grok-2-image-1212",
48
+ ]
49
+
50
+ APIModelProvider = Literal["openai", "gemini", "claude", "grok"]
38
51
 
39
52
 
40
53
  @dataclass
@@ -44,7 +57,7 @@ class APIModel:
44
57
  provider: Optional[APIModelProvider] = None
45
58
 
46
59
  @model_validator(mode="after")
47
- def validate_provider(self) -> Self:
60
+ def validate_provider(self):
48
61
  if self.provider is None:
49
62
  if self.id in get_args(OpenAIModelId):
50
63
  self.provider = "openai"
@@ -52,6 +65,8 @@ class APIModel:
52
65
  self.provider = "gemini"
53
66
  elif self.id in get_args(ClaudeModelId):
54
67
  self.provider = "claude"
68
+ elif self.id in get_args(GrokModelId):
69
+ self.provider = "grok"
55
70
  else:
56
71
  raise ValueError(
57
72
  f'Failed to infer the model provider based on the model id "{self.id}". '
ailoy/tools.py CHANGED
@@ -5,6 +5,7 @@ import types
5
5
  from typing import (
6
6
  Any,
7
7
  Callable,
8
+ Literal,
8
9
  Optional,
9
10
  Union,
10
11
  get_args,
@@ -41,7 +42,7 @@ class DocstringParsingException(Exception):
41
42
  pass
42
43
 
43
44
 
44
- def _get_json_schema_type(param_type: str) -> dict[str, str]:
45
+ def _get_json_schema_type(param_type: type) -> dict[str, str]:
45
46
  type_mapping = {
46
47
  int: {"type": "integer"},
47
48
  float: {"type": "number"},
@@ -85,6 +86,20 @@ def _parse_type_hint(hint: str) -> dict:
85
86
  return_dict["nullable"] = True
86
87
  return return_dict
87
88
 
89
+ elif origin is Literal and len(args) > 0:
90
+ LITERAL_TYPES = (int, float, str, bool, type(None))
91
+ args_types = []
92
+ for arg in args:
93
+ if type(arg) not in LITERAL_TYPES:
94
+ raise TypeHintParsingException("Only the valid python literals can be listed in typing.Literal.")
95
+ arg_type = _get_json_schema_type(type(arg)).get("type")
96
+ if arg_type is not None and arg_type not in args_types:
97
+ args_types.append(arg_type)
98
+ return {
99
+ "type": args_types.pop() if len(args_types) == 1 else list(args_types),
100
+ "enum": list(args),
101
+ }
102
+
88
103
  elif origin is list:
89
104
  if not args:
90
105
  return {"type": "array"}
@@ -100,13 +115,13 @@ def _parse_type_hint(hint: str) -> dict:
100
115
  f"The type hint {str(hint).replace('typing.', '')} is a Tuple with a single element, which "
101
116
  "we do not automatically convert to JSON schema as it is rarely necessary. If this input can contain "
102
117
  "more than one element, we recommend "
103
- "using a List[] type instead, or if it really is a single element, remove the Tuple[] wrapper and just "
118
+ "using a list[] type instead, or if it really is a single element, remove the tuple[] wrapper and just "
104
119
  "pass the element directly."
105
120
  )
106
121
  if ... in args:
107
122
  raise TypeHintParsingException(
108
123
  "Conversion of '...' is not supported in Tuple type hints. "
109
- "Use List[] types for variable-length"
124
+ "Use list[] types for variable-length"
110
125
  " inputs instead."
111
126
  )
112
127
  return {"type": "array", "prefixItems": [_parse_type_hint(t) for t in args]}
@@ -0,0 +1,2 @@
1
+ Version: 1.11.0
2
+ Arguments: ['C:\\Program Files\\Python313\\Lib\\site-packages\\delvewheel\\__main__.py', 'repair', '-w', 'wheelhouse', 'C:\\workspace\\bindings\\python\\dist\\ailoy_py-0.0.5-cp313-cp313-win_amd64.whl', '--add-path', 'C:\\workspace\\bindings\\python\\build\\_deps\\tvm-build\\Release', '--exclude', 'vulkan-1.dll']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ailoy-py
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: Python binding for Ailoy runtime APIs
5
5
  Author-Email: "Brekkylab Inc." <contact@brekkylab.com>
6
6
  License-Expression: Apache-2.0
@@ -1,14 +1,14 @@
1
- ailoy/agent.py,sha256=HowE3cc1nxuoi41SiX6tyAZudlJ2I_pdnOs3SFHebJw,27549
2
- ailoy/ailoy_py.cp313-win_amd64.pyd,sha256=YGESQzWy--RT4ElV7ntbsyuXIfXbQk7TiVEfUA8_Xfg,11655168
1
+ ailoy/agent.py,sha256=SqpnpywdXg28UjtBHcU0k446s1DxW-g6jWCNEHQxGAk,27728
2
+ ailoy/ailoy_py.cp313-win_amd64.pyd,sha256=DrKTkNIMNIFyKev9vmlj2ttPtakDRjRfWb-RsJIdENg,12851200
3
3
  ailoy/ailoy_py.pyi,sha256=wr_-KGTI-O9usNdzTyszn4mAjnjiV2cJf0aBct2PKrU,1020
4
4
  ailoy/mcp.py,sha256=mwxfEZj7Je2PJTwwM9zVQ44AurrA5xY5TWVsAUkk9T8,6971
5
5
  ailoy/runtime.py,sha256=Bic6acq6NVuZchyuB51lm-58Xe_blRJbIE3gF9Xk22w,10833
6
- ailoy/tools.py,sha256=5Q7Q59ozeKWXwH5q9WY_9nuI3ALMAorKPgX6LNPWaJg,8412
6
+ ailoy/tools.py,sha256=OQZHMGOWovx0uWlYeWN2BoPG_G5rMW5HXCP3yTvtLDk,9081
7
7
  ailoy/vector_store.py,sha256=507HG-3W_glmZsKDUcFygdaPg3d7xyHbAFczE3diGwo,7723
8
- ailoy/__init__.py,sha256=BXhdYLP-Ja7E2JQACEDkaPhEapgjF4fF02Cr7IPSRzI,1135
8
+ ailoy/__init__.py,sha256=gR2i8fAFUqreAxQmdJ38Fw7QF6SVtlXLhGbRBL-ve_Q,1135
9
9
  ailoy/cli/model.py,sha256=t1-uO5vRDUomxIDpuMduPVCOKBR9VHMXqMcz38m_-YI,3091
10
10
  ailoy/cli/__main__.py,sha256=JUWtde3gYqKxuCtihgr5g2MAQgj151wv41OOZv2uHsQ,190
11
- ailoy/models/api_model.py,sha256=Bkj60H1_AMGltRjBpFGlwxk-FTuf1FeAUWQ1aucuyKE,1858
11
+ ailoy/models/api_model.py,sha256=q99HKACIutjkBPyVRFbdsrFoD8DYI9bayLM0ZBcwupM,2176
12
12
  ailoy/models/local_model.py,sha256=Z7TwScM2V1U99ErqgO2YVcSOc85wEmIie8xTXP7wMBA,1250
13
13
  ailoy/models/__init__.py,sha256=AfJlZYoacXf9de0LOttkFNirwS8XFaZcHUg7dA7xQsw,124
14
14
  ailoy/presets/tools/calculator.json,sha256=8G5t1PGyM7ZmX97WNfrF-H-x7LR8s_O15ppY_APFnVo,1064
@@ -17,11 +17,11 @@ ailoy/presets/tools/nytimes.json,sha256=diio4FSJGHvumX05MQ0RgrqZzggpjyX8ekBPZ4NC
17
17
  ailoy/presets/tools/tmdb.json,sha256=o9dg9bdfFhvgrhVGw5hP3V0EgGvBzm5ZrTtxrb1PerM,7231
18
18
  ailoy/utils/image.py,sha256=hMNrwexs_8Dz0QK2CUI8Kyw3_X3v4mWxtskg9SLBLCg,299
19
19
  ailoy/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- ailoy_py-0.0.3.dist-info/DELVEWHEEL,sha256=wMXrH9ZNTXTOYvDVyN-OLkDy5CQ5zHlVP1OH4Z8pgEQ,339
21
- ailoy_py-0.0.3.dist-info/entry_points.txt,sha256=gVG45uDE6kef0wm6SEMYSgZgRNNRhSAeP2n2lPR00dI,50
22
- ailoy_py-0.0.3.dist-info/METADATA,sha256=ZvX6pFs2Fb3uBmm_73Cq3rtYs52pfjd5_cEVZSluK68,2053
23
- ailoy_py-0.0.3.dist-info/RECORD,,
24
- ailoy_py-0.0.3.dist-info/WHEEL,sha256=_PdgJ-W7uMAsWwnGnEdiicDU_PKcobRdffEM23gmN6g,106
25
- ailoy_py.libs/msvcp140-0c97ddc05c5b9024aa6af9538804ea77.dll,sha256=0JEULNWjSOvIT9uiwpZrJ2N5awL-smgUd5rFf3QSK6g,557696
26
- ailoy_py.libs/tvm_runtime-ebd136148ad4b472eba26f3ddd5cba0e.dll,sha256=XXXiaRtmm09F1kebr1Oa4knSyR_8-gy3gUWhScxkt84,2531840
27
- ailoy_py.libs/vcomp140-f99ecd9a7e9d3df487b10cf7a201d515.dll,sha256=42pcXjKbx6811PqmEKKa7ugmp4EOBnEvD1Tpss_mpyg,192112
20
+ ailoy_py-0.0.5.dist-info/DELVEWHEEL,sha256=tzg8LeWmovsBMqrD2Eai_LwA4HiaPc_ezuFFu4Q4-vE,330
21
+ ailoy_py-0.0.5.dist-info/entry_points.txt,sha256=gVG45uDE6kef0wm6SEMYSgZgRNNRhSAeP2n2lPR00dI,50
22
+ ailoy_py-0.0.5.dist-info/METADATA,sha256=WpOovIib4t4AWYNmIBRRixucdz9-wBetyxyDaLjzOk4,2053
23
+ ailoy_py-0.0.5.dist-info/RECORD,,
24
+ ailoy_py-0.0.5.dist-info/WHEEL,sha256=_PdgJ-W7uMAsWwnGnEdiicDU_PKcobRdffEM23gmN6g,106
25
+ ailoy_py.libs/msvcp140-0f885b509a685d2bbfa652fed26b5fb3.dll,sha256=D4hbUJpoXSu_plL-0mtfsx2I-9qwqXjGQdHHuKpGCqk,557728
26
+ ailoy_py.libs/tvm_runtime-9ad88c2ade755144e8d7f595777f385a.dll,sha256=ypvU1f-sl7PDVH5_A93puMngWpEQTa3TS9zUJrbUoCw,2531328
27
+ ailoy_py.libs/vcomp140-55aba23cdcd6484fbb06f4155b8ca75a.dll,sha256=VauiPNzWSE-7BvQVW4ynWt_OeogfEK_QxJRXFl5ncWQ,193152
@@ -1,2 +0,0 @@
1
- Version: 1.10.1
2
- Arguments: ['C:\\hostedtoolcache\\windows\\Python\\3.13.5\\x64\\Scripts\\delvewheel', 'repair', '-w', 'wheelhouse', 'D:\\a\\ailoy\\ailoy\\bindings\\python\\dist\\ailoy_py-0.0.3-cp313-cp313-win_amd64.whl', '--add-path', 'D:\\a\\ailoy\\ailoy\\bindings\\python\\build\\_deps\\tvm-build\\Release', '--exclude', 'vulkan-1.dll']