solana-agent 20.0.0__tar.gz → 20.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.
- {solana_agent-20.0.0 → solana_agent-20.1.0}/PKG-INFO +128 -50
- {solana_agent-20.0.0 → solana_agent-20.1.0}/README.md +127 -49
- {solana_agent-20.0.0 → solana_agent-20.1.0}/pyproject.toml +1 -1
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/client/solana_agent.py +5 -1
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/interfaces/services/routing.py +0 -1
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/services/agent.py +0 -1
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/services/query.py +8 -1
- {solana_agent-20.0.0 → solana_agent-20.1.0}/LICENSE +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/__init__.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/adapters/__init__.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/adapters/llm_adapter.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/adapters/mongodb_adapter.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/client/__init__.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/domains/__init__.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/domains/agent.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/domains/routing.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/factories/__init__.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/factories/agent_factory.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/interfaces/__init__.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/interfaces/client/client.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/interfaces/plugins/plugins.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/interfaces/providers/data_storage.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/interfaces/providers/llm.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/interfaces/providers/memory.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/interfaces/services/agent.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/interfaces/services/query.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/plugins/__init__.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/plugins/manager.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/plugins/registry.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/plugins/tools/__init__.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/plugins/tools/auto_tool.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/repositories/__init__.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/repositories/memory.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/services/__init__.py +0 -0
- {solana_agent-20.0.0 → solana_agent-20.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: 20.
|
3
|
+
Version: 20.1.0
|
4
4
|
Summary: Agentic IQ
|
5
5
|
License: MIT
|
6
6
|
Keywords: ai,openai,ai agents,agi
|
@@ -75,7 +75,9 @@ You can install Solana Agent using pip:
|
|
75
75
|
|
76
76
|
`pip install solana-agent`
|
77
77
|
|
78
|
-
##
|
78
|
+
## Usage
|
79
|
+
|
80
|
+
### Text/Text Streaming
|
79
81
|
|
80
82
|
```python
|
81
83
|
from solana_agent import SolanaAgent
|
@@ -123,40 +125,109 @@ async for response in solana_agent.process("user123", "What are the latest AI de
|
|
123
125
|
print(response, end="")
|
124
126
|
```
|
125
127
|
|
126
|
-
|
128
|
+
### Audio/Audio Streaming
|
127
129
|
|
128
|
-
|
130
|
+
```python
|
131
|
+
from solana_agent import SolanaAgent
|
129
132
|
|
130
|
-
|
133
|
+
config = {
|
134
|
+
"openai": {
|
135
|
+
"api_key": "your-openai-api-key",
|
136
|
+
},
|
137
|
+
"agents": [
|
138
|
+
{
|
139
|
+
"name": "research_specialist",
|
140
|
+
"instructions": "You are an expert researcher who synthesizes complex information clearly.",
|
141
|
+
"specialization": "Research and knowledge synthesis",
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"name": "customer_support",
|
145
|
+
"instructions": "You provide friendly, helpful customer support responses.",
|
146
|
+
"specialization": "Customer inquiries",
|
147
|
+
}
|
148
|
+
],
|
149
|
+
}
|
150
|
+
|
151
|
+
solana_agent = SolanaAgent(config=config)
|
152
|
+
|
153
|
+
audio_content = audio_file.read()
|
154
|
+
|
155
|
+
async for response in solana_agent.process("user123", audio_content, output_format="audio", audio_voice="nova", audio_input_format="webm", audio_output_format="aac"):
|
156
|
+
print(response, end="")
|
157
|
+
```
|
158
|
+
|
159
|
+
### Text/Audio Streaming
|
131
160
|
|
132
161
|
```python
|
133
162
|
from solana_agent import SolanaAgent
|
134
163
|
|
135
164
|
config = {
|
136
|
-
"
|
137
|
-
"mission": "To provide users with a one-stop shop for their queries.",
|
138
|
-
"values": {
|
139
|
-
"Friendliness": "Users must be treated fairly, openly, and with friendliness.",
|
140
|
-
"Ethical": "Agents must use a strong ethical framework in their interactions with users.",
|
141
|
-
},
|
142
|
-
"goals": [
|
143
|
-
"Empower users with great answers to their queries.",
|
144
|
-
],
|
145
|
-
"voice": "The voice of the brand is that of a research business."
|
146
|
-
},
|
147
|
-
"openai": { # optional
|
165
|
+
"openai": {
|
148
166
|
"api_key": "your-openai-api-key",
|
149
167
|
},
|
150
|
-
"
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
168
|
+
"agents": [
|
169
|
+
{
|
170
|
+
"name": "research_specialist",
|
171
|
+
"instructions": "You are an expert researcher who synthesizes complex information clearly.",
|
172
|
+
"specialization": "Research and knowledge synthesis",
|
173
|
+
},
|
174
|
+
{
|
175
|
+
"name": "customer_support",
|
176
|
+
"instructions": "You provide friendly, helpful customer support responses.",
|
177
|
+
"specialization": "Customer inquiries",
|
178
|
+
}
|
179
|
+
],
|
180
|
+
}
|
181
|
+
|
182
|
+
solana_agent = SolanaAgent(config=config)
|
183
|
+
|
184
|
+
async for response in solana_agent.process("user123", "What is the latest news on Elon Musk?", output_format="audio", audio_voice="nova", audio_output_format="aac"):
|
185
|
+
print(response, end="")
|
186
|
+
```
|
187
|
+
|
188
|
+
### Audio/Text Streaming
|
189
|
+
|
190
|
+
```python
|
191
|
+
from solana_agent import SolanaAgent
|
192
|
+
|
193
|
+
config = {
|
194
|
+
"openai": {
|
195
|
+
"api_key": "your-openai-api-key",
|
156
196
|
},
|
157
|
-
"
|
158
|
-
|
159
|
-
|
197
|
+
"agents": [
|
198
|
+
{
|
199
|
+
"name": "research_specialist",
|
200
|
+
"instructions": "You are an expert researcher who synthesizes complex information clearly.",
|
201
|
+
"specialization": "Research and knowledge synthesis",
|
202
|
+
},
|
203
|
+
{
|
204
|
+
"name": "customer_support",
|
205
|
+
"instructions": "You provide friendly, helpful customer support responses.",
|
206
|
+
"specialization": "Customer inquiries",
|
207
|
+
}
|
208
|
+
],
|
209
|
+
}
|
210
|
+
|
211
|
+
solana_agent = SolanaAgent(config=config)
|
212
|
+
|
213
|
+
audio_content = audio_file.read()
|
214
|
+
|
215
|
+
async for response in solana_agent.process("user123", audio_content, audio_input_format="aac"):
|
216
|
+
print(response, end="")
|
217
|
+
```
|
218
|
+
|
219
|
+
### Plugins
|
220
|
+
|
221
|
+
Plugins like Solana Agent Kit (sakit) integrate automatically with Solana Agent.
|
222
|
+
|
223
|
+
`pip install sakit`
|
224
|
+
|
225
|
+
```python
|
226
|
+
from solana_agent import SolanaAgent
|
227
|
+
|
228
|
+
config = {
|
229
|
+
"openai": {
|
230
|
+
"api_key": "your-openai-api-key",
|
160
231
|
},
|
161
232
|
"tools": {
|
162
233
|
"search_internet": {
|
@@ -188,7 +259,7 @@ async for response in solana_agent.process("user123", "What are the latest AI de
|
|
188
259
|
|
189
260
|
To create a plugin like Solana Agent Kit - read the [code](https://github.com/truemagic-coder/solana-agent-kit)
|
190
261
|
|
191
|
-
|
262
|
+
### Custom Inline Tools
|
192
263
|
|
193
264
|
```python
|
194
265
|
from solana_agent import SolanaAgent
|
@@ -241,31 +312,9 @@ class TestTool(Tool):
|
|
241
312
|
}
|
242
313
|
|
243
314
|
config = {
|
244
|
-
"
|
245
|
-
"mission": "To provide users with a one-stop shop for their queries.",
|
246
|
-
"values": {
|
247
|
-
"Friendliness": "Users must be treated fairly, openly, and with friendliness.",
|
248
|
-
"Ethical": "Agents must use a strong ethical framework in their interactions with users.",
|
249
|
-
},
|
250
|
-
"goals": [
|
251
|
-
"Empower users with great answers to their queries.",
|
252
|
-
],
|
253
|
-
"voice": "The voice of the brand is that of a research business."
|
254
|
-
},
|
255
|
-
"openai": { # optional
|
315
|
+
"openai": {
|
256
316
|
"api_key": "your-openai-api-key",
|
257
317
|
},
|
258
|
-
"ollama": { # optional
|
259
|
-
"url": "your-ollama-url",
|
260
|
-
},
|
261
|
-
"mongo": { # optional
|
262
|
-
"connection_string": "mongodb://localhost:27017",
|
263
|
-
"database": "solana_agent"
|
264
|
-
},
|
265
|
-
"zep": { # optional
|
266
|
-
"api_key": "your-zep-api-key",
|
267
|
-
"base_url": "your-zep-base-url", # not applicable if using Zep Cloud
|
268
|
-
},
|
269
318
|
"agents": [
|
270
319
|
{
|
271
320
|
"name": "research_specialist",
|
@@ -290,6 +339,35 @@ async for response in solana_agent.process("user123", "What are the latest AI de
|
|
290
339
|
print(response, end="")
|
291
340
|
```
|
292
341
|
|
342
|
+
### Custom Prompt Injection at Runtime
|
343
|
+
|
344
|
+
```python
|
345
|
+
from solana_agent import SolanaAgent
|
346
|
+
|
347
|
+
config = {
|
348
|
+
"openai": {
|
349
|
+
"api_key": "your-openai-api-key",
|
350
|
+
},
|
351
|
+
"agents": [
|
352
|
+
{
|
353
|
+
"name": "research_specialist",
|
354
|
+
"instructions": "You are an expert researcher who synthesizes complex information clearly.",
|
355
|
+
"specialization": "Research and knowledge synthesis",
|
356
|
+
},
|
357
|
+
{
|
358
|
+
"name": "customer_support",
|
359
|
+
"instructions": "You provide friendly, helpful customer support responses.",
|
360
|
+
"specialization": "Customer inquiries",
|
361
|
+
}
|
362
|
+
],
|
363
|
+
}
|
364
|
+
|
365
|
+
solana_agent = SolanaAgent(config=config)
|
366
|
+
|
367
|
+
async for response in solana_agent.process("user123", "What are the latest AI developments?", "Always end your sentences with eh?"):
|
368
|
+
print(response, end="")
|
369
|
+
```
|
370
|
+
|
293
371
|
## Notes
|
294
372
|
* Solana Agent agents can only call one tool per response.
|
295
373
|
* Solana Agent agents choose the best tool for the job.
|
@@ -50,7 +50,9 @@ You can install Solana Agent using pip:
|
|
50
50
|
|
51
51
|
`pip install solana-agent`
|
52
52
|
|
53
|
-
##
|
53
|
+
## Usage
|
54
|
+
|
55
|
+
### Text/Text Streaming
|
54
56
|
|
55
57
|
```python
|
56
58
|
from solana_agent import SolanaAgent
|
@@ -98,40 +100,109 @@ async for response in solana_agent.process("user123", "What are the latest AI de
|
|
98
100
|
print(response, end="")
|
99
101
|
```
|
100
102
|
|
101
|
-
|
103
|
+
### Audio/Audio Streaming
|
102
104
|
|
103
|
-
|
105
|
+
```python
|
106
|
+
from solana_agent import SolanaAgent
|
104
107
|
|
105
|
-
|
108
|
+
config = {
|
109
|
+
"openai": {
|
110
|
+
"api_key": "your-openai-api-key",
|
111
|
+
},
|
112
|
+
"agents": [
|
113
|
+
{
|
114
|
+
"name": "research_specialist",
|
115
|
+
"instructions": "You are an expert researcher who synthesizes complex information clearly.",
|
116
|
+
"specialization": "Research and knowledge synthesis",
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"name": "customer_support",
|
120
|
+
"instructions": "You provide friendly, helpful customer support responses.",
|
121
|
+
"specialization": "Customer inquiries",
|
122
|
+
}
|
123
|
+
],
|
124
|
+
}
|
125
|
+
|
126
|
+
solana_agent = SolanaAgent(config=config)
|
127
|
+
|
128
|
+
audio_content = audio_file.read()
|
129
|
+
|
130
|
+
async for response in solana_agent.process("user123", audio_content, output_format="audio", audio_voice="nova", audio_input_format="webm", audio_output_format="aac"):
|
131
|
+
print(response, end="")
|
132
|
+
```
|
133
|
+
|
134
|
+
### Text/Audio Streaming
|
106
135
|
|
107
136
|
```python
|
108
137
|
from solana_agent import SolanaAgent
|
109
138
|
|
110
139
|
config = {
|
111
|
-
"
|
112
|
-
"mission": "To provide users with a one-stop shop for their queries.",
|
113
|
-
"values": {
|
114
|
-
"Friendliness": "Users must be treated fairly, openly, and with friendliness.",
|
115
|
-
"Ethical": "Agents must use a strong ethical framework in their interactions with users.",
|
116
|
-
},
|
117
|
-
"goals": [
|
118
|
-
"Empower users with great answers to their queries.",
|
119
|
-
],
|
120
|
-
"voice": "The voice of the brand is that of a research business."
|
121
|
-
},
|
122
|
-
"openai": { # optional
|
140
|
+
"openai": {
|
123
141
|
"api_key": "your-openai-api-key",
|
124
142
|
},
|
125
|
-
"
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
143
|
+
"agents": [
|
144
|
+
{
|
145
|
+
"name": "research_specialist",
|
146
|
+
"instructions": "You are an expert researcher who synthesizes complex information clearly.",
|
147
|
+
"specialization": "Research and knowledge synthesis",
|
148
|
+
},
|
149
|
+
{
|
150
|
+
"name": "customer_support",
|
151
|
+
"instructions": "You provide friendly, helpful customer support responses.",
|
152
|
+
"specialization": "Customer inquiries",
|
153
|
+
}
|
154
|
+
],
|
155
|
+
}
|
156
|
+
|
157
|
+
solana_agent = SolanaAgent(config=config)
|
158
|
+
|
159
|
+
async for response in solana_agent.process("user123", "What is the latest news on Elon Musk?", output_format="audio", audio_voice="nova", audio_output_format="aac"):
|
160
|
+
print(response, end="")
|
161
|
+
```
|
162
|
+
|
163
|
+
### Audio/Text Streaming
|
164
|
+
|
165
|
+
```python
|
166
|
+
from solana_agent import SolanaAgent
|
167
|
+
|
168
|
+
config = {
|
169
|
+
"openai": {
|
170
|
+
"api_key": "your-openai-api-key",
|
131
171
|
},
|
132
|
-
"
|
133
|
-
|
134
|
-
|
172
|
+
"agents": [
|
173
|
+
{
|
174
|
+
"name": "research_specialist",
|
175
|
+
"instructions": "You are an expert researcher who synthesizes complex information clearly.",
|
176
|
+
"specialization": "Research and knowledge synthesis",
|
177
|
+
},
|
178
|
+
{
|
179
|
+
"name": "customer_support",
|
180
|
+
"instructions": "You provide friendly, helpful customer support responses.",
|
181
|
+
"specialization": "Customer inquiries",
|
182
|
+
}
|
183
|
+
],
|
184
|
+
}
|
185
|
+
|
186
|
+
solana_agent = SolanaAgent(config=config)
|
187
|
+
|
188
|
+
audio_content = audio_file.read()
|
189
|
+
|
190
|
+
async for response in solana_agent.process("user123", audio_content, audio_input_format="aac"):
|
191
|
+
print(response, end="")
|
192
|
+
```
|
193
|
+
|
194
|
+
### Plugins
|
195
|
+
|
196
|
+
Plugins like Solana Agent Kit (sakit) integrate automatically with Solana Agent.
|
197
|
+
|
198
|
+
`pip install sakit`
|
199
|
+
|
200
|
+
```python
|
201
|
+
from solana_agent import SolanaAgent
|
202
|
+
|
203
|
+
config = {
|
204
|
+
"openai": {
|
205
|
+
"api_key": "your-openai-api-key",
|
135
206
|
},
|
136
207
|
"tools": {
|
137
208
|
"search_internet": {
|
@@ -163,7 +234,7 @@ async for response in solana_agent.process("user123", "What are the latest AI de
|
|
163
234
|
|
164
235
|
To create a plugin like Solana Agent Kit - read the [code](https://github.com/truemagic-coder/solana-agent-kit)
|
165
236
|
|
166
|
-
|
237
|
+
### Custom Inline Tools
|
167
238
|
|
168
239
|
```python
|
169
240
|
from solana_agent import SolanaAgent
|
@@ -216,31 +287,9 @@ class TestTool(Tool):
|
|
216
287
|
}
|
217
288
|
|
218
289
|
config = {
|
219
|
-
"
|
220
|
-
"mission": "To provide users with a one-stop shop for their queries.",
|
221
|
-
"values": {
|
222
|
-
"Friendliness": "Users must be treated fairly, openly, and with friendliness.",
|
223
|
-
"Ethical": "Agents must use a strong ethical framework in their interactions with users.",
|
224
|
-
},
|
225
|
-
"goals": [
|
226
|
-
"Empower users with great answers to their queries.",
|
227
|
-
],
|
228
|
-
"voice": "The voice of the brand is that of a research business."
|
229
|
-
},
|
230
|
-
"openai": { # optional
|
290
|
+
"openai": {
|
231
291
|
"api_key": "your-openai-api-key",
|
232
292
|
},
|
233
|
-
"ollama": { # optional
|
234
|
-
"url": "your-ollama-url",
|
235
|
-
},
|
236
|
-
"mongo": { # optional
|
237
|
-
"connection_string": "mongodb://localhost:27017",
|
238
|
-
"database": "solana_agent"
|
239
|
-
},
|
240
|
-
"zep": { # optional
|
241
|
-
"api_key": "your-zep-api-key",
|
242
|
-
"base_url": "your-zep-base-url", # not applicable if using Zep Cloud
|
243
|
-
},
|
244
293
|
"agents": [
|
245
294
|
{
|
246
295
|
"name": "research_specialist",
|
@@ -265,6 +314,35 @@ async for response in solana_agent.process("user123", "What are the latest AI de
|
|
265
314
|
print(response, end="")
|
266
315
|
```
|
267
316
|
|
317
|
+
### Custom Prompt Injection at Runtime
|
318
|
+
|
319
|
+
```python
|
320
|
+
from solana_agent import SolanaAgent
|
321
|
+
|
322
|
+
config = {
|
323
|
+
"openai": {
|
324
|
+
"api_key": "your-openai-api-key",
|
325
|
+
},
|
326
|
+
"agents": [
|
327
|
+
{
|
328
|
+
"name": "research_specialist",
|
329
|
+
"instructions": "You are an expert researcher who synthesizes complex information clearly.",
|
330
|
+
"specialization": "Research and knowledge synthesis",
|
331
|
+
},
|
332
|
+
{
|
333
|
+
"name": "customer_support",
|
334
|
+
"instructions": "You provide friendly, helpful customer support responses.",
|
335
|
+
"specialization": "Customer inquiries",
|
336
|
+
}
|
337
|
+
],
|
338
|
+
}
|
339
|
+
|
340
|
+
solana_agent = SolanaAgent(config=config)
|
341
|
+
|
342
|
+
async for response in solana_agent.process("user123", "What are the latest AI developments?", "Always end your sentences with eh?"):
|
343
|
+
print(response, end="")
|
344
|
+
```
|
345
|
+
|
268
346
|
## Notes
|
269
347
|
* Solana Agent agents can only call one tool per response.
|
270
348
|
* Solana Agent agents choose the best tool for the job.
|
@@ -11,6 +11,7 @@ from typing import AsyncGenerator, Dict, Any, Literal, Optional, Union
|
|
11
11
|
from solana_agent.factories.agent_factory import SolanaAgentFactory
|
12
12
|
from solana_agent.interfaces.client.client import SolanaAgent as SolanaAgentInterface
|
13
13
|
from solana_agent.interfaces.plugins.plugins import Tool
|
14
|
+
from solana_agent.interfaces.services.routing import RoutingService as RoutingInterface
|
14
15
|
|
15
16
|
|
16
17
|
class SolanaAgent(SolanaAgentInterface):
|
@@ -54,6 +55,7 @@ class SolanaAgent(SolanaAgentInterface):
|
|
54
55
|
audio_input_format: Literal[
|
55
56
|
"flac", "mp3", "mp4", "mpeg", "mpga", "m4a", "ogg", "wav", "webm"
|
56
57
|
] = "mp4",
|
58
|
+
router: Optional[RoutingInterface] = None,
|
57
59
|
) -> AsyncGenerator[Union[str, bytes], None]: # pragma: no cover
|
58
60
|
"""Process a user message and return the response stream.
|
59
61
|
|
@@ -63,9 +65,10 @@ class SolanaAgent(SolanaAgentInterface):
|
|
63
65
|
prompt: Optional prompt for the agent
|
64
66
|
output_format: Response format ("text" or "audio")
|
65
67
|
audio_voice: Voice to use for audio output
|
66
|
-
audio_instructions:
|
68
|
+
audio_instructions: Not used currently
|
67
69
|
audio_output_format: Audio output format
|
68
70
|
audio_input_format: Audio input format
|
71
|
+
router: Optional routing service for processing
|
69
72
|
|
70
73
|
Returns:
|
71
74
|
Async generator yielding response chunks (text strings or audio bytes)
|
@@ -79,6 +82,7 @@ class SolanaAgent(SolanaAgentInterface):
|
|
79
82
|
audio_output_format=audio_output_format,
|
80
83
|
audio_input_format=audio_input_format,
|
81
84
|
prompt=prompt,
|
85
|
+
router=router,
|
82
86
|
):
|
83
87
|
yield chunk
|
84
88
|
|
@@ -12,7 +12,6 @@ from typing import AsyncGenerator, Dict, List, Literal, Optional, Any, Union
|
|
12
12
|
|
13
13
|
from solana_agent.interfaces.services.agent import AgentService as AgentServiceInterface
|
14
14
|
from solana_agent.interfaces.providers.llm import LLMProvider
|
15
|
-
from solana_agent.interfaces.plugins.plugins import ToolRegistry as ToolRegistryInterface
|
16
15
|
from solana_agent.plugins.manager import PluginManager
|
17
16
|
from solana_agent.plugins.registry import ToolRegistry
|
18
17
|
from solana_agent.domains.agent import AIAgent, BusinessMission
|
@@ -8,6 +8,7 @@ clean separation of concerns.
|
|
8
8
|
from typing import Any, AsyncGenerator, Dict, Literal, Optional, Union
|
9
9
|
|
10
10
|
from solana_agent.interfaces.services.query import QueryService as QueryServiceInterface
|
11
|
+
from solana_agent.interfaces.services.routing import RoutingService as RoutingServiceInterface
|
11
12
|
from solana_agent.services.agent import AgentService
|
12
13
|
from solana_agent.services.routing import RoutingService
|
13
14
|
from solana_agent.interfaces.providers.memory import MemoryProvider
|
@@ -47,6 +48,7 @@ class QueryService(QueryServiceInterface):
|
|
47
48
|
"flac", "mp3", "mp4", "mpeg", "mpga", "m4a", "ogg", "wav", "webm"
|
48
49
|
] = "mp4",
|
49
50
|
prompt: Optional[str] = None,
|
51
|
+
router: Optional[RoutingServiceInterface] = None,
|
50
52
|
) -> AsyncGenerator[Union[str, bytes], None]: # pragma: no cover
|
51
53
|
"""Process the user request with appropriate agent.
|
52
54
|
|
@@ -59,6 +61,7 @@ class QueryService(QueryServiceInterface):
|
|
59
61
|
audio_output_format: Audio output format
|
60
62
|
audio_input_format: Audio input format
|
61
63
|
prompt: Optional prompt for the agent
|
64
|
+
router: Optional routing service for processing
|
62
65
|
|
63
66
|
Yields:
|
64
67
|
Response chunks (text strings or audio bytes)
|
@@ -96,7 +99,11 @@ class QueryService(QueryServiceInterface):
|
|
96
99
|
memory_context = await self.memory_provider.retrieve(user_id)
|
97
100
|
|
98
101
|
# Route query to appropriate agent
|
99
|
-
|
102
|
+
if router:
|
103
|
+
agent_name = await router.route_query(user_text)
|
104
|
+
else:
|
105
|
+
agent_name = await self.routing_service.route_query(user_text)
|
106
|
+
|
100
107
|
print(f"Routed to agent: {agent_name}")
|
101
108
|
|
102
109
|
# Generate response
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{solana_agent-20.0.0 → solana_agent-20.1.0}/solana_agent/interfaces/providers/data_storage.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|