solana-agent 26.0.0__py3-none-any.whl → 27.1.0__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.
@@ -170,7 +170,6 @@ class OpenAIAdapter(LLMProvider):
170
170
  if model:
171
171
  self.parse_model = model
172
172
 
173
- # Create a patched client with TOOLS_STRICT mode
174
173
  patched_client = instructor.from_openai(
175
174
  client, mode=Mode.TOOLS_STRICT)
176
175
 
@@ -187,9 +186,17 @@ class OpenAIAdapter(LLMProvider):
187
186
  f"Error with instructor parsing (TOOLS_STRICT mode): {e}")
188
187
 
189
188
  try:
189
+ if api_key and base_url:
190
+ client = AsyncOpenAI(api_key=api_key, base_url=base_url)
191
+ else:
192
+ client = self.client
193
+
194
+ if model:
195
+ self.parse_model = model
196
+
190
197
  # First fallback: Try regular JSON mode
191
198
  patched_client = instructor.from_openai(
192
- self.client, mode=Mode.JSON)
199
+ client, mode=Mode.JSON)
193
200
  response = await patched_client.chat.completions.create(
194
201
  model=self.parse_model,
195
202
  messages=messages,
@@ -201,6 +208,15 @@ class OpenAIAdapter(LLMProvider):
201
208
  print(f"JSON mode fallback also failed: {json_error}")
202
209
 
203
210
  try:
211
+ if api_key and base_url:
212
+ client = AsyncOpenAI(
213
+ api_key=api_key, base_url=base_url)
214
+ else:
215
+ client = self.client
216
+
217
+ if model:
218
+ self.parse_model = model
219
+
204
220
  # Final fallback: Manual extraction with a detailed prompt
205
221
  fallback_system_prompt = f"""
206
222
  {system_prompt}
@@ -212,7 +228,7 @@ class OpenAIAdapter(LLMProvider):
212
228
  """
213
229
 
214
230
  # Regular completion without instructor
215
- completion = await self.client.chat.completions.create(
231
+ completion = await client.chat.completions.create(
216
232
  model=self.parse_model,
217
233
  messages=[
218
234
  {"role": "system", "content": fallback_system_prompt},
@@ -86,7 +86,7 @@ class SolanaAgentFactory:
86
86
  zep_api_key=config["zep"].get("api_key")
87
87
  )
88
88
 
89
- if "gemini" in config and "api_key" in config["gemini"]:
89
+ if "gemini" in config and "api_key" in config["gemini"] and not "grok" in config:
90
90
  # Create primary services
91
91
  agent_service = AgentService(
92
92
  llm_provider=llm_adapter,
@@ -105,6 +105,43 @@ class SolanaAgentFactory:
105
105
  base_url="https://generativelanguage.googleapis.com/v1beta/openai/",
106
106
  model="gemini-2.0-flash",
107
107
  )
108
+
109
+ elif "gemini" in config and "api_key" in config["gemini"] and "grok" in config and "api_key" in config["grok"]:
110
+ # Create primary services
111
+ agent_service = AgentService(
112
+ llm_provider=llm_adapter,
113
+ business_mission=business_mission,
114
+ config=config,
115
+ api_key=config["grok"]["api_key"],
116
+ base_url="https://api.x.ai/v1",
117
+ model="grok-3-mini-fast-beta",
118
+ )
119
+ # Create routing service
120
+ routing_service = RoutingService(
121
+ llm_provider=llm_adapter,
122
+ agent_service=agent_service,
123
+ api_key=config["gemini"]["api_key"],
124
+ base_url="https://generativelanguage.googleapis.com/v1beta/openai/",
125
+ model="gemini-2.0-flash",
126
+ )
127
+
128
+ elif "grok" in config and "api_key" in config["grok"] and not "gemini" in config:
129
+ # Create primary services
130
+ agent_service = AgentService(
131
+ llm_provider=llm_adapter,
132
+ business_mission=business_mission,
133
+ config=config,
134
+ api_key=config["grok"]["api_key"],
135
+ base_url="https://api.x.ai/v1",
136
+ model="grok-3-mini-fast-beta",
137
+ )
138
+
139
+ # Create routing service
140
+ routing_service = RoutingService(
141
+ llm_provider=llm_adapter,
142
+ agent_service=agent_service,
143
+ )
144
+
108
145
  else:
109
146
  # Create primary services
110
147
  agent_service = AgentService(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 26.0.0
3
+ Version: 27.1.0
4
4
  Summary: Agentic IQ
5
5
  License: MIT
6
6
  Keywords: ai,openai,ai agents,agi
@@ -15,10 +15,10 @@ Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
17
  Requires-Dist: instructor (>=1.7.9,<2.0.0)
18
- Requires-Dist: openai (>=1.71.0,<2.0.0)
19
- Requires-Dist: pydantic (>=2.11.2,<3.0.0)
20
- Requires-Dist: pymongo (>=4.11.3,<5.0.0)
21
- Requires-Dist: zep-cloud (>=2.9.0,<3.0.0)
18
+ Requires-Dist: openai (>=1.72.0,<2.0.0)
19
+ Requires-Dist: pydantic (>=2.11.3,<3.0.0)
20
+ Requires-Dist: pymongo (>=4.12.0,<5.0.0)
21
+ Requires-Dist: zep-cloud (>=2.10.1,<3.0.0)
22
22
  Project-URL: Documentation, https://docs.solana-agent.com
23
23
  Project-URL: Repository, https://github.com/truemagic-coder/solana-agent
24
24
  Description-Content-Type: text/markdown
@@ -76,16 +76,25 @@ Build your AI business in three lines of code!
76
76
  ### Tech
77
77
 
78
78
  * [Python](https://python.org) - Programming Language
79
- * [OpenAI](https://openai.com) & [Gemini](https://aistudio.google.com/) - LLM Providers
79
+ * [OpenAI](https://openai.com), [Google](https://ai.google.dev), [xAI](https://x.ai) - LLM Providers
80
80
  * [MongoDB](https://mongodb.com) - Conversational History (optional)
81
81
  * [Zep Cloud](https://getzep.com) - Conversational Memory (optional)
82
82
 
83
83
  ### LLMs
84
84
 
85
- * [gemini-2.0-flash](https://ai.google.dev/gemini-api/docs/models#gemini-2.0-flash) or [gpt-4o-mini](https://platform.openai.com/docs/models/gpt-4o-mini)
85
+ * [gpt-4o-mini](https://platform.openai.com/docs/models/gpt-4o-mini)
86
+ * [gemini-2.0-flash](https://ai.google.dev/gemini-api/docs/models#gemini-2.0-flash)
87
+ * [grok-3-mini-fast-beta](https://docs.x.ai/docs/models#models-and-pricing)
86
88
  * [tts-1](https://platform.openai.com/docs/models/tts-1)
87
89
  * [gpt-4o-mini-transcribe](https://platform.openai.com/docs/models/gpt-4o-mini-transcribe)
88
90
 
91
+ It is recommended to use all three LLM providers as it is the best setup.
92
+
93
+ Gemini makes the routing about 2x faster.
94
+
95
+ Grok is a fast reasoning model and makes the answers and conversation much better.
96
+
97
+ OpenAI is required while Gemini and Grok are optional.
89
98
 
90
99
  ## Installation
91
100
 
@@ -146,6 +155,9 @@ Keep this in mind while designing your agentic systems using Solana Agent.
146
155
  from solana_agent import SolanaAgent
147
156
 
148
157
  config = {
158
+ "grok": {
159
+ "api_key": "your-grok-api-key",
160
+ },
149
161
  "gemini": {
150
162
  "api_key": "your-gemini-api-key",
151
163
  },
@@ -178,6 +190,9 @@ async for response in solana_agent.process("user123", "What are the latest AI de
178
190
  from solana_agent import SolanaAgent
179
191
 
180
192
  config = {
193
+ "grok": {
194
+ "api_key": "your-grok-api-key",
195
+ },
181
196
  "gemini": {
182
197
  "api_key": "your-gemini-api-key",
183
198
  },
@@ -212,6 +227,9 @@ async for response in solana_agent.process("user123", audio_content, output_form
212
227
  from solana_agent import SolanaAgent
213
228
 
214
229
  config = {
230
+ "grok": {
231
+ "api_key": "your-grok-api-key",
232
+ },
215
233
  "gemini": {
216
234
  "api_key": "your-gemini-api-key",
217
235
  },
@@ -244,6 +262,9 @@ async for response in solana_agent.process("user123", "What is the latest news o
244
262
  from solana_agent import SolanaAgent
245
263
 
246
264
  config = {
265
+ "grok": {
266
+ "api_key": "your-grok-api-key",
267
+ },
247
268
  "gemini": {
248
269
  "api_key": "your-gemini-api-key",
249
270
  },
@@ -330,6 +351,9 @@ Tools can be used from plugins like Solana Agent Kit (sakit) or via inline tools
330
351
  from solana_agent import SolanaAgent
331
352
 
332
353
  config = {
354
+ "grok": {
355
+ "api_key": "your-grok-api-key",
356
+ },
333
357
  "gemini": {
334
358
  "api_key": "your-gemini-api-key",
335
359
  },
@@ -415,6 +439,9 @@ class TestTool(Tool):
415
439
  }
416
440
 
417
441
  config = {
442
+ "grok": {
443
+ "api_key": "your-grok-api-key",
444
+ },
418
445
  "gemini": {
419
446
  "api_key": "your-gemini-api-key",
420
447
  },
@@ -457,6 +484,9 @@ This knowledge is accessible to all your AI agents.
457
484
  from solana_agent import SolanaAgent
458
485
 
459
486
  config = {
487
+ "grok": {
488
+ "api_key": "your-grok-api-key",
489
+ },
460
490
  "gemini": {
461
491
  "api_key": "your-gemini-api-key",
462
492
  },
@@ -487,6 +517,9 @@ from solana_agent import SolanaAgent
487
517
  from solana_agent.interfaces.services.routing import RoutingService as RoutingServiceInterface
488
518
 
489
519
  config = {
520
+ "grok": {
521
+ "api_key": "your-grok-api-key",
522
+ },
490
523
  "gemini": {
491
524
  "api_key": "your-gemini-api-key",
492
525
  },
@@ -542,6 +575,12 @@ The official example app written in FastAPI and Next.js
542
575
 
543
576
  [Solana Agent Example App](https://github.com/truemagic-coder/solana-agent-app)
544
577
 
578
+ ## Demo App
579
+
580
+ The official demo app written in FastAPI and Next.js
581
+
582
+ [Solana Agent Demo App](https://demo.solana-agent.com)
583
+
545
584
  ## Agent Framework Comparisons
546
585
 
547
586
  [Compare Python Agent Frameworks](https://github.com/truemagic-coder/solana-agent/wiki/Agent-Framework-Comparisons)
@@ -1,6 +1,6 @@
1
1
  solana_agent/__init__.py,sha256=ceYeUpjIitpln8YK1r0JVJU8mzG6cRPYu-HLny3d-Tw,887
2
2
  solana_agent/adapters/__init__.py,sha256=tiEEuuy0NF3ngc_tGEcRTt71zVI58v3dYY9RvMrF2Cg,204
3
- solana_agent/adapters/llm_adapter.py,sha256=1MdDEtF0frG-ZvaDrcBUtzPa3u9oiPnw-JxEzdYRfM8,8560
3
+ solana_agent/adapters/llm_adapter.py,sha256=Zx2-8LMixocDrymBFpS_UkUNm9PyL50XXLqlFCjdtFk,9050
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
6
  solana_agent/client/solana_agent.py,sha256=cjzTUYIaCpH152XlkX7YxeY6z3Jja7KNfkAFdTxmZyc,5208
@@ -8,7 +8,7 @@ solana_agent/domains/__init__.py,sha256=HiC94wVPRy-QDJSSRywCRrhrFfTBeHjfi5z-QfZv
8
8
  solana_agent/domains/agent.py,sha256=WTo-pEc66V6D_35cpDE-kTsw1SJM-dtylPZ7em5em7Q,2659
9
9
  solana_agent/domains/routing.py,sha256=UDlgTjUoC9xIBVYu_dnf9-KG_bBgdEXAv_UtDOrYo0w,650
10
10
  solana_agent/factories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- solana_agent/factories/agent_factory.py,sha256=mo5ggQR5I1ZCjYknv6vD1U-393WbMsTQEbM6YTb2pRA,6382
11
+ solana_agent/factories/agent_factory.py,sha256=tVy29vHObuyALYcU8iNwVv200WOpj7np86_DAOXSeiQ,7897
12
12
  solana_agent/interfaces/__init__.py,sha256=IQs1WIM1FeKP1-kY2FEfyhol_dB-I-VAe2rD6jrVF6k,355
13
13
  solana_agent/interfaces/client/client.py,sha256=CB8YuSsn-Lvinrb12huyIVaFpJqVDh8EHsHJi9SVXM4,1690
14
14
  solana_agent/interfaces/plugins/plugins.py,sha256=T8HPBsekmzVwfU_Rizp-vtzAeYkMlKMYD7U9d0Wjq9c,3338
@@ -29,7 +29,7 @@ solana_agent/services/__init__.py,sha256=ab_NXJmwYUCmCrCzuTlZ47bJZINW0Y0F5jfQ9Oo
29
29
  solana_agent/services/agent.py,sha256=M1Aukr9xKGP9mL0jM_JqdRdWSqG4LxF0y0PDAzE_fpY,24608
30
30
  solana_agent/services/query.py,sha256=bhB6bZKWqsEf_fLXfsSC57q0CtmeDI6jUlxc9a0LGJw,11099
31
31
  solana_agent/services/routing.py,sha256=hC5t98KZPHty9kMX27KcuxcmZlwjm0g59uMkR8n7k_w,6818
32
- solana_agent-26.0.0.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
33
- solana_agent-26.0.0.dist-info/METADATA,sha256=aPNv-hSXgPYa99cYTklKavteM4tuqA50kF3jGNz0J0g,19100
34
- solana_agent-26.0.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
35
- solana_agent-26.0.0.dist-info/RECORD,,
32
+ solana_agent-27.1.0.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
33
+ solana_agent-27.1.0.dist-info/METADATA,sha256=e03o52DNgOqoKDsZfPZEb1fo-pT7oGoUCWWlhUkHjT0,20057
34
+ solana_agent-27.1.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
35
+ solana_agent-27.1.0.dist-info/RECORD,,