solana-agent 3.0.1__tar.gz → 3.0.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: solana-agent
3
- Version: 3.0.1
3
+ Version: 3.0.2
4
4
  Summary: Build self-learning AI Agents
5
5
  License: MIT
6
6
  Keywords: ai,openai,ai agents
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "solana-agent"
3
- version = "3.0.1"
3
+ version = "3.0.2"
4
4
  description = "Build self-learning AI Agents"
5
5
  authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
6
6
  license = "MIT"
@@ -989,12 +989,13 @@ class AI:
989
989
 
990
990
  async def stream_processor():
991
991
  memory = self.get_memory_context(user_id)
992
+ regular_content = "" # Add this to accumulate regular content
992
993
  response = self._client.chat.completions.create(
993
- model=self._openai_model,
994
+ model=self._main_model,
994
995
  messages=[
995
996
  {
996
997
  "role": "system",
997
- "content": self._instructions + f" Memory: {memory}",
998
+ "content": self._instructions,
998
999
  },
999
1000
  {
1000
1001
  "role": "user",
@@ -1005,6 +1006,7 @@ class AI:
1005
1006
  stream=True,
1006
1007
  )
1007
1008
  for chunk in response:
1009
+ result = ""
1008
1010
  delta = chunk.choices[0].delta
1009
1011
 
1010
1012
  # Process tool call deltas (if any)
@@ -1035,7 +1037,7 @@ class AI:
1035
1037
  messages=[
1036
1038
  {
1037
1039
  "role": "system",
1038
- "content": f" Rules: {self._tool_formatting_instructions}, Result: {result}",
1040
+ "content": f"Rules: {self._tool_formatting_instructions}, Tool Result: {result}, Memory Context: {memory}",
1039
1041
  },
1040
1042
  ],
1041
1043
  stream=True,
@@ -1055,7 +1057,29 @@ class AI:
1055
1057
 
1056
1058
  # Process regular response content
1057
1059
  if delta.content is not None:
1058
- await self._accumulated_value_queue.put(delta.content)
1060
+ regular_content += delta.content # Accumulate instead of directly sending
1061
+
1062
+ # After processing all chunks from the first response
1063
+ if regular_content: # Only if we have regular content
1064
+ # Format the regular content with memory context, similar to tool results
1065
+ response = self._client.chat.completions.create(
1066
+ model=self._tool_formatting_model,
1067
+ messages=[
1068
+ {
1069
+ "role": "system",
1070
+ "content": f"Rules: {self._memory_instructions}, Regular Content: {regular_content}, Memory Context: {memory}",
1071
+ },
1072
+ {
1073
+ "role": "user",
1074
+ "content": transcript,
1075
+ }
1076
+ ],
1077
+ stream=True,
1078
+ )
1079
+ for chunk in response:
1080
+ delta = chunk.choices[0].delta
1081
+ if delta.content is not None:
1082
+ await self._accumulated_value_queue.put(delta.content)
1059
1083
 
1060
1084
  # Start the stream processor as a background task
1061
1085
  asyncio.create_task(stream_processor())
File without changes
File without changes