fyodorov-llm-agents 0.4.9__py3-none-any.whl → 0.4.11__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.
@@ -70,7 +70,9 @@ class MCPTool(BaseModel):
70
70
  if not isinstance(tool_dict, dict):
71
71
  raise ValueError('YAML string must represent a dictionary')
72
72
  tool = MCPTool(**tool_dict)
73
- tool.validate()
73
+ if not tool.validate():
74
+ print(f"Invalid tool data: {tool_dict}")
75
+ return None
74
76
  return tool
75
77
 
76
78
  def get_function(self) -> dict:
@@ -3,6 +3,18 @@ from fyodorov_utils.config.supabase import get_supabase
3
3
  from .mcp_tool_model import MCPTool as ToolModel
4
4
 
5
5
  class MCPTool():
6
+
7
+ @staticmethod
8
+ def create_or_update_in_db(access_token: str, tool: ToolModel, user_id: str) -> str:
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)
11
+ if tool_w_id:
12
+ print(f"Tool with handle {tool.handle} already exists, updating it.")
13
+ return MCPTool.update_in_db(access_token, tool_w_id.id, tool)
14
+ else:
15
+ print(f"Tool with handle {tool.handle} does not exist, creating it.")
16
+ return MCPTool.create_in_db(access_token, tool, user_id)
17
+
6
18
  @staticmethod
7
19
  def create_in_db(access_token: str, tool: ToolModel, user_id: str) -> str:
8
20
  try:
@@ -66,8 +78,11 @@ class MCPTool():
66
78
  try:
67
79
  supabase = get_supabase(access_token)
68
80
  result = supabase.table('mcp_tools').select('*').eq('user_id', user_id).eq('handle', handle).limit(1).execute()
69
- if not result or not result.data or len(result.data) == 0:
81
+ if not result or not result.data or len(result.data) == 0: # If no tools found for this user check for public tools with same name
70
82
  print(f"No tool found with the given handle {handle} and user ID {user_id}: {result}")
83
+ result = supabase.table('mcp_tools').select('*').eq('handle', handle).eq('public', True).limit(1).execute()
84
+ if not result or not result.data or len(result.data) == 0:
85
+ print(f"No public tool found with the given handle {handle}: {result}")
71
86
  return None
72
87
  tool_dict = result.data[0]
73
88
  tool = ToolModel(**tool_dict)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fyodorov_llm_agents
3
- Version: 0.4.9
3
+ Version: 0.4.11
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
@@ -7,10 +7,10 @@ fyodorov_llm_agents/models/llm_model.py,sha256=aQtXtB7kRpnVdbPu-nmTGAaflbtKz3DPk
7
7
  fyodorov_llm_agents/models/llm_service.py,sha256=35bS0RFXJhJUSjge-v4u5cftn_MT-CmcDuWnC2kCnJo,4008
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
- fyodorov_llm_agents/tools/mcp_tool_model.py,sha256=LuQE-mu5zKmiMmWOOKETAVkjwGsHSbcDbB57piEAACU,5025
11
- fyodorov_llm_agents/tools/mcp_tool_service.py,sha256=uA2xskCqNlibcaG0xLzSP4LuH6OMvgEo3VTSoCV98Po,5744
10
+ fyodorov_llm_agents/tools/mcp_tool_model.py,sha256=nGdPmqSkA7hqDUTPbNCZAHNSVJCgVOs5dzJfPntLidI,5110
11
+ fyodorov_llm_agents/tools/mcp_tool_service.py,sha256=rjsC1LBvIFZh3RsK1EESdPA9G7HrmQPkHnXBewSc_uY,6728
12
12
  fyodorov_llm_agents/tools/tool.py,sha256=HyOk0X_3XE23sa8J-8UZx657tJ0sxwZWMbA4OPxXU6E,7940
13
- fyodorov_llm_agents-0.4.9.dist-info/METADATA,sha256=4jmrBJLO6ec_v7sp8inq5ZozkUY17xUyF9oeh_pDQNM,550
14
- fyodorov_llm_agents-0.4.9.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
15
- fyodorov_llm_agents-0.4.9.dist-info/top_level.txt,sha256=4QOslsBp8Gh7ng25DceA7fHp4KguTIdAxwURz97gH-g,20
16
- fyodorov_llm_agents-0.4.9.dist-info/RECORD,,
13
+ fyodorov_llm_agents-0.4.11.dist-info/METADATA,sha256=cHHHwrJAnpNRewvDZsLB42x7szTj0vWXQ6uy8QuVPqo,551
14
+ fyodorov_llm_agents-0.4.11.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
15
+ fyodorov_llm_agents-0.4.11.dist-info/top_level.txt,sha256=4QOslsBp8Gh7ng25DceA7fHp4KguTIdAxwURz97gH-g,20
16
+ fyodorov_llm_agents-0.4.11.dist-info/RECORD,,