Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

chore: Various feature requests and bug fixes (#2509)

Matthew Zhou0d95be218521
diff --git a/Dockerfile b/Dockerfile
index 0e99ff195..14650051d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -65,7 +65,7 @@ ENV LETTA_ENVIRONMENT=${LETTA_ENVIRONMENT} \
POSTGRES_PASSWORD=letta \
POSTGRES_DB=letta \
COMPOSIO_DISABLE_VERSION_CHECK=true \
- OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
+ LETTA_OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4317"
WORKDIR /app
diff --git a/letta/agents/ephemeral_memory_agent.py b/letta/agents/ephemeral_memory_agent.py
new file mode 100644
index 000000000..03fc64e07
--- /dev/null
+++ b/letta/agents/ephemeral_memory_agent.py
@@ -0,0 +1,114 @@
+from typing import AsyncGenerator, Dict, List
+
+import openai
+
+from letta.agents.base_agent import BaseAgent
+from letta.helpers.tool_execution_helper import enable_strict_mode
+from letta.orm.enums import ToolType
+from letta.schemas.agent import AgentState
+from letta.schemas.enums import MessageRole
+from letta.schemas.letta_message import UserMessage
+from letta.schemas.letta_message_content import TextContent
+from letta.schemas.message import Message
+from letta.schemas.openai.chat_completion_request import ChatCompletionRequest, Tool
+from letta.schemas.user import User
+from letta.services.agent_manager import AgentManager
+from letta.services.message_manager import MessageManager
+
+
+class EphemeralMemoryAgent(BaseAgent):
+ """
+ A stateless agent that helps with offline memory computations.
+
+ """
+
+ def __init__(
+ self,
+ agent_id: str,
+ openai_client: openai.AsyncClient,
+ message_manager: MessageManager,
+ agent_manager: AgentManager,
+ actor: User,
+ ):
+ super().__init__(
+ agent_id=agent_id,
+ openai_client=openai_client,
+ message_manager=message_manager,
+ agent_manager=agent_manager,
+ actor=actor,
+ )
+
+ async def step(self, input_message: UserMessage) -> List[Message]:
+ """
+ Synchronous method that takes a user's input text and returns a summary from OpenAI.
+ Returns a list of ephemeral Message objects containing both the user text and the assistant summary.
+ """
+ agent_state = self.agent_manager.get_agent_by_id(agent_id=self.agent_id, actor=self.actor)
+
+ input_message = self.pre_process_input_message(input_message=input_message)
+ request = self._build_openai_request([input_message], agent_state)
+
+ chat_completion = await self.openai_client.chat.completions.create(**request.model_dump(exclude_unset=True))
+
+ return [
+ Message(
+ role=MessageRole.assistant,
+ content=[TextContent(text=chat_completion.choices[0].message.content.strip())],
+ )
+ ]
+
+ def pre_process_input_message(self, input_message: UserMessage) -> Dict:
+ input_prompt_augmented = f"""
+ You are a memory recall agent whose job is to comb through a large set of messages and write relevant memories in relation to a user query.
+ Your response will directly populate a "memory block" called "human" that describes the user, that will be used to answer more questions in the future.
+ You should err on the side of being more verbose, and also try to *predict* the trajectory of the conversation, and pull memories or messages you think will be relevant to where the conversation is going.
+
+ Your response should include:
+ - A high level summary of the relevant events/timeline of the conversation relevant to the query
+ - Direct citations of quotes from the messages you used while creating the summary
+
+ Here is a history of the messages so far:
+
+ {self._format_messages_llm_friendly()}
+
+ This is the query:
+
+ "{input_message.content}"
+
+ Your response:
+ """
+
+ input_message.content = input_prompt_augmented
+ # print(input_prompt_augmented)
+ return input_message.model_dump()
+
+ def _format_messages_llm_friendly(self):
+ messages = self.message_manager.list_messages_for_agent(agent_id=self.agent_id, actor=self.actor)
+
+ llm_friendly_messages = [f"{m.role}: {m.content[0].text}" for m in messages if m.content and isinstance(m.content[0], TextContent)]
+ return "\n".join(llm_friendly_messages)
+
+ def _build_openai_request(self, openai_messages: List[Dict], agent_state: AgentState) -> ChatCompletionRequest:
+ openai_request = ChatCompletionRequest(
+ model=agent_state.llm_config.model,
+ messages=openai_messages,
+ # tools=self._build_tool_schemas(agent_state),
+ # tool_choice="auto",
+ user=self.actor.id,
+ max_completion_tokens=agent_state.llm_config.max_tokens,
+ temperature=agent_state.llm_config.temperature,
+ stream=False,
+ )
+ return openai_request
+
+ def _build_tool_schemas(self, agent_state: AgentState) -> List[Tool]:
+ # Only include memory tools
+ tools = [t for t in agent_state.tools if t.tool_type in {ToolType.LETTA_CORE, ToolType.LETTA_MEMORY_CORE}]
+
+ return [Tool(type="function", function=enable_strict_mode(t.json_schema)) for t in tools]
+
+ async def step_stream(self, input_message: UserMessage) -> AsyncGenerator[str, None]:
+ """
+ This agent is synchronous-only. If called in an async context, raise an error.
+ """
+ raise NotImplementedError("EphemeralMemoryAgent does not support async step.")
diff --git a/letta/agents/low_latency_agent.py b/letta/agents/voice_agent.py
similarity index 60%
rename from letta/agents/low_latency_agent.py
rename to letta/agents/voice_agent.py
index 8fe3b7c02..f60bb6612 100644
--- a/letta/agents/low_latency_agent.py
+++ b/letta/agents/voice_agent.py
@@ -5,7 +5,7 @@ from typing import Any, AsyncGenerator, Dict, List, Tuple
import openai
from letta.agents.base_agent import BaseAgent
-from letta.agents.ephemeral_agent import EphemeralAgent
+from letta.agents.ephemeral_memory_agent import EphemeralMemoryAgent
from letta.constants import NON_USER_MSG_PREFIX
from letta.helpers.datetime_helpers import get_utc_time
from letta.helpers.tool_execution_helper import (
@@ -42,13 +42,12 @@ from letta.services.helpers.agent_manager_helper import compile_system_message
from letta.services.message_manager import MessageManager
from letta.services.passage_manager import PassageManager
from letta.services.summarizer.enums import SummarizationMode
-from letta.services.summarizer.summarizer import Summarizer
from letta.utils import united_diff
logger = get_logger(__name__)
-class LowLatencyAgent(BaseAgent):
+class VoiceAgent(BaseAgent):
"""
A function-calling loop for streaming OpenAI responses with tool execution.
This agent:
@@ -65,9 +64,9 @@ class LowLatencyAgent(BaseAgent):
agent_manager: AgentManager,
block_manager: BlockManager,
actor: User,
+ message_buffer_limit: int,
+ message_buffer_min: int,
summarization_mode: SummarizationMode = SummarizationMode.STATIC_MESSAGE_BUFFER,
- message_buffer_limit: int = 10,
- message_buffer_min: int = 4,
):
super().__init__(
agent_id=agent_id, openai_client=openai_client, message_manager=message_manager, agent_manager=agent_manager, actor=actor
@@ -79,75 +78,78 @@ class LowLatencyAgent(BaseAgent):
self.passage_manager = PassageManager() # TODO: pass this in
# TODO: This is not guaranteed to exist!
self.summary_block_label = "human"
- self.summarizer = Summarizer(
- mode=summarization_mode,
- summarizer_agent=EphemeralAgent(
- agent_id=agent_id, openai_client=openai_client, message_manager=message_manager, agent_manager=agent_manager, actor=actor
- ),
- message_buffer_limit=message_buffer_limit,
- message_buffer_min=message_buffer_min,
- )
+ # self.summarizer = Summarizer(
+ # mode=summarization_mode,
+ # summarizer_agent=EphemeralAgent(
+ # agent_id=agent_id, openai_client=openai_client, message_manager=message_manager, agent_manager=agent_manager, actor=actor
+ # ),
+ # message_buffer_limit=message_buffer_limit,
+ # message_buffer_min=message_buffer_min,
+ # )
self.message_buffer_limit = message_buffer_limit
- self.message_buffer_min = message_buffer_min
+ # self.message_buffer_min = message_buffer_min
+ self.offline_memory_agent = EphemeralMemoryAgent(
+ agent_id=agent_id, openai_client=openai_client, message_manager=message_manager, agent_manager=agent_manager, actor=actor
+ )
async def step(self, input_message: UserMessage) -> List[Message]:
raise NotImplementedError("LowLatencyAgent does not have a synchronous step implemented currently.")
async def step_stream(self, input_message: UserMessage) -> AsyncGenerator[str, None]:
"""
- Async generator that yields partial tokens as SSE events, handles tool calls,
- and streams error messages if OpenAI API failures occur.
+ Main streaming loop that yields partial tokens.
+ Whenever we detect a tool call, we yield from _handle_ai_response as well.
"""
- input_message = self.pre_process_input_message(input_message=input_message)
- agent_state = self.agent_manager.get_agent_by_id(agent_id=self.agent_id, actor=self.actor)
+ input_message = self.pre_process_input_message(input_message)
+ agent_state = self.agent_manager.get_agent_by_id(self.agent_id, actor=self.actor)
in_context_messages = self.message_manager.get_messages_by_ids(message_ids=agent_state.message_ids, actor=self.actor)
letta_message_db_queue = [create_user_message(input_message=input_message, agent_id=agent_state.id, actor=self.actor)]
in_memory_message_history = [input_message]
+ # TODO: Define max steps here
while True:
- # Constantly pull down and integrate memory blocks
- in_context_messages = self._rebuild_memory(in_context_messages=in_context_messages, agent_state=agent_state)
-
- # Convert Letta messages to OpenAI messages
+ # Rebuild memory each loop
+ in_context_messages = self._rebuild_memory(in_context_messages, agent_state)
openai_messages = convert_letta_messages_to_openai(in_context_messages)
openai_messages.extend(in_memory_message_history)
+
request = self._build_openai_request(openai_messages, agent_state)
- # Execute the request
stream = await self.openai_client.chat.completions.create(**request.model_dump(exclude_unset=True))
streaming_interface = OpenAIChatCompletionsStreamingInterface(stream_pre_execution_message=True)
- async for sse in streaming_interface.process(stream):
- yield sse
+ # 1) Yield partial tokens from OpenAI
+ async for sse_chunk in streaming_interface.process(stream):
+ yield sse_chunk
- # Process the AI response (buffered messages, tool execution, etc.)
- continue_execution = await self._handle_ai_response(
- streaming_interface, agent_state, in_memory_message_history, letta_message_db_queue
+ # 2) Now handle the final AI response. This might yield more text (stalling, etc.)
+ should_continue = await self._handle_ai_response(
+ streaming_interface,
+ agent_state,
+ in_memory_message_history,
+ letta_message_db_queue,
)
- if not continue_execution:
+ if not should_continue:
break
- # Rebuild context window
+ # Rebuild context window if desired
await self._rebuild_context_window(in_context_messages, letta_message_db_queue, agent_state)
-
yield "data: [DONE]\n\n"
async def _handle_ai_response(
self,
- streaming_interface: OpenAIChatCompletionsStreamingInterface,
+ streaming_interface: "OpenAIChatCompletionsStreamingInterface",
agent_state: AgentState,
in_memory_message_history: List[Dict[str, Any]],
letta_message_db_queue: List[Any],
) -> bool:
"""
- Handles AI response processing, including buffering messages, detecting tool calls,
- executing tools, and deciding whether to continue execution.
-
- Returns:
- bool: True if execution should continue, False if the step loop should terminate.
+ Now that streaming is done, handle the final AI response.
+ This might yield additional SSE tokens if we do stalling.
+ At the end, set self._continue_execution accordingly.
"""
- # Handle assistant message buffering
+ # 1. If we have any leftover content from partial stream, store it as an assistant message
if streaming_interface.content_buffer:
content = "".join(streaming_interface.content_buffer)
in_memory_message_history.append({"role": "assistant", "content": content})
@@ -160,82 +162,92 @@ class LowLatencyAgent(BaseAgent):
)
letta_message_db_queue.extend(assistant_msgs)
- # Handle tool execution if a tool call occurred
+ # 2. If a tool call was requested, handle it
if streaming_interface.tool_call_happened:
+ tool_call_name = streaming_interface.tool_call_name
+ tool_call_args_str = streaming_interface.tool_call_args_str or "{}"
try:
- tool_args = json.loads(streaming_interface.tool_call_args_str)
+ tool_args = json.loads(tool_call_args_str)
except json.JSONDecodeError:
tool_args = {}
tool_call_id = streaming_interface.tool_call_id or f"call_{uuid.uuid4().hex[:8]}"
-
assistant_tool_call_msg = AssistantMessage(
content=None,
tool_calls=[
ToolCall(
id=tool_call_id,
function=ToolCallFunction(
- name=streaming_interface.tool_call_name,
- arguments=streaming_interface.tool_call_args_str,
+ name=tool_call_name,
+ arguments=tool_call_args_str,
),
)
],
)
in_memory_message_history.append(assistant_tool_call_msg.model_dump())
- tool_result, function_call_success = await self._execute_tool(
- tool_name=streaming_interface.tool_call_name,
+ tool_result, success_flag = await self._execute_tool(
+ tool_name=tool_call_name,
tool_args=tool_args,
agent_state=agent_state,
)
- tool_message = ToolMessage(content=json.dumps({"result": tool_result}), tool_call_id=tool_call_id)
+ # 3. Provide function_call response back into the conversation
+ tool_message = ToolMessage(
+ content=json.dumps({"result": tool_result}),
+ tool_call_id=tool_call_id,
+ )
in_memory_message_history.append(tool_message.model_dump())
+ # 4. Insert heartbeat message for follow-up
heartbeat_user_message = UserMessage(
content=f"{NON_USER_MSG_PREFIX} Tool finished executing. Summarize the result for the user."
)
in_memory_message_history.append(heartbeat_user_message.model_dump())
+ # 5. Also store in DB
tool_call_messages = create_tool_call_messages_from_openai_response(
agent_id=agent_state.id,
model=agent_state.llm_config.model,
- function_name=streaming_interface.tool_call_name,
+ function_name=tool_call_name,
function_arguments=tool_args,
tool_call_id=tool_call_id,
- function_call_success=function_call_success,
+ function_call_success=success_flag,
function_response=tool_result,
actor=self.actor,
add_heartbeat_request_system_message=True,
)
letta_message_db_queue.extend(tool_call_messages)
- # Continue execution by restarting the loop with updated context
+ # Because we have new data, we want to continue the while-loop in `step_stream`
return True
-
- # Exit the loop if finish_reason_stop or no tool call occurred
- return not streaming_interface.finish_reason_stop
+ else:
+ # If we got here, there's no tool call. If finish_reason_stop => done
+ return not streaming_interface.finish_reason_stop
async def _rebuild_context_window(
self, in_context_messages: List[Message], letta_message_db_queue: List[Message], agent_state: AgentState
) -> None:
new_letta_messages = self.message_manager.create_many_messages(letta_message_db_queue, actor=self.actor)
+ new_in_context_messages = in_context_messages + new_letta_messages
- # TODO: Make this more general and configurable, less brittle
- target_block = next(b for b in agent_state.memory.blocks if b.label == self.summary_block_label)
- previous_summary = self.block_manager.get_block_by_id(block_id=target_block.id, actor=self.actor).value
- new_in_context_messages, summary_str, updated = await self.summarizer.summarize(
- in_context_messages=in_context_messages, new_letta_messages=new_letta_messages, previous_summary=previous_summary
- )
-
- if updated:
- self.block_manager.update_block(block_id=target_block.id, block_update=BlockUpdate(value=summary_str), actor=self.actor)
+ if len(new_in_context_messages) > self.message_buffer_limit:
+ cutoff = len(new_in_context_messages) - self.message_buffer_limit
+ new_in_context_messages = [new_in_context_messages[0]] + new_in_context_messages[cutoff:]
self.agent_manager.set_in_context_messages(
agent_id=self.agent_id, message_ids=[m.id for m in new_in_context_messages], actor=self.actor
)
def _rebuild_memory(self, in_context_messages: List[Message], agent_state: AgentState) -> List[Message]:
+ # Refresh memory
+ # TODO: This only happens for the summary block
+ # TODO: We want to extend this refresh to be general, and stick it in agent_manager
+ for i, b in enumerate(agent_state.memory.blocks):
+ if b.label == self.summary_block_label:
+ agent_state.memory.blocks[i] = self.block_manager.get_block_by_id(block_id=b.id, actor=self.actor)
+ break
+
# TODO: This is a pretty brittle pattern established all over our code, need to get rid of this
curr_system_message = in_context_messages[0]
curr_memory_str = agent_state.memory.compile()
@@ -249,8 +261,8 @@ class LowLatencyAgent(BaseAgent):
memory_edit_timestamp = get_utc_time()
- num_messages = self.message_manager.size(actor=actor, agent_id=agent_id)
- num_archival_memories = self.passage_manager.size(actor=actor, agent_id=agent_id)
+ num_messages = self.message_manager.size(actor=self.actor, agent_id=agent_state.id)
+ num_archival_memories = self.passage_manager.size(actor=self.actor, agent_id=agent_state.id)
new_system_message_str = compile_system_message(
system_prompt=agent_state.system,
@@ -296,8 +308,37 @@ class LowLatencyAgent(BaseAgent):
else:
tools = agent_state.tools
+ # Special tool state
+ recall_memory_utterance_description = (
+ "A lengthier message to be uttered while your memories of the current conversation are being re-contextualized."
+ "You should stall naturally and show the user you're thinking hard. The main thing is to not leave the user in silence."
+ "You MUST also include punctuation at the end of this message."
+ )
+ recall_memory_json = Tool(
+ type="function",
+ function=enable_strict_mode(
+ add_pre_execution_message(
+ {
+ "name": "recall_memory",
+ "description": "Retrieve relevant information from memory based on a given query. Use when you don't remember the answer to a question.",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "query": {
+ "type": "string",
+ "description": "A description of what the model is trying to recall from memory.",
+ }
+ },
+ "required": ["query"],
+ },
+ },
+ description=recall_memory_utterance_description,
+ )
+ ),
+ )
+
# TODO: Customize whether or not to have heartbeats, pre_exec_message, etc.
- return [
+ return [recall_memory_json] + [
Tool(type="function", function=enable_strict_mode(add_pre_execution_message(remove_request_heartbeat(t.json_schema))))
for t in tools
]
@@ -306,19 +347,32 @@ class LowLatencyAgent(BaseAgent):
"""
Executes a tool and returns (result, success_flag).
"""
- target_tool = next((x for x in agent_state.tools if x.name == tool_name), None)
- if not target_tool:
- return f"Tool not found: {tool_name}", False
+ # Special memory case
+ if tool_name == "recall_memory":
+ # TODO: Make this safe
+ await self._recall_memory(tool_args["query"], agent_state)
+ return f"Successfully recalled memory and populated {self.summary_block_label} block.", True
+ else:
+ target_tool = next((x for x in agent_state.tools if x.name == tool_name), None)
+ if not target_tool:
+ return f"Tool not found: {tool_name}", False
- try:
- tool_result, _ = execute_external_tool(
- agent_state=agent_state,
- function_name=tool_name,
- function_args=tool_args,
- target_letta_tool=target_tool,
- actor=self.actor,
- allow_agent_state_modifications=False,
- )
- return tool_result, True
- except Exception as e:
- return f"Failed to call tool. Error: {e}", False
+ try:
+ tool_result, _ = execute_external_tool(
+ agent_state=agent_state,
+ function_name=tool_name,
+ function_args=tool_args,
+ target_letta_tool=target_tool,
+ actor=self.actor,
+ allow_agent_state_modifications=False,
+ )
+ return tool_result, True
+ except Exception as e:
+ return f"Failed to call tool. Error: {e}", False
+
+ async def _recall_memory(self, query, agent_state: AgentState) -> None:
+ results = await self.offline_memory_agent.step(UserMessage(content=query))
+ target_block = next(b for b in agent_state.memory.blocks if b.label == self.summary_block_label)
+ self.block_manager.update_block(
+ block_id=target_block.id, block_update=BlockUpdate(value=results[0].content[0].text), actor=self.actor
+ )
diff --git a/letta/functions/function_sets/multi_agent.py b/letta/functions/function_sets/multi_agent.py
index 98f513efb..3358c7889 100644
--- a/letta/functions/function_sets/multi_agent.py
+++ b/letta/functions/function_sets/multi_agent.py
@@ -9,6 +9,8 @@ from letta.functions.helpers import (
)
from letta.schemas.enums import MessageRole
from letta.schemas.message import MessageCreate
+from letta.server.rest_api.utils import get_letta_server
+from letta.utils import log_telemetry
if TYPE_CHECKING:
from letta.agent import Agent
@@ -85,8 +87,51 @@ def send_message_to_agents_matching_tags(self: "Agent", message: str, match_all:
response corresponds to a single agent. Agents that do not respond will not have an entry
in the returned list.
"""
+ log_telemetry(
+ self.logger,
+ "_send_message_to_agents_matching_tags_async start",
+ message=message,
+ match_all=match_all,
+ match_some=match_some,
+ )
+ server = get_letta_server()
+
+ augmented_message = (
+ f"[Incoming message from agent with ID '{self.agent_state.id}' - to reply to this message, "
+ f"make sure to use the 'send_message' at the end, and the system will notify the sender of your response] "
+ f"{message}"
+ )
- return asyncio.run(_send_message_to_agents_matching_tags_async(self, message, match_all, match_some))
+ # Retrieve up to 100 matching agents
+ log_telemetry(
+ self.logger,
+ "_send_message_to_agents_matching_tags_async listing agents start",
+ message=message,
+ match_all=match_all,
+ match_some=match_some,
+ )
+ matching_agents = server.agent_manager.list_agents_matching_tags(actor=self.user, match_all=match_all, match_some=match_some)
+
+ log_telemetry(
+ self.logger,
+ "_send_message_to_agents_matching_tags_async listing agents finish",
+ message=message,
+ match_all=match_all,
+ match_some=match_some,
+ )
+
+ # Create a system message
+ messages = [MessageCreate(role=MessageRole.system, content=augmented_message, name=self.agent_state.name)]
+
+ result = asyncio.run(_send_message_to_agents_matching_tags_async(self, server, messages, matching_agents))
+ log_telemetry(
+ self.logger,
+ "_send_message_to_agents_matching_tags_async finish",
+ messages=message,
+ match_all=match_all,
+ match_some=match_some,
+ )
+ return result
def send_message_to_all_agents_in_group(self: "Agent", message: str) -> List[str]:
diff --git a/letta/functions/helpers.py b/letta/functions/helpers.py
index ebe78a6a5..bd40d3e72 100644
--- a/letta/functions/helpers.py
+++ b/letta/functions/helpers.py
@@ -93,7 +93,7 @@ def execute_composio_action(
entity_id = entity_id or os.getenv(COMPOSIO_ENTITY_ENV_VAR_KEY, DEFAULT_ENTITY_ID)
try:
- composio_toolset = ComposioToolSet(api_key=api_key, entity_id=entity_id)
+ composio_toolset = ComposioToolSet(api_key=api_key, entity_id=entity_id, lock=False)
response = composio_toolset.execute_action(action=action_name, params=args)
except ApiKeyNotProvidedError:
raise RuntimeError(
@@ -533,57 +533,17 @@ def fire_and_forget_send_to_agent(
async def _send_message_to_agents_matching_tags_async(
- sender_agent: "Agent", message: str, match_all: List[str], match_some: List[str]
+ sender_agent: "Agent", server: "SyncServer", messages: List[MessageCreate], matching_agents: List["AgentState"]
) -> List[str]:
- log_telemetry(
- sender_agent.logger,
- "_send_message_to_agents_matching_tags_async start",
- message=message,
- match_all=match_all,
- match_some=match_some,
- )
- server = get_letta_server()
-
- augmented_message = (
- f"[Incoming message from agent with ID '{sender_agent.agent_state.id}' - to reply to this message, "
- f"make sure to use the 'send_message' at the end, and the system will notify the sender of your response] "
- f"{message}"
- )
-
- # Retrieve up to 100 matching agents
- log_telemetry(
- sender_agent.logger,
- "_send_message_to_agents_matching_tags_async listing agents start",
- message=message,
- match_all=match_all,
- match_some=match_some,
- )
- matching_agents = server.agent_manager.list_agents_matching_tags(actor=sender_agent.user, match_all=match_all, match_some=match_some)
-
- log_telemetry(
- sender_agent.logger,
- "_send_message_to_agents_matching_tags_async listing agents finish",
- message=message,
- match_all=match_all,
- match_some=match_some,
- )
-
- # Create a system message
- messages = [MessageCreate(role=MessageRole.system, content=augmented_message, name=sender_agent.agent_state.name)]
-
- # Possibly limit concurrency to avoid meltdown:
- sem = asyncio.Semaphore(settings.multi_agent_concurrent_sends)
-
async def _send_single(agent_state):
- async with sem:
- return await async_send_message_with_retries(
- server=server,
- sender_agent=sender_agent,
- target_agent_id=agent_state.id,
- messages=messages,
- max_retries=3,
- timeout=settings.multi_agent_send_message_timeout,
- )
+ return await async_send_message_with_retries(
+ server=server,
+ sender_agent=sender_agent,
+ target_agent_id=agent_state.id,
+ messages=messages,
+ max_retries=3,
+ timeout=settings.multi_agent_send_message_timeout,
+ )
tasks = [asyncio.create_task(_send_single(agent_state)) for agent_state in matching_agents]
results = await asyncio.gather(*tasks, return_exceptions=True)
@@ -594,13 +554,6 @@ async def _send_message_to_agents_matching_tags_async(
else:
final.append(r)
- log_telemetry(
- sender_agent.logger,
- "_send_message_to_agents_matching_tags_async finish",
- message=message,
- match_all=match_all,
- match_some=match_some,
- )
return final
diff --git a/letta/functions/mcp_client/base_client.py b/letta/functions/mcp_client/base_client.py
index 20ea92645..851c3d302 100644
--- a/letta/functions/mcp_client/base_client.py
+++ b/letta/functions/mcp_client/base_client.py
@@ -1,9 +1,10 @@
import asyncio
from typing import List, Optional, Tuple
-from mcp import ClientSession, Tool
+from mcp import ClientSession
-from letta.functions.mcp_client.types import BaseServerConfig
+from letta.functions.mcp_client.exceptions import MCPTimeoutError
+from letta.functions.mcp_client.types import BaseServerConfig, MCPTool
from letta.log import get_logger
from letta.settings import tool_settings
@@ -31,9 +32,7 @@ class BaseMCPClient:
)
self.initialized = True
except asyncio.TimeoutError:
- raise RuntimeError(
- f"Timed out while initializing session for MCP server {self.server_config.server_name} (timeout={tool_settings.mcp_connect_to_server_timeout}s)."
- )
+ raise MCPTimeoutError("initializing session", self.server_config.server_name, tool_settings.mcp_connect_to_server_timeout)
else:
raise RuntimeError(
f"Connecting to MCP server failed. Please review your server config: {self.server_config.model_dump_json(indent=4)}"
@@ -42,7 +41,7 @@ class BaseMCPClient:
def _initialize_connection(self, server_config: BaseServerConfig, timeout: float) -> bool:
raise NotImplementedError("Subclasses must implement _initialize_connection")
- def list_tools(self) -> List[Tool]:
+ def list_tools(self) -> List[MCPTool]:
self._check_initialized()
try:
response = self.loop.run_until_complete(
@@ -50,11 +49,10 @@ class BaseMCPClient:
)
return response.tools
except asyncio.TimeoutError:
- # Could log, throw a custom exception, etc.
logger.error(
f"Timed out while listing tools for MCP server {self.server_config.server_name} (timeout={tool_settings.mcp_list_tools_timeout}s)."
)
- return []
+ raise MCPTimeoutError("listing tools", self.server_config.server_name, tool_settings.mcp_list_tools_timeout)
def execute_tool(self, tool_name: str, tool_args: dict) -> Tuple[str, bool]:
self._check_initialized()
@@ -67,7 +65,7 @@ class BaseMCPClient:
logger.error(
f"Timed out while executing tool '{tool_name}' for MCP server {self.server_config.server_name} (timeout={tool_settings.mcp_execute_tool_timeout}s)."
)
- return "", True
+ raise MCPTimeoutError(f"executing tool '{tool_name}'", self.server_config.server_name, tool_settings.mcp_execute_tool_timeout)
def _check_initialized(self):
if not self.initialized:
diff --git a/letta/functions/mcp_client/exceptions.py b/letta/functions/mcp_client/exceptions.py
new file mode 100644
index 000000000..94bf164c8
--- /dev/null
+++ b/letta/functions/mcp_client/exceptions.py
@@ -0,0 +1,6 @@
+class MCPTimeoutError(RuntimeError):
+ """Custom exception raised when an MCP operation times out."""
+
+ def __init__(self, operation: str, server_name: str, timeout: float):
+ message = f"Timed out while {operation} for MCP server {server_name} (timeout={timeout}s)."
+ super().__init__(message)
diff --git a/letta/helpers/tool_execution_helper.py b/letta/helpers/tool_execution_helper.py
index 948772eec..f307d730b 100644
--- a/letta/helpers/tool_execution_helper.py
+++ b/letta/helpers/tool_execution_helper.py
@@ -36,11 +36,10 @@ def enable_strict_mode(tool_schema: Dict[str, Any]) -> Dict[str, Any]:
# Set additionalProperties to False
parameters["additionalProperties"] = False
schema["parameters"] = parameters
-
return schema
-def add_pre_execution_message(tool_schema: Dict[str, Any]) -> Dict[str, Any]:
+def add_pre_execution_message(tool_schema: Dict[str, Any], description: Optional[str] = None) -> Dict[str, Any]:
"""Adds a `pre_execution_message` parameter to a tool schema to prompt a natural, human-like message before executing the tool.
Args:
@@ -58,14 +57,17 @@ def add_pre_execution_message(tool_schema: Dict[str, Any]) -> Dict[str, Any]:
properties = parameters.get("properties", {})
required = parameters.get("required", [])
- # Define the new `pre_execution_message` field with a refined description
- pre_execution_message_field = {
- "type": "string",
- "description": (
+ # Define the new `pre_execution_message` field
+ if not description:
+ # Default description
+ description = (
"A concise message to be uttered before executing this tool. "
"This should sound natural, as if a person is casually announcing their next action."
"You MUST also include punctuation at the end of this message."
- ),
+ )
+ pre_execution_message_field = {
+ "type": "string",
+ "description": description,
}
# Ensure the pre-execution message is the first field in properties
diff --git a/letta/llm_api/anthropic.py b/letta/llm_api/anthropic.py
index 4ba9b9c98..f7b2566d1 100644
--- a/letta/llm_api/anthropic.py
+++ b/letta/llm_api/anthropic.py
@@ -606,25 +606,6 @@ def _prepare_anthropic_request(
# TODO eventually enable parallel tool use
data["tools"] = anthropic_tools
- # tool_choice_type other than "auto" only plays nice if thinking goes inside the tool calls
- if put_inner_thoughts_in_kwargs:
- if len(anthropic_tools) == 1:
- data["tool_choice"] = {
- "type": "tool",
- "name": anthropic_tools[0]["name"],
- "disable_parallel_tool_use": True,
- }
- else:
- data["tool_choice"] = {
- "type": "any",
- "disable_parallel_tool_use": True,
- }
- else:
- data["tool_choice"] = {
- "type": "auto",
- "disable_parallel_tool_use": True,
- }
-
# Move 'system' to the top level
assert data["messages"][0]["role"] == "system", f"Expected 'system' role in messages[0]:\n{data['messages'][0]}"
data["system"] = data["messages"][0]["content"]
@@ -720,6 +701,7 @@ def anthropic_bedrock_chat_completions_request(
# Make the request
try:
# bedrock does not support certain args
+ print("Warning: Tool rules not supported with Anthropic Bedrock")
data["tool_choice"] = {"type": "any"}
log_event(name="llm_request_sent", attributes=data)
response = client.messages.create(**data)
diff --git a/letta/llm_api/aws_bedrock.py b/letta/llm_api/aws_bedrock.py
index a800dbf37..7aa8feee9 100644
--- a/letta/llm_api/aws_bedrock.py
+++ b/letta/llm_api/aws_bedrock.py
@@ -78,7 +78,7 @@ def bedrock_get_model_details(region_name: str, model_id: str) -> Dict[str, Any]
response = bedrock.get_foundation_model(modelIdentifier=model_id)
return response["modelDetails"]
except ClientError as e:
- logger.exception(f"Error getting model details: {str(e)}", e)
+ logger.exception(f"Error getting model details: {str(e)}")
raise e
diff --git a/letta/llm_api/azure_openai.py b/letta/llm_api/azure_openai.py
index a6004276d..5da959a02 100644
--- a/letta/llm_api/azure_openai.py
+++ b/letta/llm_api/azure_openai.py
@@ -3,14 +3,12 @@ from collections import defaultdict
import requests
from openai import AzureOpenAI
-from letta.llm_api.helpers import make_post_request
+
from letta.llm_api.openai import prepare_openai_payload
from letta.schemas.llm_config import LLMConfig
from letta.schemas.openai.chat_completion_response import ChatCompletionResponse
from letta.schemas.openai.chat_completions import ChatCompletionRequest
-from letta.schemas.openai.embedding_response import EmbeddingResponse
from letta.settings import ModelSettings
-from letta.tracing import log_event
def get_azure_chat_completions_endpoint(base_url: str, model: str, api_version: str):
diff --git a/letta/llm_api/llm_api_tools.py b/letta/llm_api/llm_api_tools.py
index c71f9926c..f661f9db4 100644
--- a/letta/llm_api/llm_api_tools.py
+++ b/letta/llm_api/llm_api_tools.py
@@ -373,14 +373,26 @@ def create(
# Force tool calling
tool_call = None
if force_tool_call is not None:
- tool_call = {"type": "function", "function": {"name": force_tool_call}}
+ # tool_call = {"type": "function", "function": {"name": force_tool_call}}
+ tool_choice = {"type": "tool", "name": force_tool_call}
+ tools = [{"type": "function", "function": f} for f in functions if f["name"] == force_tool_call]
assert functions is not None
+ # need to have this setting to be able to put inner thoughts in kwargs
+ llm_config.put_inner_thoughts_in_kwargs = True
+ else:
+ if llm_config.put_inner_thoughts_in_kwargs:
+ # tool_choice_type other than "auto" only plays nice if thinking goes inside the tool calls
+ tool_choice = {"type": "any", "disable_parallel_tool_use": True}
+ else:
+ tool_choice = {"type": "auto", "disable_parallel_tool_use": True}
+ tools = [{"type": "function", "function": f} for f in functions]
+
chat_completion_request = ChatCompletionRequest(
model=llm_config.model,
messages=[cast_message_to_subtype(m.to_openai_dict()) for m in messages],
- tools=([{"type": "function", "function": f} for f in functions] if functions else None),
- tool_choice=tool_call,
+ tools=tools,
+ tool_choice=tool_choice,
max_tokens=llm_config.max_tokens, # Note: max_tokens is required for Anthropic API
temperature=llm_config.temperature,
stream=stream,
diff --git a/letta/orm/sqlalchemy_base.py b/letta/orm/sqlalchemy_base.py
index 61b3c9d4d..b5dda2e17 100644
--- a/letta/orm/sqlalchemy_base.py
+++ b/letta/orm/sqlalchemy_base.py
@@ -386,6 +386,50 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
except (DBAPIError, IntegrityError) as e:
self._handle_dbapi_error(e)
+ @classmethod
+ @handle_db_timeout
+ def batch_create(cls, items: List["SqlalchemyBase"], db_session: "Session", actor: Optional["User"] = None) -> List["SqlalchemyBase"]:
+ """
+ Create multiple records in a single transaction for better performance.
+
+ Args:
+ items: List of model instances to create
+ db_session: SQLAlchemy session
+ actor: Optional user performing the action
+
+ Returns:
+ List of created model instances
+ """
+ logger.debug(f"Batch creating {len(items)} {cls.__name__} items with actor={actor}")
+
+ if not items:
+ return []
+
+ # Set created/updated by fields if actor is provided
+ if actor:
+ for item in items:
+ item._set_created_and_updated_by_fields(actor.id)
+
+ try:
+ with db_session as session:
+ session.add_all(items)
+ session.flush() # Flush to generate IDs but don't commit yet
+
+ # Collect IDs to fetch the complete objects after commit
+ item_ids = [item.id for item in items]
+
+ session.commit()
+
+ # Re-query the objects to get them with relationships loaded
+ query = select(cls).where(cls.id.in_(item_ids))
+ if hasattr(cls, "created_at"):
+ query = query.order_by(cls.created_at)
+
+ return list(session.execute(query).scalars())
+
+ except (DBAPIError, IntegrityError) as e:
+ cls._handle_dbapi_error(e)
+
@handle_db_timeout
def delete(self, db_session: "Session", actor: Optional["User"] = None) -> "SqlalchemyBase":
logger.debug(f"Soft deleting {self.__class__.__name__} with ID: {self.id} with actor={actor}")
diff --git a/letta/schemas/openai/chat_completion_request.py b/letta/schemas/openai/chat_completion_request.py
index 12486bca9..780221371 100644
--- a/letta/schemas/openai/chat_completion_request.py
+++ b/letta/schemas/openai/chat_completion_request.py
@@ -74,7 +74,25 @@ class ToolFunctionChoice(BaseModel):
function: FunctionCall
-ToolChoice = Union[Literal["none", "auto", "required"], ToolFunctionChoice]
+class AnthropicToolChoiceTool(BaseModel):
+ type: str = "tool"
+ name: str
+ disable_parallel_tool_use: Optional[bool] = False
+
+
+class AnthropicToolChoiceAny(BaseModel):
+ type: str = "any"
+ disable_parallel_tool_use: Optional[bool] = False
+
+
+class AnthropicToolChoiceAuto(BaseModel):
+ type: str = "auto"
+ disable_parallel_tool_use: Optional[bool] = False
+
+
+ToolChoice = Union[
+ Literal["none", "auto", "required", "any"], ToolFunctionChoice, AnthropicToolChoiceTool, AnthropicToolChoiceAny, AnthropicToolChoiceAuto
+]
## tools ##
@@ -82,6 +100,7 @@ class FunctionSchema(BaseModel):
name: str
description: Optional[str] = None
parameters: Optional[Dict[str, Any]] = None # JSON Schema for the parameters
+ strict: bool = False
class Tool(BaseModel):
diff --git a/letta/schemas/providers.py b/letta/schemas/providers.py
index 1889c1814..e35c74c5e 100644
--- a/letta/schemas/providers.py
+++ b/letta/schemas/providers.py
@@ -210,6 +210,257 @@ class OpenAIProvider(Provider):
else:
return LLM_MAX_TOKENS["DEFAULT"]
+
+class xAIProvider(OpenAIProvider):
+ """https://docs.x.ai/docs/api-reference"""
+
+ name: str = "xai"
+ api_key: str = Field(..., description="API key for the xAI/Grok API.")
+ base_url: str = Field("https://api.x.ai/v1", description="Base URL for the xAI/Grok API.")
+
+ def get_model_context_window_size(self, model_name: str) -> Optional[int]:
+ # xAI doesn't return context window in the model listing,
+ # so these are hardcoded from their website
+ if model_name == "grok-2-1212":
+ return 131072
+ else:
+ return None
+
+ def list_llm_models(self) -> List[LLMConfig]:
+ from letta.llm_api.openai import openai_get_model_list
+
+ response = openai_get_model_list(self.base_url, api_key=self.api_key)
+
+ if "data" in response:
+ data = response["data"]
+ else:
+ data = response
+
+ configs = []
+ for model in data:
+ assert "id" in model, f"xAI/Grok model missing 'id' field: {model}"
+ model_name = model["id"]
+
+ # In case xAI starts supporting it in the future:
+ if "context_length" in model:
+ context_window_size = model["context_length"]
+ else:
+ context_window_size = self.get_model_context_window_size(model_name)
+
+ if not context_window_size:
+ warnings.warn(f"Couldn't find context window size for model {model_name}")
+ continue
+
+ configs.append(
+ LLMConfig(
+ model=model_name,
+ model_endpoint_type="xai",
+ model_endpoint=self.base_url,
+ context_window=context_window_size,
+ handle=self.get_handle(model_name),
+ )
+ )
+
+ return configs
+
+ def list_embedding_models(self) -> List[EmbeddingConfig]:
+ # No embeddings supported
+ return []
+
+
+class DeepSeekProvider(OpenAIProvider):
+ """
+ DeepSeek ChatCompletions API is similar to OpenAI's reasoning API,
+ but with slight differences:
+ * For example, DeepSeek's API requires perfect interleaving of user/assistant
+ * It also does not support native function calling
+ """
+
+ name: str = "deepseek"
+ base_url: str = Field("https://api.deepseek.com/v1", description="Base URL for the DeepSeek API.")
+ api_key: str = Field(..., description="API key for the DeepSeek API.")
+
+ def get_model_context_window_size(self, model_name: str) -> Optional[int]:
+ # DeepSeek doesn't return context window in the model listing,
+ # so these are hardcoded from their website
+ if model_name == "deepseek-reasoner":
+ return 64000
+ elif model_name == "deepseek-chat":
+ return 64000
+ else:
+ return None
+
+ def list_llm_models(self) -> List[LLMConfig]:
+ from letta.llm_api.openai import openai_get_model_list
+
+ response = openai_get_model_list(self.base_url, api_key=self.api_key)
+
+ if "data" in response:
+ data = response["data"]
+ else:
+ data = response
+
+ configs = []
+ for model in data:
+ assert "id" in model, f"DeepSeek model missing 'id' field: {model}"
+ model_name = model["id"]
+
+ # In case DeepSeek starts supporting it in the future:
+ if "context_length" in model:
+ # Context length is returned in OpenRouter as "context_length"
+ context_window_size = model["context_length"]
+ else:
+ context_window_size = self.get_model_context_window_size(model_name)
+
+ if not context_window_size:
+ warnings.warn(f"Couldn't find context window size for model {model_name}")
+ continue
+
+ # Not used for deepseek-reasoner, but otherwise is true
+ put_inner_thoughts_in_kwargs = False if model_name == "deepseek-reasoner" else True
+
+ configs.append(
+ LLMConfig(
+ model=model_name,
+ model_endpoint_type="deepseek",
+ model_endpoint=self.base_url,
+ context_window=context_window_size,
+ handle=self.get_handle(model_name),
+ put_inner_thoughts_in_kwargs=put_inner_thoughts_in_kwargs,
+ )
+ )
+
+ return configs
+
+ def list_embedding_models(self) -> List[EmbeddingConfig]:
+ # No embeddings supported
+ return []
+
+
+class LMStudioOpenAIProvider(OpenAIProvider):
+ name: str = "lmstudio-openai"
+ base_url: str = Field(..., description="Base URL for the LMStudio OpenAI API.")
+ api_key: Optional[str] = Field(None, description="API key for the LMStudio API.")
+
+ def list_llm_models(self) -> List[LLMConfig]:
+ from letta.llm_api.openai import openai_get_model_list
+
+ # For LMStudio, we want to hit 'GET /api/v0/models' instead of 'GET /v1/models'
+ MODEL_ENDPOINT_URL = f"{self.base_url.strip('/v1')}/api/v0"
+ response = openai_get_model_list(MODEL_ENDPOINT_URL)
+
+ """
+ Example response:
+
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "qwen2-vl-7b-instruct",
+ "object": "model",
+ "type": "vlm",
+ "publisher": "mlx-community",
+ "arch": "qwen2_vl",
+ "compatibility_type": "mlx",
+ "quantization": "4bit",
+ "state": "not-loaded",
+ "max_context_length": 32768
+ },
+ ...
+ """
+ if "data" not in response:
+ warnings.warn(f"LMStudio OpenAI model query response missing 'data' field: {response}")
+ return []
+
+ configs = []
+ for model in response["data"]:
+ assert "id" in model, f"Model missing 'id' field: {model}"
+ model_name = model["id"]
+
+ if "type" not in model:
+ warnings.warn(f"LMStudio OpenAI model missing 'type' field: {model}")
+ continue
+ elif model["type"] not in ["vlm", "llm"]:
+ continue
+
+ if "max_context_length" in model:
+ context_window_size = model["max_context_length"]
+ else:
+ warnings.warn(f"LMStudio OpenAI model missing 'max_context_length' field: {model}")
+ continue
+
+ configs.append(
+ LLMConfig(
+ model=model_name,
+ model_endpoint_type="openai",
+ model_endpoint=self.base_url,
+ context_window=context_window_size,
+ handle=self.get_handle(model_name),
+ )
+ )
+
+ return configs
+
+ def list_embedding_models(self) -> List[EmbeddingConfig]:
+ from letta.llm_api.openai import openai_get_model_list
+
+ # For LMStudio, we want to hit 'GET /api/v0/models' instead of 'GET /v1/models'
+ MODEL_ENDPOINT_URL = f"{self.base_url.strip('/v1')}/api/v0"
+ response = openai_get_model_list(MODEL_ENDPOINT_URL)
+
+ """
+ Example response:
+ {
+ "object": "list",
+ "data": [
+ {
+ "id": "text-embedding-nomic-embed-text-v1.5",
+ "object": "model",
+ "type": "embeddings",
+ "publisher": "nomic-ai",
+ "arch": "nomic-bert",
+ "compatibility_type": "gguf",
+ "quantization": "Q4_0",
+ "state": "not-loaded",
+ "max_context_length": 2048
+ }
+ ...
+ """
+ if "data" not in response:
+ warnings.warn(f"LMStudio OpenAI model query response missing 'data' field: {response}")
+ return []
+
+ configs = []
+ for model in response["data"]:
+ assert "id" in model, f"Model missing 'id' field: {model}"
+ model_name = model["id"]
+
+ if "type" not in model:
+ warnings.warn(f"LMStudio OpenAI model missing 'type' field: {model}")
+ continue
+ elif model["type"] not in ["embeddings"]:
+ continue
+
+ if "max_context_length" in model:
+ context_window_size = model["max_context_length"]
+ else:
+ warnings.warn(f"LMStudio OpenAI model missing 'max_context_length' field: {model}")
+ continue
+
+ configs.append(
+ EmbeddingConfig(
+ embedding_model=model_name,
+ embedding_endpoint_type="openai",
+ embedding_endpoint=self.base_url,
+ embedding_dim=context_window_size,
+ embedding_chunk_size=300, # NOTE: max is 2048
+ handle=self.get_handle(model_name),
+ ),
+ )
+
+ return configs
+
+
class xAIProvider(OpenAIProvider):
"""https://docs.x.ai/docs/api-reference"""
diff --git a/letta/schemas/tool.py b/letta/schemas/tool.py
index b23d9ac2e..4f17540ac 100644
--- a/letta/schemas/tool.py
+++ b/letta/schemas/tool.py
@@ -171,7 +171,7 @@ class ToolCreate(LettaBase):
from composio import LogLevel
from composio_langchain import ComposioToolSet
- composio_toolset = ComposioToolSet(logging_level=LogLevel.ERROR)
+ composio_toolset = ComposioToolSet(logging_level=LogLevel.ERROR, lock=False)
composio_action_schemas = composio_toolset.get_action_schemas(actions=[action_name], check_connected_accounts=False)
assert len(composio_action_schemas) > 0, "User supplied parameters do not match any Composio tools"
@@ -250,3 +250,6 @@ class ToolRunFromSource(LettaBase):
name: Optional[str] = Field(None, description="The name of the tool to run.")
source_type: Optional[str] = Field(None, description="The type of the source code.")
args_json_schema: Optional[Dict] = Field(None, description="The args JSON schema of the function.")
+ json_schema: Optional[Dict] = Field(
+ None, description="The JSON schema of the function (auto-generated from source_code if not provided)"
+ )
diff --git a/letta/server/rest_api/routers/v1/tools.py b/letta/server/rest_api/routers/v1/tools.py
index b302a569b..b1d953863 100644
--- a/letta/server/rest_api/routers/v1/tools.py
+++ b/letta/server/rest_api/routers/v1/tools.py
@@ -12,6 +12,7 @@ from composio.exceptions import (
from fastapi import APIRouter, Body, Depends, Header, HTTPException
from letta.errors import LettaToolCreateError
+from letta.functions.mcp_client.exceptions import MCPTimeoutError
from letta.functions.mcp_client.types import MCPTool, SSEServerConfig, StdioServerConfig
from letta.helpers.composio_helpers import get_composio_api_key
from letta.log import get_logger
@@ -192,6 +193,7 @@ def run_tool_from_source(
tool_env_vars=request.env_vars,
tool_name=request.name,
tool_args_json_schema=request.args_json_schema,
+ tool_json_schema=request.json_schema,
actor=actor,
)
except LettaToolCreateError as e:
@@ -366,6 +368,15 @@ def list_mcp_tools_by_server(
"mcp_server_name": mcp_server_name,
},
)
+ except MCPTimeoutError as e:
+ raise HTTPException(
+ status_code=408, # Timeout
+ detail={
+ "code": "MCPTimeoutError",
+ "message": str(e),
+ "mcp_server_name": mcp_server_name,
+ },
+ )
@router.post("/mcp/servers/{mcp_server_name}/{mcp_tool_name}", response_model=Tool, operation_id="add_mcp_tool")
@@ -380,8 +391,29 @@ def add_mcp_tool(
"""
actor = server.user_manager.get_user_or_default(user_id=actor_id)
- available_tools = server.get_tools_from_mcp_server(mcp_server_name=mcp_server_name)
- # See if the tool is in the avaialable list
+ try:
+ available_tools = server.get_tools_from_mcp_server(mcp_server_name=mcp_server_name)
+ except ValueError as e:
+ # ValueError means that the MCP server name doesn't exist
+ raise HTTPException(
+ status_code=400, # Bad Request
+ detail={
+ "code": "MCPServerNotFoundError",
+ "message": str(e),
+ "mcp_server_name": mcp_server_name,
+ },
+ )
+ except MCPTimeoutError as e:
+ raise HTTPException(
+ status_code=408, # Timeout
+ detail={
+ "code": "MCPTimeoutError",
+ "message": str(e),
+ "mcp_server_name": mcp_server_name,
+ },
+ )
+
+ # See if the tool is in the available list
mcp_tool = None
for tool in available_tools:
if tool.name == mcp_tool_name:
diff --git a/letta/server/rest_api/routers/v1/voice.py b/letta/server/rest_api/routers/v1/voice.py
index 7e3871b87..5e32b60f5 100644
--- a/letta/server/rest_api/routers/v1/voice.py
+++ b/letta/server/rest_api/routers/v1/voice.py
@@ -6,7 +6,7 @@ from fastapi import APIRouter, Body, Depends, Header
from fastapi.responses import StreamingResponse
from openai.types.chat.completion_create_params import CompletionCreateParams
-from letta.agents.low_latency_agent import LowLatencyAgent
+from letta.agents.voice_agent import VoiceAgent
from letta.log import get_logger
from letta.schemas.openai.chat_completions import UserMessage
from letta.server.rest_api.utils import get_letta_server, get_messages_from_completion_request
@@ -16,7 +16,7 @@ if TYPE_CHECKING:
from letta.server.server import SyncServer
-router = APIRouter(prefix="/voice", tags=["voice"])
+router = APIRouter(prefix="/voice-beta", tags=["voice"])
logger = get_logger(__name__)
@@ -61,15 +61,15 @@ async def create_voice_chat_completions(
)
# Instantiate our LowLatencyAgent
- agent = LowLatencyAgent(
+ agent = VoiceAgent(
agent_id=agent_id,
openai_client=client,
message_manager=server.message_manager,
agent_manager=server.agent_manager,
block_manager=server.block_manager,
actor=actor,
- message_buffer_limit=10,
- message_buffer_min=4,
+ message_buffer_limit=50,
+ message_buffer_min=10,
)
# Return the streaming generator
diff --git a/letta/server/server.py b/letta/server/server.py
index fd417f19c..ddde20ccc 100644
--- a/letta/server/server.py
+++ b/letta/server/server.py
@@ -1202,6 +1202,7 @@ class SyncServer(Server):
tool_source_type: Optional[str] = None,
tool_name: Optional[str] = None,
tool_args_json_schema: Optional[Dict[str, Any]] = None,
+ tool_json_schema: Optional[Dict[str, Any]] = None,
) -> ToolReturnMessage:
"""Run a tool from source code"""
if tool_source_type is not None and tool_source_type != "python":
@@ -1213,6 +1214,11 @@ class SyncServer(Server):
source_code=tool_source,
args_json_schema=tool_args_json_schema,
)
+
+ # If tools_json_schema is explicitly passed in, override it on the created Tool object
+ if tool_json_schema:
+ tool.json_schema = tool_json_schema
+
assert tool.name is not None, "Failed to create tool object"
# TODO eventually allow using agent state in tools
diff --git a/letta/services/agent_manager.py b/letta/services/agent_manager.py
index 6bf4a5cfd..d9e3894aa 100644
--- a/letta/services/agent_manager.py
+++ b/letta/services/agent_manager.py
@@ -755,7 +755,7 @@ class AgentManager:
if updated_value != agent_state.memory.get_block(label).value:
# update the block if it's changed
block_id = agent_state.memory.get_block(label).id
- block = self.block_manager.update_block(block_id=block_id, block_update=BlockUpdate(value=updated_value), actor=actor)
+ self.block_manager.update_block(block_id=block_id, block_update=BlockUpdate(value=updated_value), actor=actor)
# refresh memory from DB (using block ids)
agent_state.memory = Memory(
diff --git a/letta/services/message_manager.py b/letta/services/message_manager.py
index 387168dc4..a22c3ec28 100644
--- a/letta/services/message_manager.py
+++ b/letta/services/message_manager.py
@@ -63,8 +63,71 @@ class MessageManager:
@enforce_types
def create_many_messages(self, pydantic_msgs: List[PydanticMessage], actor: PydanticUser) -> List[PydanticMessage]:
- """Create multiple messages."""
- return [self.create_message(m, actor=actor) for m in pydantic_msgs]
+ """
+ Create multiple messages in a single database transaction.
+
+ Args:
+ pydantic_msgs: List of Pydantic message models to create
+ actor: User performing the action
+
+ Returns:
+ List of created Pydantic message models
+ """
+ if not pydantic_msgs:
+ return []
+
+ # Create ORM model instances for all messages
+ orm_messages = []
+ for pydantic_msg in pydantic_msgs:
+ # Set the organization id of the Pydantic message
+ pydantic_msg.organization_id = actor.organization_id
+ msg_data = pydantic_msg.model_dump(to_orm=True)
+ orm_messages.append(MessageModel(**msg_data))
+
+ # Use the batch_create method for efficient creation
+ with self.session_maker() as session:
+ created_messages = MessageModel.batch_create(orm_messages, session, actor=actor)
+
+ # Convert back to Pydantic models
+ return [msg.to_pydantic() for msg in created_messages]
+
+ @enforce_types
+ def update_message_by_letta_message(
+ self, message_id: str, letta_message_update: LettaMessageUpdateUnion, actor: PydanticUser
+ ) -> PydanticMessage:
+ """
+ Updated the underlying messages table giving an update specified to the user-facing LettaMessage
+ """
+ message = self.get_message_by_id(message_id=message_id, actor=actor)
+ if letta_message_update.message_type == "assistant_message":
+ # modify the tool call for send_message
+ # TODO: fix this if we add parallel tool calls
+ # TODO: note this only works if the AssistantMessage is generated by the standard send_message
+ assert (
+ message.tool_calls[0].function.name == "send_message"
+ ), f"Expected the first tool call to be send_message, but got {message.tool_calls[0].function.name}"
+ original_args = json.loads(message.tool_calls[0].function.arguments)
+ original_args["message"] = letta_message_update.content # override the assistant message
+ update_tool_call = message.tool_calls[0].__deepcopy__()
+ update_tool_call.function.arguments = json.dumps(original_args)
+
+ update_message = MessageUpdate(tool_calls=[update_tool_call])
+ elif letta_message_update.message_type == "reasoning_message":
+ update_message = MessageUpdate(content=letta_message_update.reasoning)
+ elif letta_message_update.message_type == "user_message" or letta_message_update.message_type == "system_message":
+ update_message = MessageUpdate(content=letta_message_update.content)
+ else:
+ raise ValueError(f"Unsupported message type for modification: {letta_message_update.message_type}")
+
+ message = self.update_message_by_id(message_id=message_id, message_update=update_message, actor=actor)
+
+ # convert back to LettaMessage
+ for letta_msg in message.to_letta_message(use_assistant_message=True):
+ if letta_msg.message_type == letta_message_update.message_type:
+ return letta_msg
+
+ # raise error if message type got modified
+ raise ValueError(f"Message type got modified: {letta_message_update.message_type}")
@enforce_types
def update_message_by_letta_message(
diff --git a/letta/settings.py b/letta/settings.py
index f6ade17ec..bd0b11f9a 100644
--- a/letta/settings.py
+++ b/letta/settings.py
@@ -19,8 +19,8 @@ class ToolSettings(BaseSettings):
local_sandbox_dir: Optional[str] = None
# MCP settings
- mcp_connect_to_server_timeout: float = 15.0
- mcp_list_tools_timeout: float = 10.0
+ mcp_connect_to_server_timeout: float = 30.0
+ mcp_list_tools_timeout: float = 30.0
mcp_execute_tool_timeout: float = 60.0
mcp_read_from_config: bool = True # if False, will throw if attempting to read/write from file
@@ -179,7 +179,7 @@ class Settings(BaseSettings):
# telemetry logging
verbose_telemetry_logging: bool = False
- otel_exporter_otlp_endpoint: str = "http://localhost:4317"
+ otel_exporter_otlp_endpoint: Optional[str] = None # otel default: "http://localhost:4317"
disable_tracing: bool = False
# uvicorn settings
diff --git a/poetry.lock b/poetry.lock
index 17d82df65..6bf92fce2 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1,4 +1,4 @@
-# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand.
+# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
[[package]]
name = "aiohappyeyeballs"
@@ -447,17 +447,17 @@ files = [
[[package]]
name = "boto3"
-version = "1.37.14"
+version = "1.37.15"
description = "The AWS SDK for Python"
optional = true
python-versions = ">=3.8"
files = [
- {file = "boto3-1.37.14-py3-none-any.whl", hash = "sha256:56b4d1e084dbca43d5fdd070f633a84de61a6ce592655b4d239d263d1a0097fc"},
- {file = "boto3-1.37.14.tar.gz", hash = "sha256:cf2e5e6d56efd5850db8ce3d9094132e4759cf2d4b5fd8200d69456bf61a20f3"},
+ {file = "boto3-1.37.15-py3-none-any.whl", hash = "sha256:78cc1b483cc637e1df8e81498d66f89550d4ee92175ccab5be1a2226672fe6b9"},
+ {file = "boto3-1.37.15.tar.gz", hash = "sha256:586332456fff19328d57a88214a2ac2eda1bafab743556a836eda46a4ce613c6"},
]
[package.dependencies]
-botocore = ">=1.37.14,<1.38.0"
+botocore = ">=1.37.15,<1.38.0"
jmespath = ">=0.7.1,<2.0.0"
s3transfer = ">=0.11.0,<0.12.0"
@@ -466,13 +466,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"]
[[package]]
name = "botocore"
-version = "1.37.14"
+version = "1.37.15"
description = "Low-level, data-driven core of boto 3."
optional = true
python-versions = ">=3.8"
files = [
- {file = "botocore-1.37.14-py3-none-any.whl", hash = "sha256:709a1796f436f8e378e52170e58501c1f3b5f2d1308238cf1d6a3bdba2e32851"},
- {file = "botocore-1.37.14.tar.gz", hash = "sha256:b0adce3f0fb42b914eb05079f50cf368cb9cf9745fdd206bd91fe6ac67b29aca"},
+ {file = "botocore-1.37.15-py3-none-any.whl", hash = "sha256:996b8d6a342ad7735eb07d8b4a81dad86e60ce0889ccb3edec0cd66eece85393"},
+ {file = "botocore-1.37.15.tar.gz", hash = "sha256:72e6f1db6ebc4112d6ba719c97ad71ac7cf4a2f3729ae74fa225641e3ddcba92"},
]
[package.dependencies]
@@ -500,10 +500,6 @@ files = [
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a37b8f0391212d29b3a91a799c8e4a2855e0576911cdfb2515487e30e322253d"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:e84799f09591700a4154154cab9787452925578841a94321d5ee8fb9a9a328f0"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f66b5337fa213f1da0d9000bc8dc0cb5b896b726eefd9c6046f699b169c41b9e"},
- {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5dab0844f2cf82be357a0eb11a9087f70c5430b2c241493fc122bb6f2bb0917c"},
- {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e4fe605b917c70283db7dfe5ada75e04561479075761a0b3866c081d035b01c1"},
- {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:1e9a65b5736232e7a7f91ff3d02277f11d339bf34099a56cdab6a8b3410a02b2"},
- {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:58d4b711689366d4a03ac7957ab8c28890415e267f9b6589969e74b6e42225ec"},
{file = "Brotli-1.1.0-cp310-cp310-win32.whl", hash = "sha256:be36e3d172dc816333f33520154d708a2657ea63762ec16b62ece02ab5e4daf2"},
{file = "Brotli-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:0c6244521dda65ea562d5a69b9a26120769b7a9fb3db2fe9545935ed6735b128"},
{file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a3daabb76a78f829cafc365531c972016e4aa8d5b4bf60660ad8ecee19df7ccc"},
@@ -516,14 +512,8 @@ files = [
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:19c116e796420b0cee3da1ccec3b764ed2952ccfcc298b55a10e5610ad7885f9"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:510b5b1bfbe20e1a7b3baf5fed9e9451873559a976c1a78eebaa3b86c57b4265"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a1fd8a29719ccce974d523580987b7f8229aeace506952fa9ce1d53a033873c8"},
- {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c247dd99d39e0338a604f8c2b3bc7061d5c2e9e2ac7ba9cc1be5a69cb6cd832f"},
- {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1b2c248cd517c222d89e74669a4adfa5577e06ab68771a529060cf5a156e9757"},
- {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:2a24c50840d89ded6c9a8fdc7b6ed3692ed4e86f1c4a4a938e1e92def92933e0"},
- {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f31859074d57b4639318523d6ffdca586ace54271a73ad23ad021acd807eb14b"},
{file = "Brotli-1.1.0-cp311-cp311-win32.whl", hash = "sha256:39da8adedf6942d76dc3e46653e52df937a3c4d6d18fdc94a7c29d263b1f5b50"},
{file = "Brotli-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:aac0411d20e345dc0920bdec5548e438e999ff68d77564d5e9463a7ca9d3e7b1"},
- {file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:32d95b80260d79926f5fab3c41701dbb818fde1c9da590e77e571eefd14abe28"},
- {file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b760c65308ff1e462f65d69c12e4ae085cff3b332d894637f6273a12a482d09f"},
{file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:316cc9b17edf613ac76b1f1f305d2a748f1b976b033b049a6ecdfd5612c70409"},
{file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:caf9ee9a5775f3111642d33b86237b05808dafcd6268faa492250e9b78046eb2"},
{file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70051525001750221daa10907c77830bc889cb6d865cc0b813d9db7fefc21451"},
@@ -534,24 +524,8 @@ files = [
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4093c631e96fdd49e0377a9c167bfd75b6d0bad2ace734c6eb20b348bc3ea180"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:7e4c4629ddad63006efa0ef968c8e4751c5868ff0b1c5c40f76524e894c50248"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:861bf317735688269936f755fa136a99d1ed526883859f86e41a5d43c61d8966"},
- {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:87a3044c3a35055527ac75e419dfa9f4f3667a1e887ee80360589eb8c90aabb9"},
- {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c5529b34c1c9d937168297f2c1fde7ebe9ebdd5e121297ff9c043bdb2ae3d6fb"},
- {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ca63e1890ede90b2e4454f9a65135a4d387a4585ff8282bb72964fab893f2111"},
- {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e79e6520141d792237c70bcd7a3b122d00f2613769ae0cb61c52e89fd3443839"},
{file = "Brotli-1.1.0-cp312-cp312-win32.whl", hash = "sha256:5f4d5ea15c9382135076d2fb28dde923352fe02951e66935a9efaac8f10e81b0"},
{file = "Brotli-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:906bc3a79de8c4ae5b86d3d75a8b77e44404b0f4261714306e3ad248d8ab0951"},
- {file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8bf32b98b75c13ec7cf774164172683d6e7891088f6316e54425fde1efc276d5"},
- {file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7bc37c4d6b87fb1017ea28c9508b36bbcb0c3d18b4260fcdf08b200c74a6aee8"},
- {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c0ef38c7a7014ffac184db9e04debe495d317cc9c6fb10071f7fefd93100a4f"},
- {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91d7cc2a76b5567591d12c01f019dd7afce6ba8cba6571187e21e2fc418ae648"},
- {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a93dde851926f4f2678e704fadeb39e16c35d8baebd5252c9fd94ce8ce68c4a0"},
- {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f0db75f47be8b8abc8d9e31bc7aad0547ca26f24a54e6fd10231d623f183d089"},
- {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6967ced6730aed543b8673008b5a391c3b1076d834ca438bbd70635c73775368"},
- {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7eedaa5d036d9336c95915035fb57422054014ebdeb6f3b42eac809928e40d0c"},
- {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d487f5432bf35b60ed625d7e1b448e2dc855422e87469e3f450aa5552b0eb284"},
- {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:832436e59afb93e1836081a20f324cb185836c617659b07b129141a8426973c7"},
- {file = "Brotli-1.1.0-cp313-cp313-win32.whl", hash = "sha256:43395e90523f9c23a3d5bdf004733246fba087f2948f87ab28015f12359ca6a0"},
- {file = "Brotli-1.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:9011560a466d2eb3f5a6e4929cf4a09be405c64154e12df0dd72713f6500e32b"},
{file = "Brotli-1.1.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a090ca607cbb6a34b0391776f0cb48062081f5f60ddcce5d11838e67a01928d1"},
{file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2de9d02f5bda03d27ede52e8cfe7b865b066fa49258cbab568720aa5be80a47d"},
{file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2333e30a5e00fe0fe55903c8832e08ee9c3b1382aacf4db26664a16528d51b4b"},
@@ -561,10 +535,6 @@ files = [
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:fd5f17ff8f14003595ab414e45fce13d073e0762394f957182e69035c9f3d7c2"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:069a121ac97412d1fe506da790b3e69f52254b9df4eb665cd42460c837193354"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e93dfc1a1165e385cc8239fab7c036fb2cd8093728cbd85097b284d7b99249a2"},
- {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_aarch64.whl", hash = "sha256:aea440a510e14e818e67bfc4027880e2fb500c2ccb20ab21c7a7c8b5b4703d75"},
- {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_i686.whl", hash = "sha256:6974f52a02321b36847cd19d1b8e381bf39939c21efd6ee2fc13a28b0d99348c"},
- {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_ppc64le.whl", hash = "sha256:a7e53012d2853a07a4a79c00643832161a910674a893d296c9f1259859a289d2"},
- {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:d7702622a8b40c49bffb46e1e3ba2e81268d5c04a34f460978c6b5517a34dd52"},
{file = "Brotli-1.1.0-cp36-cp36m-win32.whl", hash = "sha256:a599669fd7c47233438a56936988a2478685e74854088ef5293802123b5b2460"},
{file = "Brotli-1.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d143fd47fad1db3d7c27a1b1d66162e855b5d50a89666af46e1679c496e8e579"},
{file = "Brotli-1.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:11d00ed0a83fa22d29bc6b64ef636c4552ebafcef57154b4ddd132f5638fbd1c"},
@@ -576,10 +546,6 @@ files = [
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:919e32f147ae93a09fe064d77d5ebf4e35502a8df75c29fb05788528e330fe74"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:23032ae55523cc7bccb4f6a0bf368cd25ad9bcdcc1990b64a647e7bbcce9cb5b"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:224e57f6eac61cc449f498cc5f0e1725ba2071a3d4f48d5d9dffba42db196438"},
- {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:cb1dac1770878ade83f2ccdf7d25e494f05c9165f5246b46a621cc849341dc01"},
- {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:3ee8a80d67a4334482d9712b8e83ca6b1d9bc7e351931252ebef5d8f7335a547"},
- {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:5e55da2c8724191e5b557f8e18943b1b4839b8efc3ef60d65985bcf6f587dd38"},
- {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:d342778ef319e1026af243ed0a07c97acf3bad33b9f29e7ae6a1f68fd083e90c"},
{file = "Brotli-1.1.0-cp37-cp37m-win32.whl", hash = "sha256:587ca6d3cef6e4e868102672d3bd9dc9698c309ba56d41c2b9c85bbb903cdb95"},
{file = "Brotli-1.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2954c1c23f81c2eaf0b0717d9380bd348578a94161a65b3a2afc62c86467dd68"},
{file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:efa8b278894b14d6da122a72fefcebc28445f2d3f880ac59d46c90f4c13be9a3"},
@@ -592,10 +558,6 @@ files = [
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ab4fbee0b2d9098c74f3057b2bc055a8bd92ccf02f65944a241b4349229185a"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:141bd4d93984070e097521ed07e2575b46f817d08f9fa42b16b9b5f27b5ac088"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fce1473f3ccc4187f75b4690cfc922628aed4d3dd013d047f95a9b3919a86596"},
- {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d2b35ca2c7f81d173d2fadc2f4f31e88cc5f7a39ae5b6db5513cf3383b0e0ec7"},
- {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:af6fa6817889314555aede9a919612b23739395ce767fe7fcbea9a80bf140fe5"},
- {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:2feb1d960f760a575dbc5ab3b1c00504b24caaf6986e2dc2b01c09c87866a943"},
- {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:4410f84b33374409552ac9b6903507cdb31cd30d2501fc5ca13d18f73548444a"},
{file = "Brotli-1.1.0-cp38-cp38-win32.whl", hash = "sha256:db85ecf4e609a48f4b29055f1e144231b90edc90af7481aa731ba2d059226b1b"},
{file = "Brotli-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3d7954194c36e304e1523f55d7042c59dc53ec20dd4e9ea9d151f1b62b4415c0"},
{file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5fb2ce4b8045c78ebbc7b8f3c15062e435d47e7393cc57c25115cfd49883747a"},
@@ -608,10 +570,6 @@ files = [
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:949f3b7c29912693cee0afcf09acd6ebc04c57af949d9bf77d6101ebb61e388c"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:89f4988c7203739d48c6f806f1e87a1d96e0806d44f0fba61dba81392c9e474d"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:de6551e370ef19f8de1807d0a9aa2cdfdce2e85ce88b122fe9f6b2b076837e59"},
- {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0737ddb3068957cf1b054899b0883830bb1fec522ec76b1098f9b6e0f02d9419"},
- {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:4f3607b129417e111e30637af1b56f24f7a49e64763253bbc275c75fa887d4b2"},
- {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:6c6e0c425f22c1c719c42670d561ad682f7bfeeef918edea971a79ac5252437f"},
- {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:494994f807ba0b92092a163a0a283961369a65f6cbe01e8891132b7a320e61eb"},
{file = "Brotli-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f0d8a7a6b5983c2496e364b969f0e526647a06b075d034f3297dc66f3b360c64"},
{file = "Brotli-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:cdad5b9014d83ca68c25d2e9444e28e967ef16e80f6b436918c700c117a85467"},
{file = "Brotli-1.1.0.tar.gz", hash = "sha256:81de08ac11bcb85841e440c13611c00b67d3bf82698314928d0b676362546724"},
@@ -874,13 +832,13 @@ test = ["pytest"]
[[package]]
name = "composio-core"
-version = "0.7.9"
+version = "0.7.10"
description = "Core package to act as a bridge between composio platform and other services."
optional = false
python-versions = "<4,>=3.9"
files = [
- {file = "composio_core-0.7.9-py3-none-any.whl", hash = "sha256:0712330111eb05b58bf97131ea04597882326326928d055c88cb34c6c0a15241"},
- {file = "composio_core-0.7.9.tar.gz", hash = "sha256:70afebfbcf0c89cbfa4c1f0ec24413753298004c5202e4860c83aa6a5688f537"},
+ {file = "composio_core-0.7.10-py3-none-any.whl", hash = "sha256:a2cdf69a7231797eeaa4605493c4b8949a08fe24a7e4cee749a04a8413a552a5"},
+ {file = "composio_core-0.7.10.tar.gz", hash = "sha256:ca1db196a7b240a5c8738f938a2db00c3e14b4d229a7da3591f3ade20b7e6b21"},
]
[package.dependencies]
@@ -903,21 +861,21 @@ sentry-sdk = ">=2.0.0"
uvicorn = "*"
[package.extras]
-all = ["aiohttp", "click", "diskcache", "docker (>=7.1.0)", "e2b (>=0.17.2a37,<1)", "e2b-code-interpreter", "fastapi", "flake8", "gql", "importlib-metadata (>=4.8.1)", "inflection (>=0.5.1)", "jsonref (>=1.1.0)", "jsonschema (>=4.21.1,<5)", "networkx", "paramiko (>=3.4.1)", "pathspec", "pydantic (>=2.6.4)", "pygments", "pyperclip (>=1.8.2,<2)", "pysher (==1.0.8)", "pyyaml (>=6.0.2)", "requests (>=2.31.0,<3)", "requests_toolbelt", "rich (>=13.7.1,<14)", "ruff", "semver (>=2.13.0)", "sentry-sdk (>=2.0.0)", "transformers", "uvicorn"]
+all = ["aiohttp", "click", "diskcache", "docker (>=7.1.0)", "e2b (>=0.17.2a37,<1.1.0)", "e2b-code-interpreter", "fastapi", "flake8", "gql", "importlib-metadata (>=4.8.1)", "inflection (>=0.5.1)", "jsonref (>=1.1.0)", "jsonschema (>=4.21.1,<5)", "networkx", "paramiko (>=3.4.1)", "pathspec", "pydantic (>=2.6.4)", "pygments", "pyperclip (>=1.8.2,<2)", "pysher (==1.0.8)", "pyyaml (>=6.0.2)", "requests (>=2.31.0,<3)", "requests_toolbelt", "rich (>=13.7.1,<14)", "ruff", "semver (>=2.13.0)", "sentry-sdk (>=2.0.0)", "transformers", "uvicorn"]
docker = ["docker (>=7.1.0)"]
-e2b = ["e2b (>=0.17.2a37,<1)", "e2b-code-interpreter"]
+e2b = ["e2b (>=0.17.2a37,<1.1.0)", "e2b-code-interpreter"]
flyio = ["gql", "requests_toolbelt"]
tools = ["diskcache", "flake8", "networkx", "pathspec", "pygments", "ruff", "transformers"]
[[package]]
name = "composio-langchain"
-version = "0.7.9"
+version = "0.7.10"
description = "Use Composio to get an array of tools with your LangChain agent."
optional = false
python-versions = "<4,>=3.9"
files = [
- {file = "composio_langchain-0.7.9-py3-none-any.whl", hash = "sha256:6536fd728b716716bd2ec2c7c3a85b2366b1739fe4b0bddd620e5d21f85d37ca"},
- {file = "composio_langchain-0.7.9.tar.gz", hash = "sha256:9dbfa3f77f862a8daddf413d8c552219bbe963cfa0441f6b5153aaba3b75602e"},
+ {file = "composio_langchain-0.7.10-py3-none-any.whl", hash = "sha256:c111f43ed9af9695f036eb15c1489d620a0f936e371af175e2f754da6e9b4d86"},
+ {file = "composio_langchain-0.7.10.tar.gz", hash = "sha256:3f7cbd8e1a498307ca068b09a8b8cfbb055af6fce79f7f5945bac63c030a05a2"},
]
[package.dependencies]
@@ -1035,9 +993,9 @@ isort = ">=4.3.21,<6.0"
jinja2 = ">=2.10.1,<4.0"
packaging = "*"
pydantic = [
+ {version = ">=1.10.0,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.12\" and python_version < \"4.0\""},
{version = ">=1.10.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.11\" and python_version < \"3.12\""},
{version = ">=1.9.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.10\" and python_version < \"3.11\""},
- {version = ">=1.10.0,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.12\" and python_version < \"4.0\""},
]
pyyaml = ">=6.0.1"
toml = {version = ">=0.10.0,<1.0.0", markers = "python_version < \"3.11\""}
@@ -1239,13 +1197,13 @@ typing-extensions = ">=4.1.0"
[[package]]
name = "e2b-code-interpreter"
-version = "1.1.0"
+version = "1.1.1"
description = "E2B Code Interpreter - Stateful code execution"
optional = true
python-versions = "<4.0,>=3.9"
files = [
- {file = "e2b_code_interpreter-1.1.0-py3-none-any.whl", hash = "sha256:292f8ddbb820475d5ffb1f3f2e67a42001a921d1c8fef40bd97a7f16f13adc64"},
- {file = "e2b_code_interpreter-1.1.0.tar.gz", hash = "sha256:4554eb002f9489965c2e7dd7fc967e62128db69b18dbb64975d4abbc0572e3ed"},
+ {file = "e2b_code_interpreter-1.1.1-py3-none-any.whl", hash = "sha256:f56450b192456f24df89b9159d1067d50c7133d587ab12116144638969409578"},
+ {file = "e2b_code_interpreter-1.1.1.tar.gz", hash = "sha256:b13091f75fc127ad3a268b8746e5da996c6734f432e606fcd4f3897a5b1c2bf0"},
]
[package.dependencies]
@@ -1744,23 +1702,23 @@ requests = ["requests (>=2.20.0,<3.0.0.dev0)"]
[[package]]
name = "google-genai"
-version = "1.5.0"
+version = "1.7.0"
description = "GenAI Python SDK"
optional = true
python-versions = ">=3.9"
files = [
- {file = "google_genai-1.5.0-py3-none-any.whl", hash = "sha256:0ad433836a402957a967ccd57cbab7768325d28966a8556771974ae1c018be59"},
- {file = "google_genai-1.5.0.tar.gz", hash = "sha256:83fcfc4956ad32ecea1fda37d8f3f7cbadbdeebd2310f2a55bc7564a2f1d459f"},
+ {file = "google_genai-1.7.0-py3-none-any.whl", hash = "sha256:62b7b67d16b2fa0a6a989f029414a072c6e9e6f0479bb7d18e0532b8090ea895"},
+ {file = "google_genai-1.7.0.tar.gz", hash = "sha256:bf8909ba25527e125f07de99cd16ec8bba4d989b67c31c235114418a65404967"},
]
[package.dependencies]
-anyio = ">=4.8.0,<5.0.0dev"
-google-auth = ">=2.14.1,<3.0.0dev"
-httpx = ">=0.28.1,<1.0.0dev"
-pydantic = ">=2.0.0,<3.0.0dev"
-requests = ">=2.28.1,<3.0.0dev"
-typing-extensions = ">=4.11.0,<5.0.0dev"
-websockets = ">=13.0,<15.0dev"
+anyio = ">=4.8.0,<5.0.0"
+google-auth = ">=2.14.1,<3.0.0"
+httpx = ">=0.28.1,<1.0.0"
+pydantic = ">=2.0.0,<3.0.0"
+requests = ">=2.28.1,<3.0.0"
+typing-extensions = ">=4.11.0,<5.0.0"
+websockets = ">=13.0.0,<15.1.0"
[[package]]
name = "googleapis-common-protos"
@@ -2567,19 +2525,19 @@ test = ["ipykernel", "pre-commit", "pytest (<8)", "pytest-cov", "pytest-timeout"
[[package]]
name = "langchain"
-version = "0.3.20"
+version = "0.3.21"
description = "Building applications with LLMs through composability"
optional = false
python-versions = "<4.0,>=3.9"
files = [
- {file = "langchain-0.3.20-py3-none-any.whl", hash = "sha256:273287f8e61ffdf7e811cf8799e6a71e9381325b8625fd6618900faba79cfdd0"},
- {file = "langchain-0.3.20.tar.gz", hash = "sha256:edcc3241703e1f6557ef5a5c35cd56f9ccc25ff12e38b4829c66d94971737a93"},
+ {file = "langchain-0.3.21-py3-none-any.whl", hash = "sha256:c8bd2372440cc5d48cb50b2d532c2e24036124f1c467002ceb15bc7b86c92579"},
+ {file = "langchain-0.3.21.tar.gz", hash = "sha256:a10c81f8c450158af90bf37190298d996208cfd15dd3accc1c585f068473d619"},
]
[package.dependencies]
async-timeout = {version = ">=4.0.0,<5.0.0", markers = "python_version < \"3.11\""}
-langchain-core = ">=0.3.41,<1.0.0"
-langchain-text-splitters = ">=0.3.6,<1.0.0"
+langchain-core = ">=0.3.45,<1.0.0"
+langchain-text-splitters = ">=0.3.7,<1.0.0"
langsmith = ">=0.1.17,<0.4"
pydantic = ">=2.7.4,<3.0.0"
PyYAML = ">=5.3"
@@ -2589,6 +2547,7 @@ SQLAlchemy = ">=1.4,<3"
[package.extras]
anthropic = ["langchain-anthropic"]
aws = ["langchain-aws"]
+azure-ai = ["langchain-azure-ai"]
cohere = ["langchain-cohere"]
community = ["langchain-community"]
deepseek = ["langchain-deepseek"]
@@ -2669,17 +2628,17 @@ tiktoken = ">=0.7,<1"
[[package]]
name = "langchain-text-splitters"
-version = "0.3.6"
+version = "0.3.7"
description = "LangChain text splitting utilities"
optional = false
python-versions = "<4.0,>=3.9"
files = [
- {file = "langchain_text_splitters-0.3.6-py3-none-any.whl", hash = "sha256:e5d7b850f6c14259ea930be4a964a65fa95d9df7e1dbdd8bad8416db72292f4e"},
- {file = "langchain_text_splitters-0.3.6.tar.gz", hash = "sha256:c537972f4b7c07451df431353a538019ad9dadff7a1073ea363946cea97e1bee"},
+ {file = "langchain_text_splitters-0.3.7-py3-none-any.whl", hash = "sha256:31ba826013e3f563359d7c7f1e99b1cdb94897f665675ee505718c116e7e20ad"},
+ {file = "langchain_text_splitters-0.3.7.tar.gz", hash = "sha256:7dbf0fb98e10bb91792a1d33f540e2287f9cc1dc30ade45b7aedd2d5cd3dc70b"},
]
[package.dependencies]
-langchain-core = ">=0.3.34,<1.0.0"
+langchain-core = ">=0.3.45,<1.0.0"
[[package]]
name = "langchainhub"
@@ -2727,13 +2686,13 @@ pytest = ["pytest (>=7.0.0)", "rich (>=13.9.4,<14.0.0)"]
[[package]]
name = "letta-client"
-version = "0.1.75"
+version = "0.1.76"
description = ""
optional = false
python-versions = "<4.0,>=3.8"
files = [
- {file = "letta_client-0.1.75-py3-none-any.whl", hash = "sha256:9bb94357d19997a8c5116aacb5c5c803ab1ba74f45959a79c57a0c41a4a7e740"},
- {file = "letta_client-0.1.75.tar.gz", hash = "sha256:959f805ef4ab16a8fd719715dba8e336d69ed01b3990dd561da589eb4a650760"},
+ {file = "letta_client-0.1.76-py3-none-any.whl", hash = "sha256:1888fdbe17aa2f2f1b97763cd9f1eafef14e44e346dba071372ea260a891f801"},
+ {file = "letta_client-0.1.76.tar.gz", hash = "sha256:4e8307051220bb1b4ed324d29ded27e6a1b196709716ddf5e7f277600e5ead61"},
]
[package.dependencies]
@@ -3034,8 +2993,8 @@ psutil = ">=5.9.1"
pywin32 = {version = "*", markers = "sys_platform == \"win32\""}
pyzmq = ">=25.0.0"
requests = [
- {version = ">=2.26.0", markers = "python_version <= \"3.11\""},
{version = ">=2.32.2", markers = "python_version > \"3.11\""},
+ {version = ">=2.26.0", markers = "python_version <= \"3.11\""},
]
setuptools = ">=70.0.0"
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
@@ -3898,9 +3857,9 @@ files = [
[package.dependencies]
numpy = [
+ {version = ">=1.26.0", markers = "python_version >= \"3.12\""},
{version = ">=1.23.2", markers = "python_version == \"3.11\""},
{version = ">=1.22.4", markers = "python_version < \"3.11\""},
- {version = ">=1.26.0", markers = "python_version >= \"3.12\""},
]
python-dateutil = ">=2.8.2"
pytz = ">=2020.1"
@@ -5189,8 +5148,8 @@ grpcio = ">=1.41.0"
grpcio-tools = ">=1.41.0"
httpx = {version = ">=0.20.0", extras = ["http2"]}
numpy = [
- {version = ">=1.21", markers = "python_version >= \"3.10\" and python_version < \"3.12\""},
{version = ">=1.26", markers = "python_version == \"3.12\""},
+ {version = ">=1.21", markers = "python_version >= \"3.10\" and python_version < \"3.12\""},
]
portalocker = ">=2.7.0,<3.0.0"
pydantic = ">=1.10.8"
@@ -6231,80 +6190,80 @@ test = ["websockets"]
[[package]]
name = "websockets"
-version = "14.2"
+version = "15.0.1"
description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)"
optional = true
python-versions = ">=3.9"
files = [
- {file = "websockets-14.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e8179f95323b9ab1c11723e5d91a89403903f7b001828161b480a7810b334885"},
- {file = "websockets-14.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0d8c3e2cdb38f31d8bd7d9d28908005f6fa9def3324edb9bf336d7e4266fd397"},
- {file = "websockets-14.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:714a9b682deb4339d39ffa674f7b674230227d981a37d5d174a4a83e3978a610"},
- {file = "websockets-14.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2e53c72052f2596fb792a7acd9704cbc549bf70fcde8a99e899311455974ca3"},
- {file = "websockets-14.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e3fbd68850c837e57373d95c8fe352203a512b6e49eaae4c2f4088ef8cf21980"},
- {file = "websockets-14.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b27ece32f63150c268593d5fdb82819584831a83a3f5809b7521df0685cd5d8"},
- {file = "websockets-14.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:4daa0faea5424d8713142b33825fff03c736f781690d90652d2c8b053345b0e7"},
- {file = "websockets-14.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:bc63cee8596a6ec84d9753fd0fcfa0452ee12f317afe4beae6b157f0070c6c7f"},
- {file = "websockets-14.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7a570862c325af2111343cc9b0257b7119b904823c675b22d4ac547163088d0d"},
- {file = "websockets-14.2-cp310-cp310-win32.whl", hash = "sha256:75862126b3d2d505e895893e3deac0a9339ce750bd27b4ba515f008b5acf832d"},
- {file = "websockets-14.2-cp310-cp310-win_amd64.whl", hash = "sha256:cc45afb9c9b2dc0852d5c8b5321759cf825f82a31bfaf506b65bf4668c96f8b2"},
- {file = "websockets-14.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3bdc8c692c866ce5fefcaf07d2b55c91d6922ac397e031ef9b774e5b9ea42166"},
- {file = "websockets-14.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c93215fac5dadc63e51bcc6dceca72e72267c11def401d6668622b47675b097f"},
- {file = "websockets-14.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1c9b6535c0e2cf8a6bf938064fb754aaceb1e6a4a51a80d884cd5db569886910"},
- {file = "websockets-14.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a52a6d7cf6938e04e9dceb949d35fbdf58ac14deea26e685ab6368e73744e4c"},
- {file = "websockets-14.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9f05702e93203a6ff5226e21d9b40c037761b2cfb637187c9802c10f58e40473"},
- {file = "websockets-14.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22441c81a6748a53bfcb98951d58d1af0661ab47a536af08920d129b4d1c3473"},
- {file = "websockets-14.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:efd9b868d78b194790e6236d9cbc46d68aba4b75b22497eb4ab64fa640c3af56"},
- {file = "websockets-14.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1a5a20d5843886d34ff8c57424cc65a1deda4375729cbca4cb6b3353f3ce4142"},
- {file = "websockets-14.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:34277a29f5303d54ec6468fb525d99c99938607bc96b8d72d675dee2b9f5bf1d"},
- {file = "websockets-14.2-cp311-cp311-win32.whl", hash = "sha256:02687db35dbc7d25fd541a602b5f8e451a238ffa033030b172ff86a93cb5dc2a"},
- {file = "websockets-14.2-cp311-cp311-win_amd64.whl", hash = "sha256:862e9967b46c07d4dcd2532e9e8e3c2825e004ffbf91a5ef9dde519ee2effb0b"},
- {file = "websockets-14.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1f20522e624d7ffbdbe259c6b6a65d73c895045f76a93719aa10cd93b3de100c"},
- {file = "websockets-14.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:647b573f7d3ada919fd60e64d533409a79dcf1ea21daeb4542d1d996519ca967"},
- {file = "websockets-14.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6af99a38e49f66be5a64b1e890208ad026cda49355661549c507152113049990"},
- {file = "websockets-14.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:091ab63dfc8cea748cc22c1db2814eadb77ccbf82829bac6b2fbe3401d548eda"},
- {file = "websockets-14.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b374e8953ad477d17e4851cdc66d83fdc2db88d9e73abf755c94510ebddceb95"},
- {file = "websockets-14.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a39d7eceeea35db85b85e1169011bb4321c32e673920ae9c1b6e0978590012a3"},
- {file = "websockets-14.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:0a6f3efd47ffd0d12080594f434faf1cd2549b31e54870b8470b28cc1d3817d9"},
- {file = "websockets-14.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:065ce275e7c4ffb42cb738dd6b20726ac26ac9ad0a2a48e33ca632351a737267"},
- {file = "websockets-14.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e9d0e53530ba7b8b5e389c02282f9d2aa47581514bd6049d3a7cffe1385cf5fe"},
- {file = "websockets-14.2-cp312-cp312-win32.whl", hash = "sha256:20e6dd0984d7ca3037afcb4494e48c74ffb51e8013cac71cf607fffe11df7205"},
- {file = "websockets-14.2-cp312-cp312-win_amd64.whl", hash = "sha256:44bba1a956c2c9d268bdcdf234d5e5ff4c9b6dc3e300545cbe99af59dda9dcce"},
- {file = "websockets-14.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6f1372e511c7409a542291bce92d6c83320e02c9cf392223272287ce55bc224e"},
- {file = "websockets-14.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:4da98b72009836179bb596a92297b1a61bb5a830c0e483a7d0766d45070a08ad"},
- {file = "websockets-14.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f8a86a269759026d2bde227652b87be79f8a734e582debf64c9d302faa1e9f03"},
- {file = "websockets-14.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:86cf1aaeca909bf6815ea714d5c5736c8d6dd3a13770e885aafe062ecbd04f1f"},
- {file = "websockets-14.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9b0f6c3ba3b1240f602ebb3971d45b02cc12bd1845466dd783496b3b05783a5"},
- {file = "websockets-14.2-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:669c3e101c246aa85bc8534e495952e2ca208bd87994650b90a23d745902db9a"},
- {file = "websockets-14.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:eabdb28b972f3729348e632ab08f2a7b616c7e53d5414c12108c29972e655b20"},
- {file = "websockets-14.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2066dc4cbcc19f32c12a5a0e8cc1b7ac734e5b64ac0a325ff8353451c4b15ef2"},
- {file = "websockets-14.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ab95d357cd471df61873dadf66dd05dd4709cae001dd6342edafc8dc6382f307"},
- {file = "websockets-14.2-cp313-cp313-win32.whl", hash = "sha256:a9e72fb63e5f3feacdcf5b4ff53199ec8c18d66e325c34ee4c551ca748623bbc"},
- {file = "websockets-14.2-cp313-cp313-win_amd64.whl", hash = "sha256:b439ea828c4ba99bb3176dc8d9b933392a2413c0f6b149fdcba48393f573377f"},
- {file = "websockets-14.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7cd5706caec1686c5d233bc76243ff64b1c0dc445339bd538f30547e787c11fe"},
- {file = "websockets-14.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ec607328ce95a2f12b595f7ae4c5d71bf502212bddcea528290b35c286932b12"},
- {file = "websockets-14.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:da85651270c6bfb630136423037dd4975199e5d4114cae6d3066641adcc9d1c7"},
- {file = "websockets-14.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c3ecadc7ce90accf39903815697917643f5b7cfb73c96702318a096c00aa71f5"},
- {file = "websockets-14.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1979bee04af6a78608024bad6dfcc0cc930ce819f9e10342a29a05b5320355d0"},
- {file = "websockets-14.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2dddacad58e2614a24938a50b85969d56f88e620e3f897b7d80ac0d8a5800258"},
- {file = "websockets-14.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:89a71173caaf75fa71a09a5f614f450ba3ec84ad9fca47cb2422a860676716f0"},
- {file = "websockets-14.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:6af6a4b26eea4fc06c6818a6b962a952441e0e39548b44773502761ded8cc1d4"},
- {file = "websockets-14.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:80c8efa38957f20bba0117b48737993643204645e9ec45512579132508477cfc"},
- {file = "websockets-14.2-cp39-cp39-win32.whl", hash = "sha256:2e20c5f517e2163d76e2729104abc42639c41cf91f7b1839295be43302713661"},
- {file = "websockets-14.2-cp39-cp39-win_amd64.whl", hash = "sha256:b4c8cef610e8d7c70dea92e62b6814a8cd24fbd01d7103cc89308d2bfe1659ef"},
- {file = "websockets-14.2-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:d7d9cafbccba46e768be8a8ad4635fa3eae1ffac4c6e7cb4eb276ba41297ed29"},
- {file = "websockets-14.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:c76193c1c044bd1e9b3316dcc34b174bbf9664598791e6fb606d8d29000e070c"},
- {file = "websockets-14.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fd475a974d5352390baf865309fe37dec6831aafc3014ffac1eea99e84e83fc2"},
- {file = "websockets-14.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2c6c0097a41968b2e2b54ed3424739aab0b762ca92af2379f152c1aef0187e1c"},
- {file = "websockets-14.2-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d7ff794c8b36bc402f2e07c0b2ceb4a2424147ed4785ff03e2a7af03711d60a"},
- {file = "websockets-14.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:dec254fcabc7bd488dab64846f588fc5b6fe0d78f641180030f8ea27b76d72c3"},
- {file = "websockets-14.2-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:bbe03eb853e17fd5b15448328b4ec7fb2407d45fb0245036d06a3af251f8e48f"},
- {file = "websockets-14.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:a3c4aa3428b904d5404a0ed85f3644d37e2cb25996b7f096d77caeb0e96a3b42"},
- {file = "websockets-14.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:577a4cebf1ceaf0b65ffc42c54856214165fb8ceeba3935852fc33f6b0c55e7f"},
- {file = "websockets-14.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ad1c1d02357b7665e700eca43a31d52814ad9ad9b89b58118bdabc365454b574"},
- {file = "websockets-14.2-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f390024a47d904613577df83ba700bd189eedc09c57af0a904e5c39624621270"},
- {file = "websockets-14.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:3c1426c021c38cf92b453cdf371228d3430acd775edee6bac5a4d577efc72365"},
- {file = "websockets-14.2-py3-none-any.whl", hash = "sha256:7a6ceec4ea84469f15cf15807a747e9efe57e369c384fa86e022b3bea679b79b"},
- {file = "websockets-14.2.tar.gz", hash = "sha256:5059ed9c54945efb321f097084b4c7e52c246f2c869815876a69d1efc4ad6eb5"},
+ {file = "websockets-15.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d63efaa0cd96cf0c5fe4d581521d9fa87744540d4bc999ae6e08595a1014b45b"},
+ {file = "websockets-15.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ac60e3b188ec7574cb761b08d50fcedf9d77f1530352db4eef1707fe9dee7205"},
+ {file = "websockets-15.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5756779642579d902eed757b21b0164cd6fe338506a8083eb58af5c372e39d9a"},
+ {file = "websockets-15.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fdfe3e2a29e4db3659dbd5bbf04560cea53dd9610273917799f1cde46aa725e"},
+ {file = "websockets-15.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c2529b320eb9e35af0fa3016c187dffb84a3ecc572bcee7c3ce302bfeba52bf"},
+ {file = "websockets-15.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac1e5c9054fe23226fb11e05a6e630837f074174c4c2f0fe442996112a6de4fb"},
+ {file = "websockets-15.0.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5df592cd503496351d6dc14f7cdad49f268d8e618f80dce0cd5a36b93c3fc08d"},
+ {file = "websockets-15.0.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0a34631031a8f05657e8e90903e656959234f3a04552259458aac0b0f9ae6fd9"},
+ {file = "websockets-15.0.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3d00075aa65772e7ce9e990cab3ff1de702aa09be3940d1dc88d5abf1ab8a09c"},
+ {file = "websockets-15.0.1-cp310-cp310-win32.whl", hash = "sha256:1234d4ef35db82f5446dca8e35a7da7964d02c127b095e172e54397fb6a6c256"},
+ {file = "websockets-15.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:39c1fec2c11dc8d89bba6b2bf1556af381611a173ac2b511cf7231622058af41"},
+ {file = "websockets-15.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:823c248b690b2fd9303ba00c4f66cd5e2d8c3ba4aa968b2779be9532a4dad431"},
+ {file = "websockets-15.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678999709e68425ae2593acf2e3ebcbcf2e69885a5ee78f9eb80e6e371f1bf57"},
+ {file = "websockets-15.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d50fd1ee42388dcfb2b3676132c78116490976f1300da28eb629272d5d93e905"},
+ {file = "websockets-15.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d99e5546bf73dbad5bf3547174cd6cb8ba7273062a23808ffea025ecb1cf8562"},
+ {file = "websockets-15.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:66dd88c918e3287efc22409d426c8f729688d89a0c587c88971a0faa2c2f3792"},
+ {file = "websockets-15.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8dd8327c795b3e3f219760fa603dcae1dcc148172290a8ab15158cf85a953413"},
+ {file = "websockets-15.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8fdc51055e6ff4adeb88d58a11042ec9a5eae317a0a53d12c062c8a8865909e8"},
+ {file = "websockets-15.0.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:693f0192126df6c2327cce3baa7c06f2a117575e32ab2308f7f8216c29d9e2e3"},
+ {file = "websockets-15.0.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:54479983bd5fb469c38f2f5c7e3a24f9a4e70594cd68cd1fa6b9340dadaff7cf"},
+ {file = "websockets-15.0.1-cp311-cp311-win32.whl", hash = "sha256:16b6c1b3e57799b9d38427dda63edcbe4926352c47cf88588c0be4ace18dac85"},
+ {file = "websockets-15.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:27ccee0071a0e75d22cb35849b1db43f2ecd3e161041ac1ee9d2352ddf72f065"},
+ {file = "websockets-15.0.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3e90baa811a5d73f3ca0bcbf32064d663ed81318ab225ee4f427ad4e26e5aff3"},
+ {file = "websockets-15.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:592f1a9fe869c778694f0aa806ba0374e97648ab57936f092fd9d87f8bc03665"},
+ {file = "websockets-15.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0701bc3cfcb9164d04a14b149fd74be7347a530ad3bbf15ab2c678a2cd3dd9a2"},
+ {file = "websockets-15.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8b56bdcdb4505c8078cb6c7157d9811a85790f2f2b3632c7d1462ab5783d215"},
+ {file = "websockets-15.0.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0af68c55afbd5f07986df82831c7bff04846928ea8d1fd7f30052638788bc9b5"},
+ {file = "websockets-15.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64dee438fed052b52e4f98f76c5790513235efaa1ef7f3f2192c392cd7c91b65"},
+ {file = "websockets-15.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d5f6b181bb38171a8ad1d6aa58a67a6aa9d4b38d0f8c5f496b9e42561dfc62fe"},
+ {file = "websockets-15.0.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:5d54b09eba2bada6011aea5375542a157637b91029687eb4fdb2dab11059c1b4"},
+ {file = "websockets-15.0.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3be571a8b5afed347da347bfcf27ba12b069d9d7f42cb8c7028b5e98bbb12597"},
+ {file = "websockets-15.0.1-cp312-cp312-win32.whl", hash = "sha256:c338ffa0520bdb12fbc527265235639fb76e7bc7faafbb93f6ba80d9c06578a9"},
+ {file = "websockets-15.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcd5cf9e305d7b8338754470cf69cf81f420459dbae8a3b40cee57417f4614a7"},
+ {file = "websockets-15.0.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ee443ef070bb3b6ed74514f5efaa37a252af57c90eb33b956d35c8e9c10a1931"},
+ {file = "websockets-15.0.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5a939de6b7b4e18ca683218320fc67ea886038265fd1ed30173f5ce3f8e85675"},
+ {file = "websockets-15.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:746ee8dba912cd6fc889a8147168991d50ed70447bf18bcda7039f7d2e3d9151"},
+ {file = "websockets-15.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:595b6c3969023ecf9041b2936ac3827e4623bfa3ccf007575f04c5a6aa318c22"},
+ {file = "websockets-15.0.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c714d2fc58b5ca3e285461a4cc0c9a66bd0e24c5da9911e30158286c9b5be7f"},
+ {file = "websockets-15.0.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f3c1e2ab208db911594ae5b4f79addeb3501604a165019dd221c0bdcabe4db8"},
+ {file = "websockets-15.0.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:229cf1d3ca6c1804400b0a9790dc66528e08a6a1feec0d5040e8b9eb14422375"},
+ {file = "websockets-15.0.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:756c56e867a90fb00177d530dca4b097dd753cde348448a1012ed6c5131f8b7d"},
+ {file = "websockets-15.0.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:558d023b3df0bffe50a04e710bc87742de35060580a293c2a984299ed83bc4e4"},
+ {file = "websockets-15.0.1-cp313-cp313-win32.whl", hash = "sha256:ba9e56e8ceeeedb2e080147ba85ffcd5cd0711b89576b83784d8605a7df455fa"},
+ {file = "websockets-15.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:e09473f095a819042ecb2ab9465aee615bd9c2028e4ef7d933600a8401c79561"},
+ {file = "websockets-15.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5f4c04ead5aed67c8a1a20491d54cdfba5884507a48dd798ecaf13c74c4489f5"},
+ {file = "websockets-15.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:abdc0c6c8c648b4805c5eacd131910d2a7f6455dfd3becab248ef108e89ab16a"},
+ {file = "websockets-15.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a625e06551975f4b7ea7102bc43895b90742746797e2e14b70ed61c43a90f09b"},
+ {file = "websockets-15.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d591f8de75824cbb7acad4e05d2d710484f15f29d4a915092675ad3456f11770"},
+ {file = "websockets-15.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:47819cea040f31d670cc8d324bb6435c6f133b8c7a19ec3d61634e62f8d8f9eb"},
+ {file = "websockets-15.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac017dd64572e5c3bd01939121e4d16cf30e5d7e110a119399cf3133b63ad054"},
+ {file = "websockets-15.0.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4a9fac8e469d04ce6c25bb2610dc535235bd4aa14996b4e6dbebf5e007eba5ee"},
+ {file = "websockets-15.0.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:363c6f671b761efcb30608d24925a382497c12c506b51661883c3e22337265ed"},
+ {file = "websockets-15.0.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:2034693ad3097d5355bfdacfffcbd3ef5694f9718ab7f29c29689a9eae841880"},
+ {file = "websockets-15.0.1-cp39-cp39-win32.whl", hash = "sha256:3b1ac0d3e594bf121308112697cf4b32be538fb1444468fb0a6ae4feebc83411"},
+ {file = "websockets-15.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:b7643a03db5c95c799b89b31c036d5f27eeb4d259c798e878d6937d71832b1e4"},
+ {file = "websockets-15.0.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:0c9e74d766f2818bb95f84c25be4dea09841ac0f734d1966f415e4edfc4ef1c3"},
+ {file = "websockets-15.0.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1009ee0c7739c08a0cd59de430d6de452a55e42d6b522de7aa15e6f67db0b8e1"},
+ {file = "websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76d1f20b1c7a2fa82367e04982e708723ba0e7b8d43aa643d3dcd404d74f1475"},
+ {file = "websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f29d80eb9a9263b8d109135351caf568cc3f80b9928bccde535c235de55c22d9"},
+ {file = "websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b359ed09954d7c18bbc1680f380c7301f92c60bf924171629c5db97febb12f04"},
+ {file = "websockets-15.0.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:cad21560da69f4ce7658ca2cb83138fb4cf695a2ba3e475e0559e05991aa8122"},
+ {file = "websockets-15.0.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7f493881579c90fc262d9cdbaa05a6b54b3811c2f300766748db79f098db9940"},
+ {file = "websockets-15.0.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:47b099e1f4fbc95b701b6e85768e1fcdaf1630f3cbe4765fa216596f12310e2e"},
+ {file = "websockets-15.0.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:67f2b6de947f8c757db2db9c71527933ad0019737ec374a8a6be9a956786aaf9"},
+ {file = "websockets-15.0.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d08eb4c2b7d6c41da6ca0600c077e93f5adcfd979cd777d747e9ee624556da4b"},
+ {file = "websockets-15.0.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b826973a4a2ae47ba357e4e82fa44a463b8f168e1ca775ac64521442b19e87f"},
+ {file = "websockets-15.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:21c1fa28a6a7e3cbdc171c694398b6df4744613ce9b36b1a498e816787e28123"},
+ {file = "websockets-15.0.1-py3-none-any.whl", hash = "sha256:f7a866fbc1e97b5c617ee4116daaa09b722101d4a3c170c787450ba409f9736f"},
+ {file = "websockets-15.0.1.tar.gz", hash = "sha256:82544de02076bafba038ce055ee6412d68da13ab47f0c60cab827346de828dee"},
]
[[package]]
@@ -6726,10 +6685,10 @@ cffi = {version = ">=1.11", markers = "platform_python_implementation == \"PyPy\
cffi = ["cffi (>=1.11)"]
[extras]
-all = ["autoflake", "black", "docker", "fastapi", "isort", "langchain", "langchain-community", "locust", "pexpect", "pg8000", "pgvector", "pre-commit", "psycopg2", "psycopg2-binary", "pyright", "pytest-asyncio", "pytest-order", "uvicorn", "wikipedia"]
+all = ["autoflake", "black", "datamodel-code-generator", "docker", "fastapi", "isort", "langchain", "langchain-community", "locust", "pexpect", "pg8000", "pgvector", "pre-commit", "psycopg2", "psycopg2-binary", "pyright", "pytest-asyncio", "pytest-order", "uvicorn", "wikipedia"]
bedrock = ["boto3"]
cloud-tool-sandbox = ["e2b-code-interpreter"]
-desktop = ["docker", "fastapi", "langchain", "langchain-community", "locust", "pg8000", "pgvector", "psycopg2", "psycopg2-binary", "pyright", "uvicorn", "wikipedia"]
+desktop = ["datamodel-code-generator", "docker", "fastapi", "langchain", "langchain-community", "letta_client", "locust", "mcp", "pg8000", "pgvector", "psycopg2", "psycopg2-binary", "pyright", "uvicorn", "wikipedia"]
dev = ["autoflake", "black", "isort", "locust", "pexpect", "pre-commit", "pyright", "pytest-asyncio", "pytest-order"]
external-tools = ["docker", "langchain", "langchain-community", "wikipedia"]
google = ["google-genai"]
@@ -6741,4 +6700,4 @@ tests = ["wikipedia"]
[metadata]
lock-version = "2.0"
python-versions = "<3.14,>=3.10"
-content-hash = "f82e3f078f9c322701a4eded65d5f42ed74af5519c9342e40dabcf5062b0800f"
+content-hash = "edfd206bbcb61d39afd35d9c26c25055464e0e6328f54c5a370a8c6d47c59cf9"
diff --git a/pyproject.toml b/pyproject.toml
index bcd66f106..969b1f2ec 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -100,8 +100,9 @@ external-tools = ["docker", "langchain", "wikipedia", "langchain-community"]
tests = ["wikipedia"]
bedrock = ["boto3"]
google = ["google-genai"]
-desktop = ["pgvector", "pg8000", "psycopg2-binary", "psycopg2", "pyright", "websockets", "fastapi", "uvicorn", "docker", "langchain", "wikipedia", "langchain-community", "locust"]
-all = ["pgvector", "pg8000", "psycopg2-binary", "psycopg2", "pytest", "pytest-asyncio", "pexpect", "black", "pre-commit", "pyright", "pytest-order", "autoflake", "isort", "websockets", "fastapi", "uvicorn", "docker", "langchain", "wikipedia", "langchain-community", "locust"]
+desktop = ["pgvector", "pg8000", "psycopg2-binary", "psycopg2", "pyright", "websockets", "fastapi", "uvicorn", "docker", "langchain", "wikipedia", "langchain-community", "locust", "datamodel-code-generator", "mcp", "letta-client"]
+all = ["pgvector", "pg8000", "psycopg2-binary", "psycopg2", "pytest", "pytest-asyncio", "pexpect", "black", "pre-commit", "pyright", "pytest-order", "autoflake", "isort", "websockets", "fastapi", "uvicorn", "docker", "langchain", "wikipedia", "langchain-community", "locust", "datamodel-code-generator"]
+
[tool.poetry.group.dev.dependencies]
black = "^24.4.2"
diff --git a/tests/integration_test_chat_completions.py b/tests/integration_test_chat_completions.py
index 3ae24ec6c..36c7b742d 100644
--- a/tests/integration_test_chat_completions.py
+++ b/tests/integration_test_chat_completions.py
@@ -15,7 +15,9 @@ from letta.schemas.llm_config import LLMConfig
from letta.schemas.openai.chat_completion_request import ChatCompletionRequest, UserMessage
from letta.schemas.tool import ToolCreate
from letta.schemas.usage import LettaUsageStatistics
+from letta.services.agent_manager import AgentManager
from letta.services.tool_manager import ToolManager
+from letta.services.user_manager import UserManager
# --- Server Management --- #
@@ -108,10 +110,12 @@ def composio_gmail_get_profile_tool(default_user):
@pytest.fixture(scope="function")
-def agent(client, roll_dice_tool, weather_tool, composio_gmail_get_profile_tool):
+def agent(client, roll_dice_tool, weather_tool):
"""Creates an agent and ensures cleanup after tests."""
agent_state = client.create_agent(
- name=f"test_compl_{str(uuid.uuid4())[5:]}", tool_ids=[roll_dice_tool.id, weather_tool.id, composio_gmail_get_profile_tool.id]
+ name=f"test_compl_{str(uuid.uuid4())[5:]}",
+ tool_ids=[roll_dice_tool.id, weather_tool.id],
+ include_base_tools=False,
)
yield agent_state
client.delete_agent(agent_state.id)
@@ -152,8 +156,8 @@ def _assert_valid_chunk(chunk, idx, chunks):
@pytest.mark.asyncio
[email protected]("message", ["How are you?"])
[email protected]("endpoint", ["v1/voice"])
[email protected]("message", ["Hi how are you today?"])
[email protected]("endpoint", ["v1/voice-beta"])
async def test_latency(mock_e2b_api_key_none, client, agent, message, endpoint):
"""Tests chat completion streaming using the Async OpenAI client."""
request = _get_chat_request(message)
@@ -165,9 +169,30 @@ async def test_latency(mock_e2b_api_key_none, client, agent, message, endpoint):
print(chunk)
[email protected]("message", ["Use recall memory tool to recall what my name is."])
[email protected]("endpoint", ["v1/voice-beta"])
+async def test_voice_recall_memory(mock_e2b_api_key_none, client, agent, message, endpoint):
+ """Tests chat completion streaming using the Async OpenAI client."""
+ request = _get_chat_request(message)
+
+ # Insert some messages about my name
+ client.user_message(agent.id, "My name is Matt")
+
+ # Wipe the in context messages
+ actor = UserManager().get_default_user()
+ AgentManager().set_in_context_messages(agent_id=agent.id, message_ids=[agent.message_ids[0]], actor=actor)
+
+ async_client = AsyncOpenAI(base_url=f"{client.base_url}/{endpoint}/{agent.id}", max_retries=0)
+ stream = await async_client.chat.completions.create(**request.model_dump(exclude_none=True))
+ async with stream:
+ async for chunk in stream:
+ print(chunk)
+
+
@pytest.mark.asyncio
@pytest.mark.parametrize("message", ["Tell me something interesting about bananas.", "What's the weather in SF?"])
[email protected]("endpoint", ["openai/v1", "v1/voice"])
[email protected]("endpoint", ["openai/v1", "v1/voice-beta"])
async def test_chat_completions_streaming_openai_client(mock_e2b_api_key_none, client, agent, message, endpoint):
"""Tests chat completion streaming using the Async OpenAI client."""
request = _get_chat_request(message)
diff --git a/tests/test_server.py b/tests/test_server.py
index bc9562e31..c6db4da6b 100644
--- a/tests/test_server.py
+++ b/tests/test_server.py
@@ -798,22 +798,25 @@ def ingest(message: str):
'''
-def test_tool_run(server, mock_e2b_api_key_none, user, agent_id):
- """Test that the server can run tools"""
+import pytest
+
+def test_tool_run_basic(server, mock_e2b_api_key_none, user):
+ """Test running a simple tool from source"""
result = server.run_tool_from_source(
actor=user,
tool_source=EXAMPLE_TOOL_SOURCE,
tool_source_type="python",
tool_args={"message": "Hello, world!"},
- # tool_name="ingest",
)
- print(result)
assert result.status == "success"
- assert result.tool_return == "Ingested message Hello, world!", result.tool_return
+ assert result.tool_return == "Ingested message Hello, world!"
assert not result.stdout
assert not result.stderr
+
+def test_tool_run_with_env_var(server, mock_e2b_api_key_none, user):
+ """Test running a tool that uses an environment variable"""
result = server.run_tool_from_source(
actor=user,
tool_source=EXAMPLE_TOOL_SOURCE_WITH_ENV_VAR,
@@ -821,56 +824,45 @@ def test_tool_run(server, mock_e2b_api_key_none, user, agent_id):
tool_args={},
tool_env_vars={"secret": "banana"},
)
- print(result)
assert result.status == "success"
- assert result.tool_return == "banana", result.tool_return
+ assert result.tool_return == "banana"
assert not result.stdout
assert not result.stderr
- result = server.run_tool_from_source(
- actor=user,
- tool_source=EXAMPLE_TOOL_SOURCE,
- tool_source_type="python",
- tool_args={"message": "Well well well"},
- # tool_name="ingest",
- )
- print(result)
- assert result.status == "success"
- assert result.tool_return == "Ingested message Well well well", result.tool_return
- assert not result.stdout
- assert not result.stderr
+def test_tool_run_invalid_args(server, mock_e2b_api_key_none, user):
+ """Test running a tool with incorrect arguments"""
result = server.run_tool_from_source(
actor=user,
tool_source=EXAMPLE_TOOL_SOURCE,
tool_source_type="python",
tool_args={"bad_arg": "oh no"},
- # tool_name="ingest",
)
- print(result)
assert result.status == "error"
- assert "Error" in result.tool_return, result.tool_return
- assert "missing 1 required positional argument" in result.tool_return, result.tool_return
+ assert "Error" in result.tool_return
+ assert "missing 1 required positional argument" in result.tool_return
assert not result.stdout
assert result.stderr
assert "missing 1 required positional argument" in result.stderr[0]
- # Test that we can still pull the tool out by default (pulls that last tool in the source)
+
+def test_tool_run_with_distractor(server, mock_e2b_api_key_none, user):
+ """Test running a tool with a distractor function in the source"""
result = server.run_tool_from_source(
actor=user,
tool_source=EXAMPLE_TOOL_SOURCE_WITH_DISTRACTOR,
tool_source_type="python",
tool_args={"message": "Well well well"},
- # tool_name="ingest",
)
- print(result)
assert result.status == "success"
- assert result.tool_return == "Ingested message Well well well", result.tool_return
+ assert result.tool_return == "Ingested message Well well well"
assert result.stdout
assert "I'm a distractor" in result.stdout[0]
assert not result.stderr
- # Test that we can pull the tool out by name
+
+def test_tool_run_explicit_tool_name(server, mock_e2b_api_key_none, user):
+ """Test selecting a tool by name when multiple tools exist in the source"""
result = server.run_tool_from_source(
actor=user,
tool_source=EXAMPLE_TOOL_SOURCE_WITH_DISTRACTOR,
@@ -878,14 +870,15 @@ def test_tool_run(server, mock_e2b_api_key_none, user, agent_id):
tool_args={"message": "Well well well"},
tool_name="ingest",
)
- print(result)
assert result.status == "success"
- assert result.tool_return == "Ingested message Well well well", result.tool_return
+ assert result.tool_return == "Ingested message Well well well"
assert result.stdout
assert "I'm a distractor" in result.stdout[0]
assert not result.stderr
- # Test that we can pull a different tool out by name
+
+def test_tool_run_util_function(server, mock_e2b_api_key_none, user):
+ """Test selecting a utility function that does not return anything meaningful"""
result = server.run_tool_from_source(
actor=user,
tool_source=EXAMPLE_TOOL_SOURCE_WITH_DISTRACTOR,
@@ -893,14 +886,44 @@ def test_tool_run(server, mock_e2b_api_key_none, user, agent_id):
tool_args={},
tool_name="util_do_nothing",
)
- print(result)
assert result.status == "success"
- assert result.tool_return == str(None), result.tool_return
+ assert result.tool_return == str(None)
assert result.stdout
assert "I'm a distractor" in result.stdout[0]
assert not result.stderr
+def test_tool_run_with_explicit_json_schema(server, mock_e2b_api_key_none, user):
+ """Test overriding the autogenerated JSON schema with an explicit one"""
+ explicit_json_schema = {
+ "name": "ingest",
+ "description": "Blah blah blah.",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "message": {"type": "string", "description": "The message to ingest into the system."},
+ "request_heartbeat": {
+ "type": "boolean",
+ "description": "Request an immediate heartbeat after function execution. Set to `True` if you want to send a follow-up message or run a follow-up function.",
+ },
+ },
+ "required": ["message", "request_heartbeat"],
+ },
+ }
+
+ result = server.run_tool_from_source(
+ actor=user,
+ tool_source=EXAMPLE_TOOL_SOURCE,
+ tool_source_type="python",
+ tool_args={"message": "Custom schema test"},
+ tool_json_schema=explicit_json_schema,
+ )
+ assert result.status == "success"
+ assert result.tool_return == "Ingested message Custom schema test"
+ assert not result.stdout
+ assert not result.stderr
+
+
def test_composio_client_simple(server):
apps = server.get_composio_apps()
# Assert there's some amount of apps returned