fyodorov-llm-agents 0.4.63__py3-none-any.whl → 0.4.65__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/agents/agent_service.py +30 -3
- fyodorov_llm_agents/tools/mcp_tool_model.py +5 -0
- {fyodorov_llm_agents-0.4.63.dist-info → fyodorov_llm_agents-0.4.65.dist-info}/METADATA +1 -1
- {fyodorov_llm_agents-0.4.63.dist-info → fyodorov_llm_agents-0.4.65.dist-info}/RECORD +6 -6
- {fyodorov_llm_agents-0.4.63.dist-info → fyodorov_llm_agents-0.4.65.dist-info}/WHEEL +0 -0
- {fyodorov_llm_agents-0.4.63.dist-info → fyodorov_llm_agents-0.4.65.dist-info}/top_level.txt +0 -0
@@ -2,7 +2,10 @@ from datetime import datetime
|
|
2
2
|
import os
|
3
3
|
from supabase import Client
|
4
4
|
import litellm
|
5
|
+
import requests
|
6
|
+
|
5
7
|
from fyodorov_utils.config.supabase import get_supabase
|
8
|
+
from fyodorov_utils.service_discovery import get_service_url
|
6
9
|
from fyodorov_llm_agents.agents.agent_model import Agent as AgentModel
|
7
10
|
from fyodorov_llm_agents.tools.mcp_tool_model import MCPTool as ToolModel
|
8
11
|
from fyodorov_llm_agents.tools.mcp_tool_service import MCPTool as ToolService
|
@@ -230,7 +233,10 @@ class Agent(AgentModel):
|
|
230
233
|
if not mcp_tool:
|
231
234
|
raise ValueError(f"Tool '{fn_name}' not found in loaded MCP tools")
|
232
235
|
|
233
|
-
|
236
|
+
# Forward tool call to Tsiolkovsky instead of calling locally
|
237
|
+
tool_output = await self._forward_tool_call_to_tsiolkovsky(
|
238
|
+
mcp_tool.id, args, user_session
|
239
|
+
)
|
234
240
|
|
235
241
|
messages.append({
|
236
242
|
"role": "assistant",
|
@@ -255,5 +261,26 @@ class Agent(AgentModel):
|
|
255
261
|
print(f"Answer: {answer}")
|
256
262
|
return {
|
257
263
|
"answer": answer,
|
258
|
-
|
259
|
-
|
264
|
+
}
|
265
|
+
|
266
|
+
async def _forward_tool_call_to_tsiolkovsky(self, tool_id: str, args: str, user_session: str) -> str:
|
267
|
+
"""Forward function call to Tsiolkovsky for execution"""
|
268
|
+
try:
|
269
|
+
tsiolkovsky_url = get_service_url('Tsiolkovsky')
|
270
|
+
|
271
|
+
response = await asyncio.to_thread(
|
272
|
+
requests.post,
|
273
|
+
f"{tsiolkovsky_url}/tools/{tool_id}/call",
|
274
|
+
json={"args": args},
|
275
|
+
headers={"Authorization": f"Bearer {user_session}"},
|
276
|
+
timeout=30
|
277
|
+
)
|
278
|
+
|
279
|
+
if response.status_code == 200:
|
280
|
+
result = response.json()
|
281
|
+
return result.get("result", "")
|
282
|
+
else:
|
283
|
+
return f"Error calling tool: {response.status_code} - {response.text}"
|
284
|
+
|
285
|
+
except Exception as e:
|
286
|
+
return f"Error forwarding tool call: {str(e)}"
|
@@ -37,6 +37,11 @@ class MCPTool(BaseModel):
|
|
37
37
|
health_status: Optional[str] = None
|
38
38
|
usage_notes: Optional[str] = None
|
39
39
|
|
40
|
+
# Fields for launching local tools
|
41
|
+
launch_command: Optional[str] = None # The command to execute (e.g., "npx", "python")
|
42
|
+
launch_args: Optional[list[str]] = None # Arguments for the command (e.g., ["-y", "mcp-remote@latest"])
|
43
|
+
launch_working_directory: Optional[str] = None # Working directory for the command
|
44
|
+
|
40
45
|
# Example validations below. Adjust/extend to fit your needs.
|
41
46
|
|
42
47
|
def validate(self) -> bool:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fyodorov_llm_agents
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.65
|
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
|
@@ -1,6 +1,6 @@
|
|
1
1
|
fyodorov_llm_agents/base_model.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
fyodorov_llm_agents/agents/agent_model.py,sha256=JNbRBWtErHnFqlP_ONd0B8Vf3o_AyigHKchsd3COZrk,3899
|
3
|
-
fyodorov_llm_agents/agents/agent_service.py,sha256=
|
3
|
+
fyodorov_llm_agents/agents/agent_service.py,sha256=ufNfYYLtPoI9ZQR0AZb7fGYP3T0U7fFxQq6EDRcUpZk,11447
|
4
4
|
fyodorov_llm_agents/agents/openai.py,sha256=FA5RS7yn3JwvFA8PXju60XSYC_2oUZFNgBUzeIYtGv0,1154
|
5
5
|
fyodorov_llm_agents/instances/instance_model.py,sha256=swRzCXeUk2FFKzGMEjeToklBJRK7GdAJl1ZIoQALuxs,1368
|
6
6
|
fyodorov_llm_agents/instances/instance_service.py,sha256=3e9qfBGfd2RydSu8skQhA_PaRiiqWjOt0jyjUTek6a0,8772
|
@@ -8,10 +8,10 @@ fyodorov_llm_agents/models/llm_model.py,sha256=9sAM2QbVp62yFxhETii1x4VhZCn3HNwut
|
|
8
8
|
fyodorov_llm_agents/models/llm_service.py,sha256=t7p8pRExJr-B8MD7KleKNe8YlHZ1geDuqYzbTFo_0MM,4837
|
9
9
|
fyodorov_llm_agents/providers/provider_model.py,sha256=7G0WSPJYGcLIFgyQF0Y-Rv4f37-TMGg7fyeZxrC3fNE,1100
|
10
10
|
fyodorov_llm_agents/providers/provider_service.py,sha256=dbLyi4_sOfciksBgbyf_iViMud93Kzpn23D7-aYIBj8,6761
|
11
|
-
fyodorov_llm_agents/tools/mcp_tool_model.py,sha256=
|
11
|
+
fyodorov_llm_agents/tools/mcp_tool_model.py,sha256=pMQ8VMYMUn8l80UVj4WefdzlGZxSrTrZOP-R2cPAGUs,5629
|
12
12
|
fyodorov_llm_agents/tools/mcp_tool_service.py,sha256=dl6svc6ncqpAAQRTP8PM_xGH8EVnoENbvjzi7froT2Y,9089
|
13
13
|
fyodorov_llm_agents/tools/tool.py,sha256=HyOk0X_3XE23sa8J-8UZx657tJ0sxwZWMbA4OPxXU6E,7940
|
14
|
-
fyodorov_llm_agents-0.4.
|
15
|
-
fyodorov_llm_agents-0.4.
|
16
|
-
fyodorov_llm_agents-0.4.
|
17
|
-
fyodorov_llm_agents-0.4.
|
14
|
+
fyodorov_llm_agents-0.4.65.dist-info/METADATA,sha256=7vw4WbLBBPNFM5SDMMw890iZhlLQ918eFoe9ztEhvxI,551
|
15
|
+
fyodorov_llm_agents-0.4.65.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
+
fyodorov_llm_agents-0.4.65.dist-info/top_level.txt,sha256=4QOslsBp8Gh7ng25DceA7fHp4KguTIdAxwURz97gH-g,20
|
17
|
+
fyodorov_llm_agents-0.4.65.dist-info/RECORD,,
|
File without changes
|
File without changes
|