fyodorov-llm-agents 0.4.13__py3-none-any.whl → 0.4.16__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.
- fyodorov_llm_agents/tools/mcp_tool_service.py +16 -9
- {fyodorov_llm_agents-0.4.13.dist-info → fyodorov_llm_agents-0.4.16.dist-info}/METADATA +1 -1
- {fyodorov_llm_agents-0.4.13.dist-info → fyodorov_llm_agents-0.4.16.dist-info}/RECORD +5 -5
- {fyodorov_llm_agents-0.4.13.dist-info → fyodorov_llm_agents-0.4.16.dist-info}/WHEEL +0 -0
- {fyodorov_llm_agents-0.4.13.dist-info → fyodorov_llm_agents-0.4.16.dist-info}/top_level.txt +0 -0
@@ -5,9 +5,9 @@ from .mcp_tool_model import MCPTool as ToolModel
|
|
5
5
|
class MCPTool():
|
6
6
|
|
7
7
|
@staticmethod
|
8
|
-
async def create_or_update_in_db(access_token: str, tool: ToolModel, user_id: str) ->
|
8
|
+
async def create_or_update_in_db(access_token: str, tool: ToolModel, user_id: str) -> ToolModel:
|
9
9
|
print(f"Creating or updating tool with handle {tool.handle} for user {user_id}")
|
10
|
-
tool_w_id = MCPTool.get_by_name_and_user_id(access_token, tool.handle, user_id)
|
10
|
+
tool_w_id = await MCPTool.get_by_name_and_user_id(access_token, tool.handle, user_id)
|
11
11
|
if tool_w_id:
|
12
12
|
print(f"Tool with handle {tool.handle} already exists, updating it.")
|
13
13
|
return await MCPTool.update_in_db(access_token, tool_w_id.id, tool)
|
@@ -16,7 +16,7 @@ class MCPTool():
|
|
16
16
|
return await MCPTool.create_in_db(access_token, tool, user_id)
|
17
17
|
|
18
18
|
@staticmethod
|
19
|
-
async def create_in_db(access_token: str, tool: ToolModel, user_id: str) ->
|
19
|
+
async def create_in_db(access_token: str, tool: ToolModel, user_id: str) -> ToolModel:
|
20
20
|
try:
|
21
21
|
supabase = get_supabase(access_token)
|
22
22
|
tool_dict = tool.to_dict()
|
@@ -30,14 +30,15 @@ class MCPTool():
|
|
30
30
|
print('creating tool in db', tool_dict)
|
31
31
|
result = supabase.table('mcp_tools').insert(tool_dict).execute()
|
32
32
|
print('created tool in db', result)
|
33
|
-
|
34
|
-
|
33
|
+
tool_dict = result.data[0]
|
34
|
+
tool = ToolModel(**tool_dict)
|
35
|
+
return tool
|
35
36
|
except Exception as e:
|
36
37
|
print('Error creating tool', str(e))
|
37
38
|
raise e
|
38
39
|
|
39
40
|
@staticmethod
|
40
|
-
async def update_in_db(access_token: str, id: str, tool: ToolModel) ->
|
41
|
+
async def update_in_db(access_token: str, id: str, tool: ToolModel) -> ToolModel:
|
41
42
|
if not id:
|
42
43
|
raise ValueError('Tool ID is required')
|
43
44
|
try:
|
@@ -45,7 +46,9 @@ class MCPTool():
|
|
45
46
|
tool_dict = tool.to_dict()
|
46
47
|
print('updating tool in db', tool_dict)
|
47
48
|
result = supabase.table('mcp_tools').update(tool_dict).eq('id', id).execute()
|
48
|
-
|
49
|
+
tool_dict = result.data[0]
|
50
|
+
tool = ToolModel(**tool_dict)
|
51
|
+
return tool
|
49
52
|
except Exception as e:
|
50
53
|
print('An error occurred while updating tool:', id, str(e))
|
51
54
|
raise
|
@@ -96,7 +99,7 @@ class MCPTool():
|
|
96
99
|
raise e
|
97
100
|
|
98
101
|
@staticmethod
|
99
|
-
async def get_all_in_db(access_token: str, user_id: str = None, limit: int = 10, created_at_lt: datetime = datetime.now()) -> list[
|
102
|
+
async def get_all_in_db(access_token: str, user_id: str = None, limit: int = 10, created_at_lt: datetime = datetime.now()) -> list[ToolModel]:
|
100
103
|
try:
|
101
104
|
supabase = get_supabase(access_token)
|
102
105
|
print('getting tools from db for user', user_id)
|
@@ -114,7 +117,11 @@ class MCPTool():
|
|
114
117
|
tool["updated_at"] = str(tool["updated_at"])
|
115
118
|
if tool and (tool['public'] == True or (user_id and 'user_id' in tool and tool['user_id'] == user_id)):
|
116
119
|
print('tool is public or belongs to user', tool)
|
117
|
-
|
120
|
+
tool_model = ToolModel(**tool)
|
121
|
+
if tool_model.validate():
|
122
|
+
tools.append(tool_model)
|
123
|
+
else:
|
124
|
+
print(f"Invalid tool data: {tool}")
|
118
125
|
print('got tools from db', len(tools))
|
119
126
|
return tools
|
120
127
|
except Exception as e:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fyodorov_llm_agents
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.16
|
4
4
|
Summary: LLM agents for the Fyodorov AI suite
|
5
5
|
Author-email: Daniel Ransom <02masseur.alibis@icloud.com>
|
6
6
|
Project-URL: Homepage, https://github.com/FyodorovAI/fyodorov-llm-agents
|
@@ -8,9 +8,9 @@ fyodorov_llm_agents/models/llm_service.py,sha256=35bS0RFXJhJUSjge-v4u5cftn_MT-Cm
|
|
8
8
|
fyodorov_llm_agents/providers/provider_model.py,sha256=OyCK6WMRhyElsp88gILg0wso-OPHI7f55gEeypsJ7O0,957
|
9
9
|
fyodorov_llm_agents/providers/provider_service.py,sha256=GST-NLV8aLPsvapQEvgT_qHGYu7IpS5Xsut60XFmD-g,5865
|
10
10
|
fyodorov_llm_agents/tools/mcp_tool_model.py,sha256=nGdPmqSkA7hqDUTPbNCZAHNSVJCgVOs5dzJfPntLidI,5110
|
11
|
-
fyodorov_llm_agents/tools/mcp_tool_service.py,sha256=
|
11
|
+
fyodorov_llm_agents/tools/mcp_tool_service.py,sha256=NzZOmOQLH-V4m5Znifxy7hI038MLTT22rj2hkZSK1to,7299
|
12
12
|
fyodorov_llm_agents/tools/tool.py,sha256=HyOk0X_3XE23sa8J-8UZx657tJ0sxwZWMbA4OPxXU6E,7940
|
13
|
-
fyodorov_llm_agents-0.4.
|
14
|
-
fyodorov_llm_agents-0.4.
|
15
|
-
fyodorov_llm_agents-0.4.
|
16
|
-
fyodorov_llm_agents-0.4.
|
13
|
+
fyodorov_llm_agents-0.4.16.dist-info/METADATA,sha256=vp1qXDwpzpKkvOxjNYPxnGXvNWvX7tEii4gwhRUAaL0,551
|
14
|
+
fyodorov_llm_agents-0.4.16.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
15
|
+
fyodorov_llm_agents-0.4.16.dist-info/top_level.txt,sha256=4QOslsBp8Gh7ng25DceA7fHp4KguTIdAxwURz97gH-g,20
|
16
|
+
fyodorov_llm_agents-0.4.16.dist-info/RECORD,,
|
File without changes
|
File without changes
|