solana-agent 17.0.3__py3-none-any.whl → 17.0.5__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.
@@ -92,38 +92,47 @@ class QueryService(QueryServiceInterface):
92
92
 
93
93
  # Route query to appropriate agent
94
94
  agent_name = await self.routing_service.route_query(user_text)
95
- print(f"DEBUG: Routed to agent: {agent_name}")
95
+ print(f"Routed to agent: {agent_name}")
96
96
 
97
- # For text output, we can directly collect and yield chunks
98
- if output_format == "text":
99
- full_response = ""
100
- async for chunk in self.agent_service.generate_response(
97
+ # Generate response
98
+ if output_format == "audio":
99
+ async for audio_chunk in self.agent_service.generate_response(
101
100
  agent_name=agent_name,
102
101
  user_id=user_id,
103
- query=user_text,
102
+ query=query,
104
103
  memory_context=memory_context,
105
- output_format="text",
104
+ output_format="audio",
105
+ audio_voice=audio_voice,
106
+ audio_input_format=audio_input_format,
107
+ audio_output_format=audio_output_format,
108
+ audio_instructions=audio_instructions
106
109
  ):
107
- yield chunk
108
- full_response += chunk
110
+ yield audio_chunk
109
111
 
110
- # For audio output, we'll yield audio chunks while collecting text separately
112
+ if self.memory_provider:
113
+ await self._store_conversation(
114
+ user_id=user_id,
115
+ user_message=user_text,
116
+ assistant_message=self.agent_service.last_text_response,
117
+ )
111
118
  else:
119
+ full_text_response = ""
112
120
  async for chunk in self.agent_service.generate_response(
113
121
  agent_name=agent_name,
114
122
  user_id=user_id,
115
123
  query=user_text,
116
124
  memory_context=memory_context,
117
- output_format="audio",
118
- audio_input_format=audio_input_format,
119
- audio_output_format=audio_output_format,
120
- audio_voice=audio_voice,
125
+ output_format="text"
121
126
  ):
122
127
  yield chunk
128
+ full_text_response += chunk
123
129
 
124
- # Store conversation with the full text response
125
- if self.memory_provider:
126
- await self._store_conversation(user_id, user_text, self.agent_service.last_text_response)
130
+ if self.memory_provider and full_text_response:
131
+ await self._store_conversation(
132
+ user_id=user_id,
133
+ user_message=user_text,
134
+ assistant_message=full_text_response
135
+ )
127
136
 
128
137
  except Exception as e:
129
138
  error_msg = f"I apologize for the technical difficulty. {str(e)}"
@@ -248,25 +257,26 @@ class QueryService(QueryServiceInterface):
248
257
  }
249
258
 
250
259
  async def _store_conversation(
251
- self, user_id: str, user_text: str, response_text: str
260
+ self, user_id: str, user_message: str, assistant_message: str
252
261
  ) -> None:
253
262
  """Store conversation history in memory provider.
254
263
 
255
264
  Args:
256
265
  user_id: User ID
257
- user_text: User message
258
- response_text: Assistant response
266
+ user_message: User message
267
+ assistant_message: Assistant message
259
268
  """
260
269
  if self.memory_provider:
261
270
  try:
262
271
  # Truncate excessively long responses
263
- truncated_response = self._truncate(response_text)
272
+ truncated_assistant_message = self._truncate(assistant_message)
273
+ truncated_user_message = self._truncate(user_message)
264
274
 
265
275
  await self.memory_provider.store(
266
276
  user_id,
267
277
  [
268
- {"role": "user", "content": user_text},
269
- {"role": "assistant", "content": truncated_response},
278
+ {"role": "user", "content": truncated_user_message},
279
+ {"role": "assistant", "content": truncated_assistant_message},
270
280
  ],
271
281
  )
272
282
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 17.0.3
3
+ Version: 17.0.5
4
4
  Summary: The Future of Work
5
5
  License: MIT
6
6
  Keywords: ai,openai,ai agents,agi
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
14
  Classifier: Programming Language :: Python :: 3 :: Only
15
15
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
- Requires-Dist: openai (>=1.68.0,<2.0.0)
16
+ Requires-Dist: openai (>=1.68.1,<2.0.0)
17
17
  Requires-Dist: pydantic (>=2.10.6,<3.0.0)
18
18
  Requires-Dist: pymongo (>=4.11.3,<5.0.0)
19
19
  Requires-Dist: zep-cloud (>=2.7.0,<3.0.0)
@@ -29,9 +29,9 @@ solana_agent/repositories/agent.py,sha256=e1rnsQiigkKwJNLKro86a3b6TBiky3GMfmCRc5
29
29
  solana_agent/repositories/memory.py,sha256=GABGwaz00thjviHewLvb18NeKE8dkBROxy_stsiiWrE,4722
30
30
  solana_agent/services/__init__.py,sha256=ab_NXJmwYUCmCrCzuTlZ47bJZINW0Y0F5jfQ9OovidU,163
31
31
  solana_agent/services/agent.py,sha256=j0aI_BGaY5Nhkb9ga0r4BqI3qMKu5TOc4QPQsU3NHyQ,17000
32
- solana_agent/services/query.py,sha256=1BAb4UjpydwtJjut8oq724BJohe9ceMigMX-rkI5j7s,10820
32
+ solana_agent/services/query.py,sha256=rm7XlTCcp5NeorIaLUdr7rdxtWCgg1Q1qe5YuI1bumo,11246
33
33
  solana_agent/services/routing.py,sha256=TPJ2Pas4acE93QzMEV6ZP670OtTNrVEPa76fz6urEV4,4996
34
- solana_agent-17.0.3.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
35
- solana_agent-17.0.3.dist-info/METADATA,sha256=kioM7hvaI97S8skANaI4oAcS2gnKgGMvI2jKTTHf5vg,4888
36
- solana_agent-17.0.3.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
37
- solana_agent-17.0.3.dist-info/RECORD,,
34
+ solana_agent-17.0.5.dist-info/LICENSE,sha256=BnSRc-NSFuyF2s496l_4EyrwAP6YimvxWcjPiJ0J7g4,1057
35
+ solana_agent-17.0.5.dist-info/METADATA,sha256=2sWznTyIgbXcjARY3RqHl_8y_4FeG3TmF1jYhf-wQxw,4888
36
+ solana_agent-17.0.5.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
37
+ solana_agent-17.0.5.dist-info/RECORD,,