solana-agent 22.0.2__py3-none-any.whl → 22.0.3__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/services/agent.py +37 -7
- {solana_agent-22.0.2.dist-info → solana_agent-22.0.3.dist-info}/METADATA +1 -1
- {solana_agent-22.0.2.dist-info → solana_agent-22.0.3.dist-info}/RECORD +5 -5
- {solana_agent-22.0.2.dist-info → solana_agent-22.0.3.dist-info}/LICENSE +0 -0
- {solana_agent-22.0.2.dist-info → solana_agent-22.0.3.dist-info}/WHEEL +0 -0
solana_agent/services/agent.py
CHANGED
@@ -276,7 +276,7 @@ class AgentService(AgentServiceInterface):
|
|
276
276
|
tool_response += processed_chunk
|
277
277
|
|
278
278
|
# Add to our complete text record and full audio buffer
|
279
|
-
tool_response = self.
|
279
|
+
tool_response = self._clean_for_audio(
|
280
280
|
tool_response)
|
281
281
|
complete_text_response += tool_response
|
282
282
|
full_response_buffer += tool_response
|
@@ -318,8 +318,8 @@ class AgentService(AgentServiceInterface):
|
|
318
318
|
|
319
319
|
# For audio output, now process the complete response
|
320
320
|
if output_format == "audio" and full_response_buffer:
|
321
|
-
# Clean
|
322
|
-
full_response_buffer = self.
|
321
|
+
# Clean text before TTS
|
322
|
+
full_response_buffer = self._clean_for_audio(
|
323
323
|
full_response_buffer)
|
324
324
|
|
325
325
|
# Process the entire response with TTS
|
@@ -427,14 +427,14 @@ class AgentService(AgentServiceInterface):
|
|
427
427
|
- Use exact tool names as shown in AVAILABLE TOOLS
|
428
428
|
"""
|
429
429
|
|
430
|
-
def
|
431
|
-
"""Remove Markdown formatting and
|
430
|
+
def _clean_for_audio(self, text: str) -> str:
|
431
|
+
"""Remove Markdown formatting, emojis, and non-pronounceable characters from text.
|
432
432
|
|
433
433
|
Args:
|
434
|
-
text: Input text with potential Markdown formatting
|
434
|
+
text: Input text with potential Markdown formatting and special characters
|
435
435
|
|
436
436
|
Returns:
|
437
|
-
Clean text without Markdown
|
437
|
+
Clean text without Markdown, emojis, and special characters
|
438
438
|
"""
|
439
439
|
import re
|
440
440
|
|
@@ -469,4 +469,34 @@ class AgentService(AgentServiceInterface):
|
|
469
469
|
# Remove multiple consecutive newlines (keep just one)
|
470
470
|
text = re.sub(r'\n{3,}', '\n\n', text)
|
471
471
|
|
472
|
+
# Remove emojis and other non-pronounceable characters
|
473
|
+
# Common emoji Unicode ranges
|
474
|
+
emoji_pattern = re.compile(
|
475
|
+
"["
|
476
|
+
"\U0001F600-\U0001F64F" # emoticons
|
477
|
+
"\U0001F300-\U0001F5FF" # symbols & pictographs
|
478
|
+
"\U0001F680-\U0001F6FF" # transport & map symbols
|
479
|
+
"\U0001F700-\U0001F77F" # alchemical symbols
|
480
|
+
"\U0001F780-\U0001F7FF" # Geometric Shapes
|
481
|
+
"\U0001F800-\U0001F8FF" # Supplemental Arrows-C
|
482
|
+
"\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs
|
483
|
+
"\U0001FA00-\U0001FA6F" # Chess Symbols
|
484
|
+
"\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A
|
485
|
+
"\U00002702-\U000027B0" # Dingbats
|
486
|
+
"\U000024C2-\U0000257F" # Enclosed characters
|
487
|
+
"\U00002600-\U000026FF" # Miscellaneous Symbols
|
488
|
+
"\U00002700-\U000027BF" # Dingbats
|
489
|
+
"\U0000FE00-\U0000FE0F" # Variation Selectors
|
490
|
+
"\U0001F1E0-\U0001F1FF" # Flags (iOS)
|
491
|
+
"]+",
|
492
|
+
flags=re.UNICODE
|
493
|
+
)
|
494
|
+
text = emoji_pattern.sub(r' ', text)
|
495
|
+
|
496
|
+
# Replace special characters that can cause issues with TTS
|
497
|
+
text = re.sub(r'[^\w\s\.\,\;\:\?\!\'\"\-\(\)]', ' ', text)
|
498
|
+
|
499
|
+
# Replace multiple spaces with a single space
|
500
|
+
text = re.sub(r'\s+', ' ', text)
|
501
|
+
|
472
502
|
return text.strip()
|
@@ -26,10 +26,10 @@ solana_agent/plugins/tools/auto_tool.py,sha256=DgES_cZ6xKSf_HJpFINpvJxrjVlk5oeqa
|
|
26
26
|
solana_agent/repositories/__init__.py,sha256=fP83w83CGzXLnSdq-C5wbw9EhWTYtqE2lQTgp46-X_4,163
|
27
27
|
solana_agent/repositories/memory.py,sha256=mrpmNSQ0D_eLebNY-cBqtecVVpIGXE7s9jCzOWEAuR4,6984
|
28
28
|
solana_agent/services/__init__.py,sha256=ab_NXJmwYUCmCrCzuTlZ47bJZINW0Y0F5jfQ9OovidU,163
|
29
|
-
solana_agent/services/agent.py,sha256=
|
29
|
+
solana_agent/services/agent.py,sha256=ODHI66S2Y65lHrE6Kbe0zNORiz16oaMNGT3x6NoKDKo,19909
|
30
30
|
solana_agent/services/query.py,sha256=os_LRkDIwXQuWW_zJMtm__n0Lvi-AvItdanpCs1bXv0,11362
|
31
31
|
solana_agent/services/routing.py,sha256=PMCSG5m3uLMaHMj3dxNvNfcFZaeaDi7kMr7AEBCzwDE,6499
|
32
|
-
solana_agent-22.0.
|
33
|
-
solana_agent-22.0.
|
34
|
-
solana_agent-22.0.
|
35
|
-
solana_agent-22.0.
|
32
|
+
solana_agent-22.0.3.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
|
33
|
+
solana_agent-22.0.3.dist-info/METADATA,sha256=njD8XhVplqd_P6MtEvMHk88WvXQf7rs2nGuMyq0p4-M,14882
|
34
|
+
solana_agent-22.0.3.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
35
|
+
solana_agent-22.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|