solana-agent 29.1.5__tar.gz → 29.2.1__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 (43) hide show
  1. {solana_agent-29.1.5 → solana_agent-29.2.1}/PKG-INFO +22 -14
  2. {solana_agent-29.1.5 → solana_agent-29.2.1}/README.md +16 -8
  3. {solana_agent-29.1.5 → solana_agent-29.2.1}/pyproject.toml +7 -7
  4. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/adapters/openai_adapter.py +12 -10
  5. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/factories/agent_factory.py +44 -5
  6. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/providers/llm.py +5 -1
  7. solana_agent-29.2.1/solana_agent/services/agent.py +467 -0
  8. solana_agent-29.1.5/solana_agent/services/agent.py +0 -955
  9. {solana_agent-29.1.5 → solana_agent-29.2.1}/LICENSE +0 -0
  10. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/__init__.py +0 -0
  11. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/adapters/__init__.py +0 -0
  12. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/adapters/mongodb_adapter.py +0 -0
  13. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/adapters/pinecone_adapter.py +0 -0
  14. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/cli.py +0 -0
  15. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/client/__init__.py +0 -0
  16. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/client/solana_agent.py +0 -0
  17. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/domains/__init__.py +0 -0
  18. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/domains/agent.py +0 -0
  19. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/domains/routing.py +0 -0
  20. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/factories/__init__.py +0 -0
  21. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/guardrails/pii.py +0 -0
  22. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/__init__.py +0 -0
  23. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/client/client.py +0 -0
  24. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/guardrails/guardrails.py +0 -0
  25. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/plugins/plugins.py +0 -0
  26. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/providers/data_storage.py +0 -0
  27. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/providers/memory.py +0 -0
  28. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/providers/vector_storage.py +0 -0
  29. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/services/agent.py +0 -0
  30. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/services/knowledge_base.py +0 -0
  31. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/services/query.py +0 -0
  32. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/interfaces/services/routing.py +0 -0
  33. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/plugins/__init__.py +0 -0
  34. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/plugins/manager.py +0 -0
  35. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/plugins/registry.py +0 -0
  36. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/plugins/tools/__init__.py +0 -0
  37. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/plugins/tools/auto_tool.py +0 -0
  38. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/repositories/__init__.py +0 -0
  39. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/repositories/memory.py +0 -0
  40. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/services/__init__.py +0 -0
  41. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/services/knowledge_base.py +0 -0
  42. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/services/query.py +0 -0
  43. {solana_agent-29.1.5 → solana_agent-29.2.1}/solana_agent/services/routing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 29.1.5
3
+ Version: 29.2.1
4
4
  Summary: AI Agents for Solana
5
5
  License: MIT
6
6
  Keywords: solana,solana ai,solana agent,ai,ai agent,ai agents
@@ -14,19 +14,19 @@ Classifier: Programming Language :: Python :: 3
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
- Requires-Dist: instructor (==1.8.2)
17
+ Requires-Dist: instructor (==1.8.3)
18
18
  Requires-Dist: llama-index-core (==0.12.37)
19
19
  Requires-Dist: llama-index-embeddings-openai (==0.3.1)
20
- Requires-Dist: logfire (==3.16.0)
21
- Requires-Dist: openai (==1.79.0)
20
+ Requires-Dist: logfire (==3.16.1)
21
+ Requires-Dist: openai (==1.82.0)
22
22
  Requires-Dist: pillow (==11.2.1)
23
- Requires-Dist: pinecone (==6.0.2)
23
+ Requires-Dist: pinecone (==7.0.1)
24
24
  Requires-Dist: pydantic (>=2)
25
25
  Requires-Dist: pymongo (==4.13.0)
26
26
  Requires-Dist: pypdf (==5.5.0)
27
27
  Requires-Dist: rich (>=13,<14.0)
28
28
  Requires-Dist: scrubadub (==2.0.1)
29
- Requires-Dist: typer (==0.15.4)
29
+ Requires-Dist: typer (==0.16.0)
30
30
  Requires-Dist: zep-cloud (==2.12.3)
31
31
  Project-URL: Documentation, https://docs.solana-agent.com
32
32
  Project-URL: Homepage, https://solana-agent.com
@@ -41,9 +41,7 @@ Description-Content-Type: text/markdown
41
41
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
42
42
  [![codecov](https://img.shields.io/codecov/c/github/truemagic-coder/solana-agent/main.svg)](https://codecov.io/gh/truemagic-coder/solana-agent)
43
43
  [![Build Status](https://img.shields.io/github/actions/workflow/status/truemagic-coder/solana-agent/ci.yml?branch=main)](https://github.com/truemagic-coder/solana-agent/actions/workflows/ci.yml)
44
- [![Lines of Code](https://tokei.rs/b1/github/truemagic-coder/solana-agent?type=python&category=code&style=flat)](https://github.com/truemagic-coder/solana-agent)
45
44
  [![Ruff Style](https://img.shields.io/badge/style-ruff-41B5BE)](https://github.com/astral-sh/ruff)
46
- [![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/truemagic-coder/solana-agent)](https://libraries.io/pypi/solana-agent)
47
45
 
48
46
  ![Solana Agent Logo](https://dl.walletbubbles.com/solana-agent-logo.png?width=200)
49
47
 
@@ -116,7 +114,7 @@ Build your AI agents in three lines of code!
116
114
 
117
115
  **OpenAI**
118
116
  * [gpt-4.1](https://platform.openai.com/docs/models/gpt-4.1) (agent - can be overridden)
119
- * [gpt-4.1-nano](https://platform.openai.com/docs/models/gpt-4.1-nano) (router)
117
+ * [gpt-4.1-nano](https://platform.openai.com/docs/models/gpt-4.1-nano) (router - can be overridden)
120
118
  * [text-embedding-3-large](https://platform.openai.com/docs/models/text-embedding-3-large) (embedding)
121
119
  * [tts-1](https://platform.openai.com/docs/models/tts-1) (audio TTS)
122
120
  * [gpt-4o-mini-transcribe](https://platform.openai.com/docs/models/gpt-4o-mini-transcribe) (audio transcription)
@@ -125,12 +123,16 @@ Build your AI agents in three lines of code!
125
123
 
126
124
  **Grok**
127
125
  * [grok-3-fast](https://x.ai/api#pricing) (agent - optional)
126
+ * [grok-3-mini-fast](https://x.ai/api#pricing) (router - optional)
128
127
  * [grok-2-image](https://x.ai/api#pricing) (image generation - optional)
129
128
 
130
129
  **Gemini**
131
- * [gemini-2.5-flash-preview-04-17](https://ai.google.dev/gemini-api/docs/models#gemini-2.5-flash-preview) (agent - optional)
130
+ * [gemini-2.5-flash-preview-04-17](https://ai.google.dev/gemini-api/docs/models#gemini-2.5-flash-preview) (agent & router - optional)
132
131
  * [imagen-3.0-generate-002](https://ai.google.dev/gemini-api/docs/models#imagen-3) (image generation - optional)
133
132
 
133
+ **Ollama**
134
+ * [gemma:4b-it-qat](https://ollama.com/library/gemma3) - (agent & router - optional)
135
+
134
136
  ## Installation
135
137
 
136
138
  You can install Solana Agent using pip:
@@ -434,8 +436,6 @@ config = {
434
436
 
435
437
  ### Grok
436
438
 
437
- `grok-3-fast` can be used instead of `gpt-4.1` for the agent model
438
-
439
439
  ```python
440
440
  config = {
441
441
  "grok": {
@@ -446,8 +446,6 @@ config = {
446
446
 
447
447
  ### Gemini
448
448
 
449
- `gemini-2.5-pro-preview-03-25` can be used instead of `gpt-4.1` for the agent model
450
-
451
449
  ```python
452
450
  config = {
453
451
  "gemini": {
@@ -456,6 +454,16 @@ config = {
456
454
  }
457
455
  ```
458
456
 
457
+ ### Ollama
458
+
459
+ ```python
460
+ config = {
461
+ "ollama": {
462
+ "api_key": "use-this-key-1010"
463
+ },
464
+ }
465
+ ```
466
+
459
467
  ### Knowledge Base
460
468
 
461
469
  The Knowledge Base (KB) is meant to store text values and/or PDFs (extracts text) - can handle very large PDFs.
@@ -6,9 +6,7 @@
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
7
7
  [![codecov](https://img.shields.io/codecov/c/github/truemagic-coder/solana-agent/main.svg)](https://codecov.io/gh/truemagic-coder/solana-agent)
8
8
  [![Build Status](https://img.shields.io/github/actions/workflow/status/truemagic-coder/solana-agent/ci.yml?branch=main)](https://github.com/truemagic-coder/solana-agent/actions/workflows/ci.yml)
9
- [![Lines of Code](https://tokei.rs/b1/github/truemagic-coder/solana-agent?type=python&category=code&style=flat)](https://github.com/truemagic-coder/solana-agent)
10
9
  [![Ruff Style](https://img.shields.io/badge/style-ruff-41B5BE)](https://github.com/astral-sh/ruff)
11
- [![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/truemagic-coder/solana-agent)](https://libraries.io/pypi/solana-agent)
12
10
 
13
11
  ![Solana Agent Logo](https://dl.walletbubbles.com/solana-agent-logo.png?width=200)
14
12
 
@@ -81,7 +79,7 @@ Build your AI agents in three lines of code!
81
79
 
82
80
  **OpenAI**
83
81
  * [gpt-4.1](https://platform.openai.com/docs/models/gpt-4.1) (agent - can be overridden)
84
- * [gpt-4.1-nano](https://platform.openai.com/docs/models/gpt-4.1-nano) (router)
82
+ * [gpt-4.1-nano](https://platform.openai.com/docs/models/gpt-4.1-nano) (router - can be overridden)
85
83
  * [text-embedding-3-large](https://platform.openai.com/docs/models/text-embedding-3-large) (embedding)
86
84
  * [tts-1](https://platform.openai.com/docs/models/tts-1) (audio TTS)
87
85
  * [gpt-4o-mini-transcribe](https://platform.openai.com/docs/models/gpt-4o-mini-transcribe) (audio transcription)
@@ -90,12 +88,16 @@ Build your AI agents in three lines of code!
90
88
 
91
89
  **Grok**
92
90
  * [grok-3-fast](https://x.ai/api#pricing) (agent - optional)
91
+ * [grok-3-mini-fast](https://x.ai/api#pricing) (router - optional)
93
92
  * [grok-2-image](https://x.ai/api#pricing) (image generation - optional)
94
93
 
95
94
  **Gemini**
96
- * [gemini-2.5-flash-preview-04-17](https://ai.google.dev/gemini-api/docs/models#gemini-2.5-flash-preview) (agent - optional)
95
+ * [gemini-2.5-flash-preview-04-17](https://ai.google.dev/gemini-api/docs/models#gemini-2.5-flash-preview) (agent & router - optional)
97
96
  * [imagen-3.0-generate-002](https://ai.google.dev/gemini-api/docs/models#imagen-3) (image generation - optional)
98
97
 
98
+ **Ollama**
99
+ * [gemma:4b-it-qat](https://ollama.com/library/gemma3) - (agent & router - optional)
100
+
99
101
  ## Installation
100
102
 
101
103
  You can install Solana Agent using pip:
@@ -399,8 +401,6 @@ config = {
399
401
 
400
402
  ### Grok
401
403
 
402
- `grok-3-fast` can be used instead of `gpt-4.1` for the agent model
403
-
404
404
  ```python
405
405
  config = {
406
406
  "grok": {
@@ -411,8 +411,6 @@ config = {
411
411
 
412
412
  ### Gemini
413
413
 
414
- `gemini-2.5-pro-preview-03-25` can be used instead of `gpt-4.1` for the agent model
415
-
416
414
  ```python
417
415
  config = {
418
416
  "gemini": {
@@ -421,6 +419,16 @@ config = {
421
419
  }
422
420
  ```
423
421
 
422
+ ### Ollama
423
+
424
+ ```python
425
+ config = {
426
+ "ollama": {
427
+ "api_key": "use-this-key-1010"
428
+ },
429
+ }
430
+ ```
431
+
424
432
  ### Knowledge Base
425
433
 
426
434
  The Knowledge Base (KB) is meant to store text values and/or PDFs (extracts text) - can handle very large PDFs.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "solana-agent"
3
- version = "29.1.5"
3
+ version = "29.2.1"
4
4
  description = "AI Agents for Solana"
5
5
  authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
6
6
  license = "MIT"
@@ -24,25 +24,25 @@ python_paths = [".", "tests"]
24
24
 
25
25
  [tool.poetry.dependencies]
26
26
  python = ">=3.12,<4.0"
27
- openai = "1.79.0"
27
+ openai = "1.82.0"
28
28
  pydantic = ">=2"
29
29
  pymongo = "4.13.0"
30
30
  zep-cloud = "2.12.3"
31
- instructor = "1.8.2"
32
- pinecone = "6.0.2"
31
+ instructor = "1.8.3"
32
+ pinecone = "7.0.1"
33
33
  llama-index-core = "0.12.37"
34
34
  llama-index-embeddings-openai = "0.3.1"
35
35
  pypdf = "5.5.0"
36
36
  scrubadub = "2.0.1"
37
- logfire = "3.16.0"
38
- typer = "0.15.4"
37
+ logfire = "3.16.1"
38
+ typer = "0.16.0"
39
39
  rich = ">=13,<14.0"
40
40
  pillow = "11.2.1"
41
41
 
42
42
  [tool.poetry.group.dev.dependencies]
43
43
  pytest = "^8.3.5"
44
44
  pytest-cov = "^6.1.1"
45
- pytest-asyncio = "^0.26.0"
45
+ pytest-asyncio = "^1.0.0"
46
46
  pytest-mock = "^3.14.0"
47
47
  pytest-github-actions-annotate-failures = "^0.3.0"
48
48
  sphinx = "^8.2.3"
@@ -163,8 +163,10 @@ class OpenAIAdapter(LLMProvider):
163
163
  api_key: Optional[str] = None,
164
164
  base_url: Optional[str] = None,
165
165
  model: Optional[str] = None,
166
- ) -> str: # pragma: no cover
167
- """Generate text from OpenAI models as a single string (no images)."""
166
+ functions: Optional[List[Dict[str, Any]]] = None,
167
+ function_call: Optional[Union[str, Dict[str, Any]]] = None,
168
+ ) -> Any: # pragma: no cover
169
+ """Generate text or function call from OpenAI models."""
168
170
  messages = []
169
171
  if system_prompt:
170
172
  messages.append({"role": "system", "content": system_prompt})
@@ -174,6 +176,10 @@ class OpenAIAdapter(LLMProvider):
174
176
  "messages": messages,
175
177
  "model": model or self.text_model,
176
178
  }
179
+ if functions:
180
+ request_params["functions"] = functions
181
+ if function_call:
182
+ request_params["function_call"] = function_call
177
183
 
178
184
  if api_key and base_url:
179
185
  client = AsyncOpenAI(api_key=api_key, base_url=base_url)
@@ -185,17 +191,13 @@ class OpenAIAdapter(LLMProvider):
185
191
 
186
192
  try:
187
193
  response = await client.chat.completions.create(**request_params)
188
- if response.choices and response.choices[0].message.content:
189
- return response.choices[0].message.content
190
- else:
191
- logger.warning("Received non-streaming response with no content.")
192
- return ""
193
- except OpenAIError as e: # Catch specific OpenAI errors
194
+ return response
195
+ except OpenAIError as e:
194
196
  logger.error(f"OpenAI API error during text generation: {e}")
195
- return f"I apologize, but I encountered an API error: {e}"
197
+ return None
196
198
  except Exception as e:
197
199
  logger.exception(f"Error in generate_text: {e}")
198
- return f"I apologize, but I encountered an unexpected error: {e}"
200
+ return None
199
201
 
200
202
  def _calculate_gpt41_image_cost(self, width: int, height: int, model: str) -> int:
201
203
  """Calculates the token cost for an image with GPT-4.1 models."""
@@ -168,6 +168,12 @@ class SolanaAgentFactory:
168
168
  output_guardrails=output_guardrails,
169
169
  )
170
170
 
171
+ # Create routing service
172
+ routing_service = RoutingService(
173
+ llm_provider=llm_adapter,
174
+ agent_service=agent_service,
175
+ )
176
+
171
177
  if "gemini" in config and "api_key" in config["gemini"]:
172
178
  # Create primary services
173
179
  agent_service = AgentService(
@@ -180,6 +186,15 @@ class SolanaAgentFactory:
180
186
  output_guardrails=output_guardrails,
181
187
  ) # pragma: no cover
182
188
 
189
+ # Create routing service
190
+ routing_service = RoutingService(
191
+ llm_provider=llm_adapter,
192
+ agent_service=agent_service,
193
+ api_key=config["gemini"]["api_key"],
194
+ base_url="https://generativelanguage.googleapis.com/v1beta/openai/",
195
+ model="gemini-2.5-flash-preview-05-20",
196
+ ) # pragma: no cover
197
+
183
198
  elif "grok" in config and "api_key" in config["grok"]:
184
199
  # Create primary services
185
200
  agent_service = AgentService(
@@ -192,11 +207,35 @@ class SolanaAgentFactory:
192
207
  output_guardrails=output_guardrails,
193
208
  ) # pragma: no cover
194
209
 
195
- # Create routing service
196
- routing_service = RoutingService(
197
- llm_provider=llm_adapter,
198
- agent_service=agent_service,
199
- )
210
+ # Create routing service
211
+ routing_service = RoutingService(
212
+ llm_provider=llm_adapter,
213
+ agent_service=agent_service,
214
+ api_key=config["gemini"]["api_key"],
215
+ base_url="https://api.x.ai/v1",
216
+ model="grok-3-mini-fast",
217
+ ) # pragma: no cover
218
+
219
+ elif "ollama" in config and "api_key" in config["ollama"]:
220
+ # Create primary services
221
+ agent_service = AgentService(
222
+ llm_provider=llm_adapter,
223
+ business_mission=business_mission,
224
+ config=config,
225
+ api_key=config["ollama"]["api_key"],
226
+ base_url="http://localhost:11434/v1",
227
+ model="gemma3:4b-it-qat",
228
+ output_guardrails=output_guardrails,
229
+ ) # pragma: no cover
230
+
231
+ # Create routing service
232
+ routing_service = RoutingService(
233
+ llm_provider=llm_adapter,
234
+ agent_service=agent_service,
235
+ api_key=config["ollama"]["api_key"],
236
+ base_url="http://localhost:11434/v1",
237
+ model="gemma3:4b-it-qat",
238
+ ) # pragma: no cover
200
239
 
201
240
  # Debug the agent service tool registry
202
241
  logger.debug( # Use logger.debug
@@ -1,6 +1,8 @@
1
1
  from abc import ABC, abstractmethod
2
2
  from typing import (
3
+ Any,
3
4
  AsyncGenerator,
5
+ Dict,
4
6
  List,
5
7
  Literal,
6
8
  Optional,
@@ -26,7 +28,9 @@ class LLMProvider(ABC):
26
28
  api_key: Optional[str] = None,
27
29
  base_url: Optional[str] = None,
28
30
  model: Optional[str] = None,
29
- ) -> str:
31
+ functions: Optional[List[Dict[str, Any]]] = None,
32
+ function_call: Optional[Union[str, Dict[str, Any]]] = None,
33
+ ) -> Any:
30
34
  """Generate text from the language model."""
31
35
  pass
32
36