solana-agent 15.1.1__py3-none-any.whl → 15.1.2__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.
- solana_agent/adapters/llm_adapter.py +4 -0
- solana_agent/client/solana_agent.py +3 -0
- solana_agent/interfaces/client/client.py +3 -1
- solana_agent/interfaces/providers/llm.py +2 -0
- solana_agent/interfaces/services/agent.py +2 -0
- solana_agent/interfaces/services/query.py +2 -0
- solana_agent/services/agent.py +9 -6
- solana_agent/services/query.py +7 -3
- {solana_agent-15.1.1.dist-info → solana_agent-15.1.2.dist-info}/METADATA +1 -1
- {solana_agent-15.1.1.dist-info → solana_agent-15.1.2.dist-info}/RECORD +12 -12
- {solana_agent-15.1.1.dist-info → solana_agent-15.1.2.dist-info}/LICENSE +0 -0
- {solana_agent-15.1.1.dist-info → solana_agent-15.1.2.dist-info}/WHEEL +0 -0
@@ -30,6 +30,8 @@ class OpenAIAdapter(LLMProvider):
|
|
30
30
|
instructions: str = "",
|
31
31
|
voice: Literal["alloy", "ash", "ballad", "coral", "echo",
|
32
32
|
"fable", "onyx", "nova", "sage", "shimmer"] = "nova",
|
33
|
+
response_format: Literal['mp3', 'opus',
|
34
|
+
'aac', 'flac', 'wav', 'pcm'] = "aac",
|
33
35
|
) -> AsyncGenerator[bytes, None]: # pragma: no cover
|
34
36
|
"""Stream text-to-speech audio from OpenAI models.
|
35
37
|
|
@@ -37,6 +39,7 @@ class OpenAIAdapter(LLMProvider):
|
|
37
39
|
text: Text to convert to speech
|
38
40
|
instructions: Optional instructions for speech generation
|
39
41
|
voice: Voice to use for synthesis
|
42
|
+
response_format: Audio format
|
40
43
|
|
41
44
|
Yields:
|
42
45
|
Audio bytes as they become available
|
@@ -47,6 +50,7 @@ class OpenAIAdapter(LLMProvider):
|
|
47
50
|
voice=voice,
|
48
51
|
input=text,
|
49
52
|
instructions=instructions,
|
53
|
+
response_format=response_format
|
50
54
|
)
|
51
55
|
|
52
56
|
# Stream the bytes in chunks
|
@@ -48,6 +48,8 @@ class SolanaAgent(SolanaAgentInterface):
|
|
48
48
|
voice: Literal["alloy", "ash", "ballad", "coral", "echo",
|
49
49
|
"fable", "onyx", "nova", "sage", "shimmer"] = "nova",
|
50
50
|
audio_instructions: Optional[str] = None,
|
51
|
+
response_format: Literal['mp3', 'opus',
|
52
|
+
'aac', 'flac', 'wav', 'pcm'] = "aac",
|
51
53
|
) -> AsyncGenerator[Union[str, bytes], None]: # pragma: no cover
|
52
54
|
"""Process a user message and return the response stream.
|
53
55
|
|
@@ -57,6 +59,7 @@ class SolanaAgent(SolanaAgentInterface):
|
|
57
59
|
output_format: Response format ("text" or "audio")
|
58
60
|
voice: Voice to use for audio output (only used if output_format is "audio")
|
59
61
|
audio_instructions: Optional instructions for audio synthesis
|
62
|
+
response_format: Audio format
|
60
63
|
|
61
64
|
Returns:
|
62
65
|
Async generator yielding response chunks (text strings or audio bytes)
|
@@ -14,7 +14,9 @@ class SolanaAgent(ABC):
|
|
14
14
|
output_format: Literal["text", "audio"] = "text",
|
15
15
|
voice: Literal["alloy", "ash", "ballad", "coral", "echo",
|
16
16
|
"fable", "onyx", "nova", "sage", "shimmer"] = "nova",
|
17
|
-
audio_instructions: str = None
|
17
|
+
audio_instructions: str = None,
|
18
|
+
response_format: Literal['mp3', 'opus',
|
19
|
+
'aac', 'flac', 'wav', 'pcm'] = "aac",
|
18
20
|
) -> AsyncGenerator[Union[str, bytes], None]:
|
19
21
|
"""Process a user message and return the response stream."""
|
20
22
|
pass
|
@@ -39,6 +39,8 @@ class LLMProvider(ABC):
|
|
39
39
|
instructions: str = "",
|
40
40
|
voice: Literal["alloy", "ash", "ballad", "coral", "echo",
|
41
41
|
"fable", "onyx", "nova", "sage", "shimmer"] = "nova",
|
42
|
+
response_format: Literal['mp3', 'opus',
|
43
|
+
'aac', 'flac', 'wav', 'pcm'] = "aac",
|
42
44
|
) -> AsyncGenerator[bytes, None]:
|
43
45
|
"""Stream text-to-speech audio from the language model."""
|
44
46
|
pass
|
@@ -34,6 +34,8 @@ class AgentService(ABC):
|
|
34
34
|
voice: Literal["alloy", "ash", "ballad", "coral", "echo",
|
35
35
|
"fable", "onyx", "nova", "sage", "shimmer"] = "nova",
|
36
36
|
audio_instructions: str = None,
|
37
|
+
response_format: Literal['mp3', 'opus',
|
38
|
+
'aac', 'flac', 'wav', 'pcm'] = "aac",
|
37
39
|
) -> AsyncGenerator[Union[str, bytes], None]:
|
38
40
|
"""Generate a response from an agent."""
|
39
41
|
pass
|
@@ -15,6 +15,8 @@ class QueryService(ABC):
|
|
15
15
|
voice: Literal["alloy", "ash", "ballad", "coral", "echo",
|
16
16
|
"fable", "onyx", "nova", "sage", "shimmer"] = "nova",
|
17
17
|
audio_instructions: Optional[str] = None,
|
18
|
+
response_format: Literal['mp3', 'opus',
|
19
|
+
'aac', 'flac', 'wav', 'pcm'] = "aac",
|
18
20
|
) -> AsyncGenerator[Union[str, bytes], None]:
|
19
21
|
"""Process the user request and generate a response."""
|
20
22
|
pass
|
solana_agent/services/agent.py
CHANGED
@@ -195,6 +195,8 @@ class AgentService(AgentServiceInterface):
|
|
195
195
|
voice: Literal["alloy", "ash", "ballad", "coral", "echo",
|
196
196
|
"fable", "onyx", "nova", "sage", "shimmer"] = "nova",
|
197
197
|
audio_instructions: Optional[str] = None,
|
198
|
+
response_format: Literal['mp3', 'opus',
|
199
|
+
'aac', 'flac', 'wav', 'pcm'] = "aac",
|
198
200
|
) -> AsyncGenerator[Union[str, bytes], None]: # pragma: no cover
|
199
201
|
"""Generate a response with support for text/audio input/output.
|
200
202
|
|
@@ -206,6 +208,7 @@ class AgentService(AgentServiceInterface):
|
|
206
208
|
output_format: Response format ("text" or "audio")
|
207
209
|
voice: Voice to use for audio output
|
208
210
|
audio_instructions: Optional instructions for audio synthesis
|
211
|
+
response_format: Audio format
|
209
212
|
|
210
213
|
Yields:
|
211
214
|
Text chunks or audio bytes depending on output_format
|
@@ -214,7 +217,7 @@ class AgentService(AgentServiceInterface):
|
|
214
217
|
if not agent:
|
215
218
|
error_msg = f"Agent '{agent_name}' not found."
|
216
219
|
if output_format == "audio":
|
217
|
-
async for chunk in self.llm_provider.tts(error_msg, voice=voice):
|
220
|
+
async for chunk in self.llm_provider.tts(error_msg, instructions=audio_instructions, response_format=response_format, voice=voice):
|
218
221
|
yield chunk
|
219
222
|
else:
|
220
223
|
yield error_msg
|
@@ -252,10 +255,10 @@ class AgentService(AgentServiceInterface):
|
|
252
255
|
if chunk.strip().startswith("{"):
|
253
256
|
# Handle tool calls
|
254
257
|
result = await self._handle_tool_call(
|
255
|
-
agent_name, chunk,
|
258
|
+
agent_name, chunk,
|
256
259
|
)
|
257
260
|
if output_format == "audio":
|
258
|
-
async for audio_chunk in self.llm_provider.tts(result, instructions=audio_instructions, voice=voice):
|
261
|
+
async for audio_chunk in self.llm_provider.tts(result, instructions=audio_instructions, response_format=response_format, voice=voice):
|
259
262
|
yield audio_chunk
|
260
263
|
else:
|
261
264
|
yield result
|
@@ -265,7 +268,7 @@ class AgentService(AgentServiceInterface):
|
|
265
268
|
text_buffer += chunk
|
266
269
|
if any(punct in chunk for punct in ".!?"):
|
267
270
|
async for audio_chunk in self.llm_provider.tts(
|
268
|
-
text_buffer, instructions=audio_instructions, voice=voice
|
271
|
+
text_buffer, instructions=audio_instructions, response_format=response_format, voice=voice
|
269
272
|
):
|
270
273
|
yield audio_chunk
|
271
274
|
text_buffer = ""
|
@@ -275,14 +278,14 @@ class AgentService(AgentServiceInterface):
|
|
275
278
|
# Handle any remaining text in buffer
|
276
279
|
if output_format == "audio" and text_buffer:
|
277
280
|
async for audio_chunk in self.llm_provider.tts(
|
278
|
-
text_buffer, instructions=audio_instructions, voice=voice
|
281
|
+
text_buffer, instructions=audio_instructions, response_format=response_format, voice=voice
|
279
282
|
):
|
280
283
|
yield audio_chunk
|
281
284
|
|
282
285
|
except Exception as e:
|
283
286
|
error_msg = f"I apologize, but I encountered an error: {str(e)}"
|
284
287
|
if output_format == "audio":
|
285
|
-
async for chunk in self.llm_provider.tts(error_msg, instructions=audio_instructions, voice=voice):
|
288
|
+
async for chunk in self.llm_provider.tts(error_msg, instructions=audio_instructions, response_format=response_format, voice=voice):
|
286
289
|
yield chunk
|
287
290
|
else:
|
288
291
|
yield error_msg
|
solana_agent/services/query.py
CHANGED
@@ -42,6 +42,8 @@ class QueryService(QueryServiceInterface):
|
|
42
42
|
voice: Literal["alloy", "ash", "ballad", "coral", "echo",
|
43
43
|
"fable", "onyx", "nova", "sage", "shimmer"] = "nova",
|
44
44
|
audio_instructions: Optional[str] = None,
|
45
|
+
response_format: Literal['mp3', 'opus',
|
46
|
+
'aac', 'flac', 'wav', 'pcm'] = "aac",
|
45
47
|
) -> AsyncGenerator[Union[str, bytes], None]: # pragma: no cover
|
46
48
|
"""Process the user request with appropriate agent.
|
47
49
|
|
@@ -51,6 +53,7 @@ class QueryService(QueryServiceInterface):
|
|
51
53
|
output_format: Response format ("text" or "audio")
|
52
54
|
voice: Voice to use for audio output
|
53
55
|
audio_instructions: Optional instructions for audio synthesis
|
56
|
+
response_format: Audio response format
|
54
57
|
|
55
58
|
Yields:
|
56
59
|
Response chunks (text strings or audio bytes)
|
@@ -68,7 +71,7 @@ class QueryService(QueryServiceInterface):
|
|
68
71
|
if user_text.strip().lower() in ["test", "hello", "hi", "hey", "ping"]:
|
69
72
|
response = "Hello! How can I help you today?"
|
70
73
|
if output_format == "audio":
|
71
|
-
async for chunk in self.agent_service.llm_provider.tts(response, instructions=audio_instructions, voice=voice):
|
74
|
+
async for chunk in self.agent_service.llm_provider.tts(response, instructions=audio_instructions, response_format=response_format, voice=voice):
|
72
75
|
yield chunk
|
73
76
|
else:
|
74
77
|
yield response
|
@@ -94,7 +97,8 @@ class QueryService(QueryServiceInterface):
|
|
94
97
|
query=user_text,
|
95
98
|
memory_context=memory_context,
|
96
99
|
output_format=output_format,
|
97
|
-
voice=voice
|
100
|
+
voice=voice,
|
101
|
+
response_format=response_format,
|
98
102
|
):
|
99
103
|
yield chunk
|
100
104
|
if output_format == "text":
|
@@ -119,7 +123,7 @@ class QueryService(QueryServiceInterface):
|
|
119
123
|
except Exception as e:
|
120
124
|
error_msg = f"I apologize for the technical difficulty. {str(e)}"
|
121
125
|
if output_format == "audio":
|
122
|
-
async for chunk in self.agent_service.llm_provider.tts(error_msg, instructions=audio_instructions, voice=voice):
|
126
|
+
async for chunk in self.agent_service.llm_provider.tts(error_msg, instructions=audio_instructions, response_format=response_format, voice=voice):
|
123
127
|
yield chunk
|
124
128
|
else:
|
125
129
|
yield error_msg
|
@@ -1,23 +1,23 @@
|
|
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=
|
3
|
+
solana_agent/adapters/llm_adapter.py,sha256=1ypfIwPlngExQWYdm5MIsWePWxkfw_Jq8KVXvr4v1Vg,6294
|
4
4
|
solana_agent/adapters/mongodb_adapter.py,sha256=zvcIZ61zx45cwfjMimXC2RV_D_s6sL5b2Dz6H3HCgFc,2456
|
5
5
|
solana_agent/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
solana_agent/client/solana_agent.py,sha256=
|
6
|
+
solana_agent/client/solana_agent.py,sha256=Q_8sNOXwCe0yd_QBLkv0L-G9Kh5pPnH5pZtRLxVUR6s,3957
|
7
7
|
solana_agent/domains/__init__.py,sha256=HiC94wVPRy-QDJSSRywCRrhrFfTBeHjfi5z-QfZv46U,168
|
8
8
|
solana_agent/domains/agent.py,sha256=Ak_hD5gTCzRqAHLmqtxnny0Xki1qAKR7RzLW9LOQBTg,2930
|
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
11
|
solana_agent/factories/agent_factory.py,sha256=7krNpsAHnle-IFjKqYz4aJgfvlj7yMRhfSeqi-4S2sI,5563
|
12
12
|
solana_agent/interfaces/__init__.py,sha256=IQs1WIM1FeKP1-kY2FEfyhol_dB-I-VAe2rD6jrVF6k,355
|
13
|
-
solana_agent/interfaces/client/client.py,sha256=
|
13
|
+
solana_agent/interfaces/client/client.py,sha256=g5wJez2_q7Ak0db8GYhzBuDoqXfiTVI3El741pjY9AU,1147
|
14
14
|
solana_agent/interfaces/plugins/plugins.py,sha256=TMmTXwHhmkdJpIhgADfrpGGGk7PHP7O9Qi89uA26uMI,3013
|
15
15
|
solana_agent/interfaces/providers/data_storage.py,sha256=Qjui9ISvX_NtOUPTUyjPMNxDoYRpml-aMG8DZy_Qxzc,1509
|
16
|
-
solana_agent/interfaces/providers/llm.py,sha256=
|
16
|
+
solana_agent/interfaces/providers/llm.py,sha256=skCRAThH5QRIIiEqkp5Wo4PnmJkCIsSzEFGTY54mjY0,1580
|
17
17
|
solana_agent/interfaces/providers/memory.py,sha256=oNOH8WZXVW8assDigIWZAWiwkxbpDiKupxA2RB6tQvQ,1010
|
18
18
|
solana_agent/interfaces/repositories/agent.py,sha256=r2MzVYOpEBVN00yqRxr3bUgWUgSwqoI1hRrdHhgFpFU,819
|
19
|
-
solana_agent/interfaces/services/agent.py,sha256=
|
20
|
-
solana_agent/interfaces/services/query.py,sha256=
|
19
|
+
solana_agent/interfaces/services/agent.py,sha256=kUvo0iK5pQe8RTi3cgmBMBBq-3XlBQYp22Ot3CCp064,2045
|
20
|
+
solana_agent/interfaces/services/query.py,sha256=ygrBed9DfXY62UMYszFblljbKjSiR12UuYDUsOVwdhA,1161
|
21
21
|
solana_agent/interfaces/services/routing.py,sha256=gohkt5f9uYDLpu4iDVDk9yj8js9P56R6QHSIDNylgwA,438
|
22
22
|
solana_agent/plugins/__init__.py,sha256=coZdgJKq1ExOaj6qB810i3rEhbjdVlrkN76ozt_Ojgo,193
|
23
23
|
solana_agent/plugins/manager.py,sha256=GWwhfMBn9THwVn7biOvVa25GLthCA1ilWIoDkt5hXNI,5084
|
@@ -28,10 +28,10 @@ solana_agent/repositories/__init__.py,sha256=fP83w83CGzXLnSdq-C5wbw9EhWTYtqE2lQT
|
|
28
28
|
solana_agent/repositories/agent.py,sha256=e1rnsQiigkKwJNLKro86a3b6TBiky3GMfmCRc5b_jPw,3187
|
29
29
|
solana_agent/repositories/memory.py,sha256=0wgoa2bXhpgdBgn9-i9G10PB1bMGYObxcoY9Newll40,4742
|
30
30
|
solana_agent/services/__init__.py,sha256=ab_NXJmwYUCmCrCzuTlZ47bJZINW0Y0F5jfQ9OovidU,163
|
31
|
-
solana_agent/services/agent.py,sha256=
|
32
|
-
solana_agent/services/query.py,sha256=
|
31
|
+
solana_agent/services/agent.py,sha256=DYomQ5y6Y_rSIZuXjS15qOP0x4pa0El6woFaNu3mUPw,13963
|
32
|
+
solana_agent/services/query.py,sha256=MB1CYgsM7Mns0LtdO-K1_LqUX-XaTY1j9eGgbGZwWmg,10534
|
33
33
|
solana_agent/services/routing.py,sha256=TPJ2Pas4acE93QzMEV6ZP670OtTNrVEPa76fz6urEV4,4996
|
34
|
-
solana_agent-15.1.
|
35
|
-
solana_agent-15.1.
|
36
|
-
solana_agent-15.1.
|
37
|
-
solana_agent-15.1.
|
34
|
+
solana_agent-15.1.2.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
|
35
|
+
solana_agent-15.1.2.dist-info/METADATA,sha256=cBGGFFzA22d5X0w1uA7F2eBQqsJVCMgx8hPJOvU78lo,4956
|
36
|
+
solana_agent-15.1.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
37
|
+
solana_agent-15.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|