solana-agent 28.0.0__tar.gz → 28.1.0__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.
Files changed (41) hide show
  1. {solana_agent-28.0.0 → solana_agent-28.1.0}/PKG-INFO +18 -2
  2. {solana_agent-28.0.0 → solana_agent-28.1.0}/README.md +16 -1
  3. {solana_agent-28.0.0 → solana_agent-28.1.0}/pyproject.toml +2 -1
  4. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/adapters/openai_adapter.py +29 -1
  5. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/factories/agent_factory.py +19 -3
  6. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/services/agent.py +0 -4
  7. {solana_agent-28.0.0 → solana_agent-28.1.0}/LICENSE +0 -0
  8. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/__init__.py +0 -0
  9. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/adapters/__init__.py +0 -0
  10. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/adapters/mongodb_adapter.py +0 -0
  11. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/adapters/pinecone_adapter.py +0 -0
  12. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/client/__init__.py +0 -0
  13. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/client/solana_agent.py +0 -0
  14. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/domains/__init__.py +0 -0
  15. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/domains/agent.py +0 -0
  16. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/domains/routing.py +0 -0
  17. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/factories/__init__.py +0 -0
  18. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/guardrails/pii.py +0 -0
  19. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/__init__.py +0 -0
  20. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/client/client.py +0 -0
  21. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/guardrails/guardrails.py +0 -0
  22. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/plugins/plugins.py +0 -0
  23. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/providers/data_storage.py +0 -0
  24. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/providers/llm.py +0 -0
  25. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/providers/memory.py +0 -0
  26. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/providers/vector_storage.py +0 -0
  27. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/services/agent.py +0 -0
  28. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/services/knowledge_base.py +0 -0
  29. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/services/query.py +0 -0
  30. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/interfaces/services/routing.py +0 -0
  31. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/plugins/__init__.py +0 -0
  32. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/plugins/manager.py +0 -0
  33. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/plugins/registry.py +0 -0
  34. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/plugins/tools/__init__.py +0 -0
  35. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/plugins/tools/auto_tool.py +0 -0
  36. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/repositories/__init__.py +0 -0
  37. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/repositories/memory.py +0 -0
  38. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/services/__init__.py +0 -0
  39. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/services/knowledge_base.py +0 -0
  40. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/services/query.py +0 -0
  41. {solana_agent-28.0.0 → solana_agent-28.1.0}/solana_agent/services/routing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 28.0.0
3
+ Version: 28.1.0
4
4
  Summary: AI Agents for Solana
5
5
  License: MIT
6
6
  Keywords: solana,solana ai,solana agent,ai,ai agent,ai agents
@@ -17,6 +17,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
17
  Requires-Dist: instructor (>=1.7.9,<2.0.0)
18
18
  Requires-Dist: llama-index-core (>=0.12.30,<0.13.0)
19
19
  Requires-Dist: llama-index-embeddings-openai (>=0.3.1,<0.4.0)
20
+ Requires-Dist: logfire (>=3.14.0,<4.0.0)
20
21
  Requires-Dist: openai (>=1.75.0,<2.0.0)
21
22
  Requires-Dist: pinecone (>=6.0.2,<7.0.0)
22
23
  Requires-Dist: pydantic (>=2)
@@ -63,6 +64,7 @@ Build your AI agents in three lines of code!
63
64
  * Knowledge Base
64
65
  * MCP Support
65
66
  * Guardrails
67
+ * Pydantic Logfire
66
68
  * Tested & Secure
67
69
  * Built in Python
68
70
  * Powers [CometHeart](https://cometheart.com)
@@ -74,6 +76,7 @@ Build your AI agents in three lines of code!
74
76
  * Fast AI responses
75
77
  * Solana Ecosystem Integration via [AgentiPy](https://github.com/niceberginc/agentipy)
76
78
  * MCP tool usage with first-class support for [Zapier](https://zapier.com/mcp)
79
+ * Integrated observability and tracing via [Pydantic Logfire](https://logfire.pydantic.dev/)
77
80
  * Designed for a multi-agent swarm
78
81
  * Seamless text and audio streaming with real-time multi-modal processing
79
82
  * Persistent memory that preserves context across all agent interactions
@@ -92,10 +95,13 @@ Build your AI agents in three lines of code!
92
95
  ### Tech
93
96
 
94
97
  * [Python](https://python.org) - Programming Language
95
- * [OpenAI](https://openai.com) - AI Provider
98
+ * [OpenAI](https://openai.com) - AI Model Provider
96
99
  * [MongoDB](https://mongodb.com) - Conversational History (optional)
97
100
  * [Zep Cloud](https://getzep.com) - Conversational Memory (optional)
98
101
  * [Pinecone](https://pinecone.io) - Knowledge Base (optional)
102
+ * [AgentiPy](https://agentipy.fun) - Solana Ecosystem (optional)
103
+ * [Zapier](https://zapier.com) - App Integrations (optional)
104
+ * [Pydantic Logfire](https://logfire.pydantic.dev) - Observability and Tracing (optional)
99
105
 
100
106
  ### AI Models Used
101
107
 
@@ -319,6 +325,16 @@ config = {
319
325
  }
320
326
  ```
321
327
 
328
+ ### Observability and Tracing
329
+
330
+ ```python
331
+ config = {
332
+ "logfire": {
333
+ "api_key": "your-logfire-write-token",
334
+ },
335
+ }
336
+ ```
337
+
322
338
  ### Knowledge Base
323
339
 
324
340
  The Knowledge Base (KB) is meant to store text values and/or small PDFs.
@@ -32,6 +32,7 @@ Build your AI agents in three lines of code!
32
32
  * Knowledge Base
33
33
  * MCP Support
34
34
  * Guardrails
35
+ * Pydantic Logfire
35
36
  * Tested & Secure
36
37
  * Built in Python
37
38
  * Powers [CometHeart](https://cometheart.com)
@@ -43,6 +44,7 @@ Build your AI agents in three lines of code!
43
44
  * Fast AI responses
44
45
  * Solana Ecosystem Integration via [AgentiPy](https://github.com/niceberginc/agentipy)
45
46
  * MCP tool usage with first-class support for [Zapier](https://zapier.com/mcp)
47
+ * Integrated observability and tracing via [Pydantic Logfire](https://logfire.pydantic.dev/)
46
48
  * Designed for a multi-agent swarm
47
49
  * Seamless text and audio streaming with real-time multi-modal processing
48
50
  * Persistent memory that preserves context across all agent interactions
@@ -61,10 +63,13 @@ Build your AI agents in three lines of code!
61
63
  ### Tech
62
64
 
63
65
  * [Python](https://python.org) - Programming Language
64
- * [OpenAI](https://openai.com) - AI Provider
66
+ * [OpenAI](https://openai.com) - AI Model Provider
65
67
  * [MongoDB](https://mongodb.com) - Conversational History (optional)
66
68
  * [Zep Cloud](https://getzep.com) - Conversational Memory (optional)
67
69
  * [Pinecone](https://pinecone.io) - Knowledge Base (optional)
70
+ * [AgentiPy](https://agentipy.fun) - Solana Ecosystem (optional)
71
+ * [Zapier](https://zapier.com) - App Integrations (optional)
72
+ * [Pydantic Logfire](https://logfire.pydantic.dev) - Observability and Tracing (optional)
68
73
 
69
74
  ### AI Models Used
70
75
 
@@ -288,6 +293,16 @@ config = {
288
293
  }
289
294
  ```
290
295
 
296
+ ### Observability and Tracing
297
+
298
+ ```python
299
+ config = {
300
+ "logfire": {
301
+ "api_key": "your-logfire-write-token",
302
+ },
303
+ }
304
+ ```
305
+
291
306
  ### Knowledge Base
292
307
 
293
308
  The Knowledge Base (KB) is meant to store text values and/or small PDFs.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "solana-agent"
3
- version = "28.0.0"
3
+ version = "28.1.0"
4
4
  description = "AI Agents for Solana"
5
5
  authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
6
6
  license = "MIT"
@@ -34,6 +34,7 @@ llama-index-core = "^0.12.30"
34
34
  llama-index-embeddings-openai = "^0.3.1"
35
35
  pypdf = "^5.4.0"
36
36
  scrubadub = "^2.0.1"
37
+ logfire = "^3.14.0"
37
38
 
38
39
  [tool.poetry.group.dev.dependencies]
39
40
  pytest = "^8.3.5"
@@ -10,6 +10,7 @@ from openai import AsyncOpenAI
10
10
  from pydantic import BaseModel
11
11
  import instructor
12
12
  from instructor import Mode
13
+ import logfire
13
14
 
14
15
  from solana_agent.interfaces.providers.llm import LLMProvider
15
16
 
@@ -26,8 +27,21 @@ DEFAULT_TTS_MODEL = "tts-1"
26
27
  class OpenAIAdapter(LLMProvider):
27
28
  """OpenAI implementation of LLMProvider with web search capabilities."""
28
29
 
29
- def __init__(self, api_key: str):
30
+ def __init__(self, api_key: str, logfire_api_key: Optional[str] = None):
30
31
  self.client = AsyncOpenAI(api_key=api_key)
32
+
33
+ self.logfire = False
34
+ if logfire_api_key:
35
+ try:
36
+ logfire.configure(token=logfire_api_key)
37
+ self.logfire = True
38
+ print("Logfire configured successfully.") # Optional: confirmation log
39
+ except Exception as e:
40
+ print(
41
+ f"Failed to configure Logfire: {e}"
42
+ ) # Log error if configuration fails
43
+ self.logfire = False # Ensure logfire is False if config fails
44
+
31
45
  self.parse_model = DEFAULT_PARSE_MODEL
32
46
  self.text_model = DEFAULT_CHAT_MODEL
33
47
  self.transcription_model = DEFAULT_TRANSCRIPTION_MODEL
@@ -65,6 +79,7 @@ class OpenAIAdapter(LLMProvider):
65
79
  Audio bytes as they become available
66
80
  """
67
81
  try:
82
+ logfire.instrument_openai(self.client)
68
83
  async with self.client.audio.speech.with_streaming_response.create(
69
84
  model=self.tts_model,
70
85
  voice=voice,
@@ -106,6 +121,7 @@ class OpenAIAdapter(LLMProvider):
106
121
  Transcript text chunks as they become available
107
122
  """
108
123
  try:
124
+ logfire.instrument_openai(self.client)
109
125
  async with self.client.audio.transcriptions.with_streaming_response.create(
110
126
  model=self.transcription_model,
111
127
  file=(f"file.{input_format}", audio_bytes),
@@ -149,6 +165,9 @@ class OpenAIAdapter(LLMProvider):
149
165
  else:
150
166
  client = self.client
151
167
 
168
+ if self.logfire:
169
+ logfire.instrument_openai(client)
170
+
152
171
  try:
153
172
  # Make the non-streaming API call
154
173
  response = await client.chat.completions.create(**request_params)
@@ -186,6 +205,9 @@ class OpenAIAdapter(LLMProvider):
186
205
  else:
187
206
  client = self.client
188
207
 
208
+ if self.logfire:
209
+ logfire.instrument_openai(client)
210
+
189
211
  if model:
190
212
  self.parse_model = model
191
213
 
@@ -229,6 +251,9 @@ class OpenAIAdapter(LLMProvider):
229
251
  else:
230
252
  client = self.client
231
253
 
254
+ if self.logfire:
255
+ logfire.instrument_openai(client)
256
+
232
257
  if model:
233
258
  self.parse_model = model
234
259
 
@@ -288,6 +313,9 @@ class OpenAIAdapter(LLMProvider):
288
313
  # Replace newlines with spaces as recommended by OpenAI
289
314
  text = text.replace("\n", " ")
290
315
 
316
+ if self.logfire:
317
+ logfire.instrument_openai(self.client)
318
+
291
319
  response = await self.client.embeddings.create(
292
320
  input=[text], model=embedding_model, dimensions=embedding_dimensions
293
321
  )
@@ -78,6 +78,10 @@ class SolanaAgentFactory:
78
78
  # Create adapters
79
79
 
80
80
  if "mongo" in config:
81
+ if "connection_string" not in config["mongo"]:
82
+ raise ValueError("MongoDB connection string is required.")
83
+ if "database" not in config["mongo"]:
84
+ raise ValueError("MongoDB database name is required.")
81
85
  db_adapter = MongoDBAdapter(
82
86
  connection_string=config["mongo"]["connection_string"],
83
87
  database_name=config["mongo"]["database"],
@@ -85,9 +89,21 @@ class SolanaAgentFactory:
85
89
  else:
86
90
  db_adapter = None
87
91
 
88
- llm_adapter = OpenAIAdapter(
89
- api_key=config["openai"]["api_key"],
90
- )
92
+ if "logfire" in config:
93
+ if "api_key" not in config["logfire"]:
94
+ raise ValueError("Pydantic Logfire API key is required.")
95
+ if "openai" not in config or "api_key" not in config["openai"]:
96
+ raise ValueError("OpenAI API key is required.")
97
+ llm_adapter = OpenAIAdapter(
98
+ api_key=config["openai"]["api_key"],
99
+ logfire_api_key=config["logfire"].get("api_key"),
100
+ )
101
+ else:
102
+ if "openai" not in config or "api_key" not in config["openai"]:
103
+ raise ValueError("OpenAI API key is required.")
104
+ llm_adapter = OpenAIAdapter(
105
+ api_key=config["openai"].get("api_key"),
106
+ )
91
107
 
92
108
  # Create business mission if specified in config
93
109
  business_mission = None
@@ -782,10 +782,6 @@ class AgentService(AgentServiceInterface):
782
782
 
783
783
  tools_json = json.dumps(simplified_tools, indent=2)
784
784
 
785
- logger.info(
786
- f"Generated tool usage prompt for agent '{agent_name}': {tools_json}"
787
- )
788
-
789
785
  return f"""
790
786
  AVAILABLE TOOLS:
791
787
  {tools_json}
File without changes