letta-nightly 0.7.15.dev20250513222014__py3-none-any.whl → 0.7.15.dev20250514104255__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.
@@ -83,6 +83,9 @@ class AnthropicStreamingInterface:
83
83
  self.inner_thoughts_complete = False
84
84
  self.put_inner_thoughts_in_kwarg = put_inner_thoughts_in_kwarg
85
85
 
86
+ # Buffer to handle partial XML tags across chunks
87
+ self.partial_tag_buffer = ""
88
+
86
89
  def get_tool_call_object(self) -> ToolCall:
87
90
  """Useful for agent loop"""
88
91
  return ToolCall(id=self.tool_call_id, function=FunctionCall(arguments=self.accumulated_tool_call_args, name=self.tool_call_name))
@@ -154,8 +157,22 @@ class AnthropicStreamingInterface:
154
157
  f"Streaming integrity failed - received BetaTextDelta object while not in TEXT EventMode: {delta}"
155
158
  )
156
159
 
157
- # TODO: Strip out </thinking> more robustly, this is pretty hacky lol
158
- delta.text = delta.text.replace("</thinking>", "")
160
+ # Combine buffer with current text to handle tags split across chunks
161
+ combined_text = self.partial_tag_buffer + delta.text
162
+
163
+ # Remove all occurrences of </thinking> tag
164
+ cleaned_text = combined_text.replace("</thinking>", "")
165
+
166
+ # Extract just the new content (without the buffer part)
167
+ if len(self.partial_tag_buffer) <= len(cleaned_text):
168
+ delta.text = cleaned_text[len(self.partial_tag_buffer) :]
169
+ else:
170
+ # Edge case: the tag was removed and now the text is shorter than the buffer
171
+ delta.text = ""
172
+
173
+ # Store the last 10 characters (or all if less than 10) for the next chunk
174
+ # This is enough to catch "</thinking" which is 10 characters
175
+ self.partial_tag_buffer = combined_text[-10:] if len(combined_text) > 10 else combined_text
159
176
  self.accumulated_inner_thoughts.append(delta.text)
160
177
 
161
178
  reasoning_message = ReasoningMessage(
@@ -75,7 +75,8 @@ class LLMConfig(BaseModel):
75
75
  description="The reasoning effort to use when generating text reasoning models",
76
76
  )
77
77
  max_reasoning_tokens: int = Field(
78
- 0, description="Configurable thinking budget for extended thinking. Used for enable_reasoner and also for Google Vertex models like Gemini 2.5 Flash. Minimum value is 1024 when used with enable_reasoner."
78
+ 0,
79
+ description="Configurable thinking budget for extended thinking. Used for enable_reasoner and also for Google Vertex models like Gemini 2.5 Flash. Minimum value is 1024 when used with enable_reasoner.",
79
80
  )
80
81
 
81
82
  # FIXME hack to silence pydantic protected namespace warning
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-nightly
3
- Version: 0.7.15.dev20250513222014
3
+ Version: 0.7.15.dev20250514104255
4
4
  Summary: Create LLM agents with long-term memory and custom tools
5
5
  License: Apache License
6
6
  Author: Letta Team
@@ -62,7 +62,7 @@ letta/humans/examples/basic.txt,sha256=Lcp8YESTWvOJgO4Yf_yyQmgo5bKakeB1nIVrwEGG6
62
62
  letta/humans/examples/cs_phd.txt,sha256=9C9ZAV_VuG7GB31ksy3-_NAyk8rjE6YtVOkhp08k1xw,297
63
63
  letta/interface.py,sha256=6GKasvJMASu-kcZch6Hffz1vnHuPA_ryI6cLH2bMArc,13023
64
64
  letta/interfaces/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
- letta/interfaces/anthropic_streaming_interface.py,sha256=OU5Q8OwazIQ6z6AQKGWe6yEHcafnfBiCc3iaMOkbVW4,17038
65
+ letta/interfaces/anthropic_streaming_interface.py,sha256=2ZpZbEjvF5vzNJX8AMVc36TedFYu3SObcv3XhD696s0,18056
66
66
  letta/interfaces/openai_chat_completions_streaming_interface.py,sha256=LANdVBA8UNWscBvsFbWTT8cxNg5fHA_woWU2jkTf6TQ,4911
67
67
  letta/interfaces/utils.py,sha256=c6jvO0dBYHh8DQnlN-B0qeNC64d3CSunhfqlFA4pJTY,278
68
68
  letta/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -218,7 +218,7 @@ letta/schemas/letta_message_content.py,sha256=eF2UEDofQx7S_nS1jc9MZypP4EGVWj7zdi
218
218
  letta/schemas/letta_request.py,sha256=acGJDmrv804Xe0432Vnk6_yD8aUt4LZwK9lQKm56uss,1943
219
219
  letta/schemas/letta_response.py,sha256=lZ_uCwSmV7g7UCBxNyU_r-FFcXAf6_pBsFqgWJ-WkBs,7955
220
220
  letta/schemas/llm_batch_job.py,sha256=i8m58-EFF0xGD7cYfu-LRlbvYZwv5y2B14ckmuRQ_IM,2896
221
- letta/schemas/llm_config.py,sha256=0sXsJm4fYHsggfXhkJMpeiiZ62xtGPOqr-nPlqmWN7c,8651
221
+ letta/schemas/llm_config.py,sha256=EswzTtCXDA9xIRJd8Mu5WUe44UCT9bvY2DeDkOGvHx0,8660
222
222
  letta/schemas/llm_config_overrides.py,sha256=E6qJuVA8TwAAy3VjGitJ5jSQo5PbN-6VPcZOF5qhP9A,1815
223
223
  letta/schemas/memory.py,sha256=GOYDfPKzbWftUWO9Hv4KW7xAi1EIQmC8zpP7qvEkVHw,10245
224
224
  letta/schemas/message.py,sha256=98vA5w2IzA-9fyF9JGpmYKsyg6uyWQqx5mBZVIlFQzU,51165
@@ -341,8 +341,8 @@ letta/streaming_utils.py,sha256=jLqFTVhUL76FeOuYk8TaRQHmPTf3HSRc2EoJwxJNK6U,1194
341
341
  letta/system.py,sha256=mKxmvvekuP8mdgsebRINGBoFbUdJhxLJ260crPBNVyk,8386
342
342
  letta/tracing.py,sha256=j9uyBbx02erQZ307XmZmZSNyzQt-d7ZDB7vhFhjDlsU,8448
343
343
  letta/utils.py,sha256=W8J1FfhRADFqoyx3J8-Z1_aWyG433PBoEh_b5wdOZIg,32262
344
- letta_nightly-0.7.15.dev20250513222014.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
345
- letta_nightly-0.7.15.dev20250513222014.dist-info/METADATA,sha256=6jwxd5EX0GwvMkmIFMO1MDB0memZHZv5e5ylH17eCSg,22274
346
- letta_nightly-0.7.15.dev20250513222014.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
347
- letta_nightly-0.7.15.dev20250513222014.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
348
- letta_nightly-0.7.15.dev20250513222014.dist-info/RECORD,,
344
+ letta_nightly-0.7.15.dev20250514104255.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
345
+ letta_nightly-0.7.15.dev20250514104255.dist-info/METADATA,sha256=01dkW49EkSgKXUVY4iFBwHMxaXvbm1z3V9UrlT9d5AI,22274
346
+ letta_nightly-0.7.15.dev20250514104255.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
347
+ letta_nightly-0.7.15.dev20250514104255.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
348
+ letta_nightly-0.7.15.dev20250514104255.dist-info/RECORD,,