solana-agent 17.1.3__tar.gz → 17.1.5__tar.gz
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.
- {solana_agent-17.1.3 → solana_agent-17.1.5}/PKG-INFO +1 -1
- {solana_agent-17.1.3 → solana_agent-17.1.5}/pyproject.toml +1 -1
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/client/solana_agent.py +20 -15
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/factories/agent_factory.py +1 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/plugins/registry.py +18 -5
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/services/agent.py +7 -5
- {solana_agent-17.1.3 → solana_agent-17.1.5}/LICENSE +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/README.md +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/__init__.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/adapters/__init__.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/adapters/llm_adapter.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/adapters/mongodb_adapter.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/client/__init__.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/domains/__init__.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/domains/agent.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/domains/routing.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/factories/__init__.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/__init__.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/client/client.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/plugins/plugins.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/providers/data_storage.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/providers/llm.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/providers/memory.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/repositories/agent.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/services/agent.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/services/query.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/services/routing.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/plugins/__init__.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/plugins/manager.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/plugins/tools/__init__.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/plugins/tools/auto_tool.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/repositories/__init__.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/repositories/agent.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/repositories/memory.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/services/__init__.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/services/query.py +0 -0
- {solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/services/routing.py +0 -0
@@ -112,26 +112,31 @@ class SolanaAgent(SolanaAgentInterface):
|
|
112
112
|
)
|
113
113
|
|
114
114
|
def register_tool(self, tool: Tool) -> bool:
|
115
|
-
"""
|
115
|
+
"""
|
116
|
+
Register a tool with the agent system.
|
116
117
|
|
117
118
|
Args:
|
118
|
-
tool: Tool
|
119
|
+
tool: Tool instance to register
|
119
120
|
|
120
121
|
Returns:
|
121
|
-
|
122
|
-
|
123
|
-
Example:
|
124
|
-
```python
|
125
|
-
from solana_agent import SolanaAgent
|
126
|
-
from my_tools import CustomTool
|
127
|
-
|
128
|
-
agent = SolanaAgent(config=config)
|
129
|
-
tool = CustomTool()
|
130
|
-
agent.register_tool(tool)
|
131
|
-
```
|
122
|
+
True if successful, False
|
132
123
|
"""
|
124
|
+
|
133
125
|
try:
|
134
|
-
|
126
|
+
print(f"Attempting to register tool: {tool.name}")
|
127
|
+
success = self.query_service.agent_service.tool_registry.register_tool(
|
128
|
+
tool)
|
129
|
+
if success:
|
130
|
+
print(f"Tool {tool.name} registered successfully")
|
131
|
+
# Get all agents and assign the tool to them
|
132
|
+
agents = self.query_service.agent_service.get_all_ai_agents()
|
133
|
+
for agent_name in agents:
|
134
|
+
print(f"Assigning {tool.name} to agent {agent_name}")
|
135
|
+
self.query_service.agent_service.assign_tool_for_agent(
|
136
|
+
agent_name, tool.name)
|
137
|
+
return success
|
135
138
|
except Exception as e:
|
136
|
-
print(f"Error
|
139
|
+
print(f"Error in register_tool: {str(e)}")
|
140
|
+
import traceback
|
141
|
+
print(traceback.format_exc())
|
137
142
|
return False
|
@@ -20,9 +20,14 @@ class ToolRegistry(ToolRegistryInterface):
|
|
20
20
|
|
21
21
|
def register_tool(self, tool: Tool) -> bool:
|
22
22
|
"""Register a tool with this registry."""
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
try:
|
24
|
+
self._tools[tool.name] = tool
|
25
|
+
print(f"Successfully registered tool: {tool.name}")
|
26
|
+
print(f"Current tools in registry: {list(self._tools.keys())}")
|
27
|
+
return True
|
28
|
+
except Exception as e:
|
29
|
+
print(f"Error registering tool: {str(e)}")
|
30
|
+
return False
|
26
31
|
|
27
32
|
def get_tool(self, tool_name: str) -> Optional[Tool]:
|
28
33
|
"""Get a tool by name."""
|
@@ -31,7 +36,8 @@ class ToolRegistry(ToolRegistryInterface):
|
|
31
36
|
def assign_tool_to_agent(self, agent_name: str, tool_name: str) -> bool:
|
32
37
|
"""Give an agent access to a specific tool."""
|
33
38
|
if tool_name not in self._tools:
|
34
|
-
print(
|
39
|
+
print(
|
40
|
+
f"Error: Tool {tool_name} is not registered. Available tools: {list(self._tools.keys())}")
|
35
41
|
return False
|
36
42
|
|
37
43
|
if agent_name not in self._agent_tools:
|
@@ -39,13 +45,17 @@ class ToolRegistry(ToolRegistryInterface):
|
|
39
45
|
|
40
46
|
if tool_name not in self._agent_tools[agent_name]:
|
41
47
|
self._agent_tools[agent_name].append(tool_name)
|
48
|
+
print(
|
49
|
+
f"Successfully assigned tool {tool_name} to agent {agent_name}")
|
50
|
+
print(
|
51
|
+
f"Agent {agent_name} now has access to: {self._agent_tools[agent_name]}")
|
42
52
|
|
43
53
|
return True
|
44
54
|
|
45
55
|
def get_agent_tools(self, agent_name: str) -> List[Dict[str, Any]]:
|
46
56
|
"""Get all tools available to an agent."""
|
47
57
|
tool_names = self._agent_tools.get(agent_name, [])
|
48
|
-
|
58
|
+
tools = [
|
49
59
|
{
|
50
60
|
"name": name,
|
51
61
|
"description": self._tools[name].description,
|
@@ -53,6 +63,9 @@ class ToolRegistry(ToolRegistryInterface):
|
|
53
63
|
}
|
54
64
|
for name in tool_names if name in self._tools
|
55
65
|
]
|
66
|
+
print(
|
67
|
+
f"Tools available to agent {agent_name}: {[t['name'] for t in tools]}")
|
68
|
+
return tools
|
56
69
|
|
57
70
|
def list_all_tools(self) -> List[str]:
|
58
71
|
"""List all registered tools."""
|
@@ -12,7 +12,8 @@ from typing import AsyncGenerator, Dict, List, Literal, Optional, Any, Union
|
|
12
12
|
from solana_agent.interfaces.services.agent import AgentService as AgentServiceInterface
|
13
13
|
from solana_agent.interfaces.providers.llm import LLMProvider
|
14
14
|
from solana_agent.interfaces.repositories.agent import AgentRepository
|
15
|
-
from solana_agent.interfaces.plugins.plugins import ToolRegistry
|
15
|
+
from solana_agent.interfaces.plugins.plugins import ToolRegistry as ToolRegistryInterface
|
16
|
+
from solana_agent.plugins.registry import ToolRegistry
|
16
17
|
from solana_agent.domains.agent import AIAgent, OrganizationMission
|
17
18
|
|
18
19
|
|
@@ -25,7 +26,7 @@ class AgentService(AgentServiceInterface):
|
|
25
26
|
agent_repository: AgentRepository,
|
26
27
|
organization_mission: Optional[OrganizationMission] = None,
|
27
28
|
config: Optional[Dict[str, Any]] = None,
|
28
|
-
tool_registry: Optional[
|
29
|
+
tool_registry: Optional[ToolRegistryInterface] = None,
|
29
30
|
):
|
30
31
|
"""Initialize the agent service.
|
31
32
|
|
@@ -34,6 +35,7 @@ class AgentService(AgentServiceInterface):
|
|
34
35
|
agent_repository: Repository for agent data
|
35
36
|
organization_mission: Optional organization mission and values
|
36
37
|
config: Optional service configuration
|
38
|
+
tool_registry: Optional tool registry
|
37
39
|
"""
|
38
40
|
self.llm_provider = llm_provider
|
39
41
|
self.agent_repository = agent_repository
|
@@ -45,9 +47,9 @@ class AgentService(AgentServiceInterface):
|
|
45
47
|
if tool_registry:
|
46
48
|
self.tool_registry = tool_registry
|
47
49
|
else:
|
48
|
-
|
49
|
-
|
50
|
-
self.tool_registry =
|
50
|
+
config = self.config
|
51
|
+
print("Initializing tool registry with config")
|
52
|
+
self.tool_registry = ToolRegistry(config=config)
|
51
53
|
|
52
54
|
# Will be set by factory if plugin system is enabled
|
53
55
|
self.plugin_manager = None
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{solana_agent-17.1.3 → solana_agent-17.1.5}/solana_agent/interfaces/providers/data_storage.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|