solana-agent 17.1.2__py3-none-any.whl → 17.1.4__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.
@@ -112,26 +112,31 @@ class SolanaAgent(SolanaAgentInterface):
112
112
  )
113
113
 
114
114
  def register_tool(self, tool: Tool) -> bool:
115
- """Register a custom tool for use by agents.
115
+ """
116
+ Register a tool with the agent system.
116
117
 
117
118
  Args:
118
- tool: Tool implementation following the Tool interface
119
+ tool: Tool instance to register
119
120
 
120
121
  Returns:
121
- bool: True if registration was successful
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
- return self.query_service.agent_service.tool_registry.register_tool(tool)
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 registering tool: {str(e)}")
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
- self._tools[tool.name] = tool
24
- print(f"Registered tool: {tool.name}")
25
- return True
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(f"Error: Tool {tool_name} is not registered")
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
- return [
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."""
@@ -32,7 +32,7 @@ class MemoryRepository(MemoryProvider):
32
32
  elif zep_api_key and zep_base_url:
33
33
  self.zep = AsyncZep(api_key=zep_api_key, base_url=zep_base_url)
34
34
  else:
35
- self.zep = AsyncZep(base_url="http://localhost:8000")
35
+ self.zep = None
36
36
 
37
37
  async def store(self, user_id: str, messages: List[Dict[str, Any]]) -> None:
38
38
  """Store messages in both Zep and MongoDB."""
@@ -55,6 +55,9 @@ class MemoryRepository(MemoryProvider):
55
55
  print(f"MongoDB storage error: {e}")
56
56
 
57
57
  # Store in Zep with role-based format
58
+ if not self.zep:
59
+ return
60
+
58
61
  try:
59
62
  try:
60
63
  await self.zep.user.add(user_id=user_id)
@@ -82,6 +85,9 @@ class MemoryRepository(MemoryProvider):
82
85
 
83
86
  async def retrieve(self, user_id: str) -> str:
84
87
  """Retrieve memory context from Zep only."""
88
+ if not self.zep:
89
+ return ""
90
+
85
91
  try:
86
92
  memory = await self.zep.memory.get(session_id=user_id)
87
93
 
@@ -101,6 +107,9 @@ class MemoryRepository(MemoryProvider):
101
107
  except Exception as e:
102
108
  print(f"MongoDB deletion error: {e}")
103
109
 
110
+ if not self.zep:
111
+ return
112
+
104
113
  try:
105
114
  await self.zep.memory.delete(session_id=user_id)
106
115
  await self.zep.user.delete(user_id=user_id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 17.1.2
3
+ Version: 17.1.4
4
4
  Summary: Agentic IQ
5
5
  License: MIT
6
6
  Keywords: ai,openai,ai agents,agi
@@ -43,7 +43,7 @@ Power your business using Solana Agent!
43
43
  ## Features
44
44
 
45
45
  * Seamless text and audio streaming with real-time multi-modal processing
46
- * Persistent memory that preserves context across all agent interactions
46
+ * Persistent memory that preserves context across all agent interactions (optional)
47
47
  * Intelligent query routing to agents with optimal domain expertise
48
48
  * Unified value system ensuring brand-aligned agent responses
49
49
  * Powerful tool integration using standard Python packages
@@ -54,7 +54,7 @@ Power your business using Solana Agent!
54
54
  * [Python](https://python.org) - Programming Language
55
55
  * [OpenAI](https://openai.com) - LLMs
56
56
  * [MongoDB](https://mongodb.com) - Database
57
- * [Zep](https://getzep.com) - Conversational Memory
57
+ * [Zep](https://getzep.com) - Conversational Memory (optional)
58
58
 
59
59
  ## Installation
60
60
 
@@ -84,7 +84,11 @@ config = {
84
84
  "database": "solana_agent"
85
85
  },
86
86
  "openai": {
87
- "api_key": "your-openai-key",
87
+ "api_key": "your-openai-api-key",
88
+ },
89
+ "zep": { # optional
90
+ "api_key": "your-zep-api-key",
91
+ "base_url": "your-zep-base-url", # not applicable if using Zep Cloud
88
92
  },
89
93
  "agents": [
90
94
  {
@@ -3,7 +3,7 @@ solana_agent/adapters/__init__.py,sha256=tiEEuuy0NF3ngc_tGEcRTt71zVI58v3dYY9RvMr
3
3
  solana_agent/adapters/llm_adapter.py,sha256=hi2JYj6CvhNLJxznIv_7Ef7Y0mk7aztHd_OMYe2scMQ,6034
4
4
  solana_agent/adapters/mongodb_adapter.py,sha256=qqEFbY_v1XGyFXBmwd5HSXSSHnA9wWo-Hm1vGEyIG0k,2718
5
5
  solana_agent/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- solana_agent/client/solana_agent.py,sha256=no4TH0G44gGVft3GJKLHf_L_JDAwUkzHk-hwxZZeAxk,5010
6
+ solana_agent/client/solana_agent.py,sha256=Q9vnsoezsdhe6-T_tMb7Gr-697D1Bo2qIpr1-ytP1ak,5361
7
7
  solana_agent/domains/__init__.py,sha256=HiC94wVPRy-QDJSSRywCRrhrFfTBeHjfi5z-QfZv46U,168
8
8
  solana_agent/domains/agent.py,sha256=Ak_hD5gTCzRqAHLmqtxnny0Xki1qAKR7RzLW9LOQBTg,2930
9
9
  solana_agent/domains/routing.py,sha256=UDlgTjUoC9xIBVYu_dnf9-KG_bBgdEXAv_UtDOrYo0w,650
@@ -21,17 +21,17 @@ solana_agent/interfaces/services/query.py,sha256=bspnm-CN6zjRWnlFnkl34qo0EIW5m2T
21
21
  solana_agent/interfaces/services/routing.py,sha256=gohkt5f9uYDLpu4iDVDk9yj8js9P56R6QHSIDNylgwA,438
22
22
  solana_agent/plugins/__init__.py,sha256=coZdgJKq1ExOaj6qB810i3rEhbjdVlrkN76ozt_Ojgo,193
23
23
  solana_agent/plugins/manager.py,sha256=GWwhfMBn9THwVn7biOvVa25GLthCA1ilWIoDkt5hXNI,5084
24
- solana_agent/plugins/registry.py,sha256=dRKWoOEqiU7OLsjpBWf4VJfDQYZdJPjW5AKxeITmVMA,2283
24
+ solana_agent/plugins/registry.py,sha256=CyZpfjLxV3cVtDnXvCVcMgXg_XEijDDsKuJ0bqG64cA,2900
25
25
  solana_agent/plugins/tools/__init__.py,sha256=c0z7ij42gs94_VJrcn4Y8gUlTxMhsFNY6ahIsNswdLk,231
26
26
  solana_agent/plugins/tools/auto_tool.py,sha256=Z3CcOzwdXpzciH-5yphhd9qt1b9owTxhwC-dYmPF6B0,1489
27
27
  solana_agent/repositories/__init__.py,sha256=fP83w83CGzXLnSdq-C5wbw9EhWTYtqE2lQTgp46-X_4,163
28
28
  solana_agent/repositories/agent.py,sha256=e1rnsQiigkKwJNLKro86a3b6TBiky3GMfmCRc5b_jPw,3187
29
- solana_agent/repositories/memory.py,sha256=GABGwaz00thjviHewLvb18NeKE8dkBROxy_stsiiWrE,4722
29
+ solana_agent/repositories/memory.py,sha256=DrhaVxlE-iAOmX0sfDCqgdPJauYvrnPd7rmVlf6_HGE,4822
30
30
  solana_agent/services/__init__.py,sha256=ab_NXJmwYUCmCrCzuTlZ47bJZINW0Y0F5jfQ9OovidU,163
31
31
  solana_agent/services/agent.py,sha256=j0aI_BGaY5Nhkb9ga0r4BqI3qMKu5TOc4QPQsU3NHyQ,17000
32
32
  solana_agent/services/query.py,sha256=rm7XlTCcp5NeorIaLUdr7rdxtWCgg1Q1qe5YuI1bumo,11246
33
33
  solana_agent/services/routing.py,sha256=TPJ2Pas4acE93QzMEV6ZP670OtTNrVEPa76fz6urEV4,4996
34
- solana_agent-17.1.2.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
35
- solana_agent-17.1.2.dist-info/METADATA,sha256=NRDlTqIZjUxvhy6Z3liDI5IubC-XJ2VV5S-9vzpzpjw,4547
36
- solana_agent-17.1.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
37
- solana_agent-17.1.2.dist-info/RECORD,,
34
+ solana_agent-17.1.4.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
35
+ solana_agent-17.1.4.dist-info/METADATA,sha256=o_zPKHGGkqqQpbwtnfjPwlFhgBQWW_Ytupx0rA6Bx7k,4720
36
+ solana_agent-17.1.4.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
37
+ solana_agent-17.1.4.dist-info/RECORD,,