ailoy-py 0.0.3__cp313-cp313-win_amd64.whl → 0.0.6__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_1():
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_1()
9
+ del _delvewheel_patch_1_11_1
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,9 +1,13 @@
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
5
5
 
6
6
  OpenAIModelId = Literal[
7
+ "gpt-5",
8
+ "gpt-5-mini",
9
+ "gpt-5-nano",
10
+ "gpt-5-chat-latest",
7
11
  "o4-mini",
8
12
  "o3",
9
13
  "o3-pro",
@@ -28,13 +32,27 @@ ClaudeModelId = Literal[
28
32
  "claude-3-7-sonnet-20250219",
29
33
  "claude-3-5-sonnet-20241022",
30
34
  "claude-3-5-sonnet-20240620",
35
+ "claude-opus-4-1-20250805",
31
36
  "claude-opus-4-20250514",
32
37
  "claude-3-opus-20240229",
33
38
  "claude-3-5-haiku-20241022",
34
39
  "claude-3-haiku-20240307",
35
40
  ]
36
41
 
37
- APIModelProvider = Literal["openai", "gemini", "claude"]
42
+ GrokModelId = Literal[
43
+ "grok-4",
44
+ "grok-4-0709",
45
+ "grok-3",
46
+ "grok-3-fast",
47
+ "grok-3-mini",
48
+ "grok-3-mini-fast",
49
+ "grok-2",
50
+ "grok-2-1212",
51
+ "grok-2-vision-1212",
52
+ "grok-2-image-1212",
53
+ ]
54
+
55
+ APIModelProvider = Literal["openai", "gemini", "claude", "grok"]
38
56
 
39
57
 
40
58
  @dataclass
@@ -44,7 +62,7 @@ class APIModel:
44
62
  provider: Optional[APIModelProvider] = None
45
63
 
46
64
  @model_validator(mode="after")
47
- def validate_provider(self) -> Self:
65
+ def validate_provider(self):
48
66
  if self.provider is None:
49
67
  if self.id in get_args(OpenAIModelId):
50
68
  self.provider = "openai"
@@ -52,6 +70,8 @@ class APIModel:
52
70
  self.provider = "gemini"
53
71
  elif self.id in get_args(ClaudeModelId):
54
72
  self.provider = "claude"
73
+ elif self.id in get_args(GrokModelId):
74
+ self.provider = "grok"
55
75
  else:
56
76
  raise ValueError(
57
77
  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.1
2
+ Arguments: ['C:\\Program Files\\Python313\\Lib\\site-packages\\delvewheel\\__main__.py', 'repair', '-w', 'wheelhouse', 'C:\\workspace\\bindings\\python\\dist\\ailoy_py-0.0.6-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.6
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
@@ -0,0 +1,28 @@
1
+ ailoy/agent.py,sha256=SqpnpywdXg28UjtBHcU0k446s1DxW-g6jWCNEHQxGAk,27728
2
+ ailoy/ailoy_py.cp313-win_amd64.pyd,sha256=laHm3vRh1nyCwPo_HoFm7YIvObVMsrkC5HPSRZCfWWI,12859904
3
+ ailoy/ailoy_py.pyi,sha256=wr_-KGTI-O9usNdzTyszn4mAjnjiV2cJf0aBct2PKrU,1020
4
+ ailoy/mcp.py,sha256=mwxfEZj7Je2PJTwwM9zVQ44AurrA5xY5TWVsAUkk9T8,6971
5
+ ailoy/runtime.py,sha256=Bic6acq6NVuZchyuB51lm-58Xe_blRJbIE3gF9Xk22w,10833
6
+ ailoy/tools.py,sha256=OQZHMGOWovx0uWlYeWN2BoPG_G5rMW5HXCP3yTvtLDk,9081
7
+ ailoy/vector_store.py,sha256=507HG-3W_glmZsKDUcFygdaPg3d7xyHbAFczE3diGwo,7723
8
+ ailoy/__init__.py,sha256=jKLgORzpHO9EadJqHEmqiCM3io5oO3rEK9Vn0f_6oI0,1135
9
+ ailoy/cli/model.py,sha256=t1-uO5vRDUomxIDpuMduPVCOKBR9VHMXqMcz38m_-YI,3091
10
+ ailoy/cli/__main__.py,sha256=JUWtde3gYqKxuCtihgr5g2MAQgj151wv41OOZv2uHsQ,190
11
+ ailoy/models/api_model.py,sha256=aR1TXZwNNRsnwLt-RrJW3C4wog8LRudAdR8Jr9QSrWs,2287
12
+ ailoy/models/local_model.py,sha256=Z7TwScM2V1U99ErqgO2YVcSOc85wEmIie8xTXP7wMBA,1250
13
+ ailoy/models/__init__.py,sha256=AfJlZYoacXf9de0LOttkFNirwS8XFaZcHUg7dA7xQsw,124
14
+ ailoy/presets/tools/calculator.json,sha256=8G5t1PGyM7ZmX97WNfrF-H-x7LR8s_O15ppY_APFnVo,1064
15
+ ailoy/presets/tools/frankfurter.json,sha256=nM26DjkiPgamhL1Re7Gi_fnhUQyegDxcquEFBD0af5g,1185
16
+ ailoy/presets/tools/nytimes.json,sha256=diio4FSJGHvumX05MQ0RgrqZzggpjyX8ekBPZ4NCmPo,944
17
+ ailoy/presets/tools/tmdb.json,sha256=o9dg9bdfFhvgrhVGw5hP3V0EgGvBzm5ZrTtxrb1PerM,7231
18
+ ailoy/utils/image.py,sha256=hMNrwexs_8Dz0QK2CUI8Kyw3_X3v4mWxtskg9SLBLCg,299
19
+ ailoy/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
+ ailoy_py-0.0.6.dist-info/DELVEWHEEL,sha256=dIz3g-P9sQekZY3fCQYAkjTXKoy5u_FuwUk15_fPoBg,330
21
+ ailoy_py-0.0.6.dist-info/entry_points.txt,sha256=gVG45uDE6kef0wm6SEMYSgZgRNNRhSAeP2n2lPR00dI,50
22
+ ailoy_py-0.0.6.dist-info/METADATA,sha256=4FpJrqFqxEPG2vYv3mc9gYj9a6wlazswgct9ZOmvRf4,2053
23
+ ailoy_py-0.0.6.dist-info/RECORD,,
24
+ ailoy_py-0.0.6.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/msvcp140_atomic_wait-4cdcefc123380c8f46116e92310a3e8c.dll,sha256=UC4umH01Gyvqdx3o19lBdAHpxa6FNNEkbhdTGJGCDxw,29696
27
+ ailoy_py.libs/tvm_runtime-fcb4d604f6c00b64a104c7f3b3a06885.dll,sha256=Q2pEb_pYAOrqDJK-UGhRXXced6rewKAMqeb-t3ufxa4,2531328
28
+ 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']
@@ -1,27 +0,0 @@
1
- ailoy/agent.py,sha256=HowE3cc1nxuoi41SiX6tyAZudlJ2I_pdnOs3SFHebJw,27549
2
- ailoy/ailoy_py.cp313-win_amd64.pyd,sha256=YGESQzWy--RT4ElV7ntbsyuXIfXbQk7TiVEfUA8_Xfg,11655168
3
- ailoy/ailoy_py.pyi,sha256=wr_-KGTI-O9usNdzTyszn4mAjnjiV2cJf0aBct2PKrU,1020
4
- ailoy/mcp.py,sha256=mwxfEZj7Je2PJTwwM9zVQ44AurrA5xY5TWVsAUkk9T8,6971
5
- ailoy/runtime.py,sha256=Bic6acq6NVuZchyuB51lm-58Xe_blRJbIE3gF9Xk22w,10833
6
- ailoy/tools.py,sha256=5Q7Q59ozeKWXwH5q9WY_9nuI3ALMAorKPgX6LNPWaJg,8412
7
- ailoy/vector_store.py,sha256=507HG-3W_glmZsKDUcFygdaPg3d7xyHbAFczE3diGwo,7723
8
- ailoy/__init__.py,sha256=BXhdYLP-Ja7E2JQACEDkaPhEapgjF4fF02Cr7IPSRzI,1135
9
- ailoy/cli/model.py,sha256=t1-uO5vRDUomxIDpuMduPVCOKBR9VHMXqMcz38m_-YI,3091
10
- ailoy/cli/__main__.py,sha256=JUWtde3gYqKxuCtihgr5g2MAQgj151wv41OOZv2uHsQ,190
11
- ailoy/models/api_model.py,sha256=Bkj60H1_AMGltRjBpFGlwxk-FTuf1FeAUWQ1aucuyKE,1858
12
- ailoy/models/local_model.py,sha256=Z7TwScM2V1U99ErqgO2YVcSOc85wEmIie8xTXP7wMBA,1250
13
- ailoy/models/__init__.py,sha256=AfJlZYoacXf9de0LOttkFNirwS8XFaZcHUg7dA7xQsw,124
14
- ailoy/presets/tools/calculator.json,sha256=8G5t1PGyM7ZmX97WNfrF-H-x7LR8s_O15ppY_APFnVo,1064
15
- ailoy/presets/tools/frankfurter.json,sha256=nM26DjkiPgamhL1Re7Gi_fnhUQyegDxcquEFBD0af5g,1185
16
- ailoy/presets/tools/nytimes.json,sha256=diio4FSJGHvumX05MQ0RgrqZzggpjyX8ekBPZ4NCmPo,944
17
- ailoy/presets/tools/tmdb.json,sha256=o9dg9bdfFhvgrhVGw5hP3V0EgGvBzm5ZrTtxrb1PerM,7231
18
- ailoy/utils/image.py,sha256=hMNrwexs_8Dz0QK2CUI8Kyw3_X3v4mWxtskg9SLBLCg,299
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