solana-agent 27.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,18 +86,75 @@ class SolanaAgentFactory:
86
86
  zep_api_key=config["zep"].get("api_key")
87
87
  )
88
88
 
89
- # Create primary services
90
- agent_service = AgentService(
91
- llm_provider=llm_adapter,
92
- business_mission=business_mission,
93
- config=config,
94
- )
89
+ if "gemini" in config and "api_key" in config["gemini"] and not "grok" in config:
90
+ # Create primary services
91
+ agent_service = AgentService(
92
+ llm_provider=llm_adapter,
93
+ business_mission=business_mission,
94
+ config=config,
95
+ api_key=config["gemini"]["api_key"],
96
+ base_url="https://generativelanguage.googleapis.com/v1beta/openai/",
97
+ model="gemini-2.0-flash",
98
+ )
95
99
 
96
- # Create routing service
97
- routing_service = RoutingService(
98
- llm_provider=llm_adapter,
99
- agent_service=agent_service,
100
- )
100
+ # Create routing service
101
+ routing_service = RoutingService(
102
+ llm_provider=llm_adapter,
103
+ agent_service=agent_service,
104
+ api_key=config["gemini"]["api_key"],
105
+ base_url="https://generativelanguage.googleapis.com/v1beta/openai/",
106
+ model="gemini-2.0-flash",
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
+
145
+ else:
146
+ # Create primary services
147
+ agent_service = AgentService(
148
+ llm_provider=llm_adapter,
149
+ business_mission=business_mission,
150
+ config=config,
151
+ )
152
+
153
+ # Create routing service
154
+ routing_service = RoutingService(
155
+ llm_provider=llm_adapter,
156
+ agent_service=agent_service,
157
+ )
101
158
 
102
159
  # Debug the agent service tool registry
103
160
  print(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 27.0.0
3
+ Version: 27.1.0
4
4
  Summary: Agentic IQ
5
5
  License: MIT
6
6
  Keywords: ai,openai,ai agents,agi
@@ -18,7 +18,7 @@ Requires-Dist: instructor (>=1.7.9,<2.0.0)
18
18
  Requires-Dist: openai (>=1.72.0,<2.0.0)
19
19
  Requires-Dist: pydantic (>=2.11.3,<3.0.0)
20
20
  Requires-Dist: pymongo (>=4.12.0,<5.0.0)
21
- Requires-Dist: zep-cloud (>=2.10.0,<3.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) - LLM Provider
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
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,12 @@ 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
+ },
161
+ "gemini": {
162
+ "api_key": "your-gemini-api-key",
163
+ },
149
164
  "openai": {
150
165
  "api_key": "your-openai-api-key",
151
166
  },
@@ -175,6 +190,12 @@ async for response in solana_agent.process("user123", "What are the latest AI de
175
190
  from solana_agent import SolanaAgent
176
191
 
177
192
  config = {
193
+ "grok": {
194
+ "api_key": "your-grok-api-key",
195
+ },
196
+ "gemini": {
197
+ "api_key": "your-gemini-api-key",
198
+ },
178
199
  "openai": {
179
200
  "api_key": "your-openai-api-key",
180
201
  },
@@ -206,6 +227,12 @@ async for response in solana_agent.process("user123", audio_content, output_form
206
227
  from solana_agent import SolanaAgent
207
228
 
208
229
  config = {
230
+ "grok": {
231
+ "api_key": "your-grok-api-key",
232
+ },
233
+ "gemini": {
234
+ "api_key": "your-gemini-api-key",
235
+ },
209
236
  "openai": {
210
237
  "api_key": "your-openai-api-key",
211
238
  },
@@ -235,6 +262,12 @@ async for response in solana_agent.process("user123", "What is the latest news o
235
262
  from solana_agent import SolanaAgent
236
263
 
237
264
  config = {
265
+ "grok": {
266
+ "api_key": "your-grok-api-key",
267
+ },
268
+ "gemini": {
269
+ "api_key": "your-gemini-api-key",
270
+ },
238
271
  "openai": {
239
272
  "api_key": "your-openai-api-key",
240
273
  },
@@ -318,6 +351,12 @@ Tools can be used from plugins like Solana Agent Kit (sakit) or via inline tools
318
351
  from solana_agent import SolanaAgent
319
352
 
320
353
  config = {
354
+ "grok": {
355
+ "api_key": "your-grok-api-key",
356
+ },
357
+ "gemini": {
358
+ "api_key": "your-gemini-api-key",
359
+ },
321
360
  "openai": {
322
361
  "api_key": "your-openai-api-key",
323
362
  },
@@ -400,6 +439,12 @@ class TestTool(Tool):
400
439
  }
401
440
 
402
441
  config = {
442
+ "grok": {
443
+ "api_key": "your-grok-api-key",
444
+ },
445
+ "gemini": {
446
+ "api_key": "your-gemini-api-key",
447
+ },
403
448
  "openai": {
404
449
  "api_key": "your-openai-api-key",
405
450
  },
@@ -439,6 +484,12 @@ This knowledge is accessible to all your AI agents.
439
484
  from solana_agent import SolanaAgent
440
485
 
441
486
  config = {
487
+ "grok": {
488
+ "api_key": "your-grok-api-key",
489
+ },
490
+ "gemini": {
491
+ "api_key": "your-gemini-api-key",
492
+ },
442
493
  "openai": {
443
494
  "api_key": "your-openai-api-key",
444
495
  },
@@ -466,6 +517,12 @@ from solana_agent import SolanaAgent
466
517
  from solana_agent.interfaces.services.routing import RoutingService as RoutingServiceInterface
467
518
 
468
519
  config = {
520
+ "grok": {
521
+ "api_key": "your-grok-api-key",
522
+ },
523
+ "gemini": {
524
+ "api_key": "your-gemini-api-key",
525
+ },
469
526
  "openai": {
470
527
  "api_key": "your-openai-api-key",
471
528
  },
@@ -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=wYfVqN99v9coh5nUWsmCKVCzNcuOkLTorIHRq5v0scw,5496
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-27.0.0.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
33
- solana_agent-27.0.0.dist-info/METADATA,sha256=CB1bwsxwRz9Md1Il37MT2N4cqFGsqg59qyXTjfifDJ0,18577
34
- solana_agent-27.0.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
35
- solana_agent-27.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,,