letta-nightly 0.11.7.dev20251007104119__py3-none-any.whl → 0.11.7.dev20251008104128__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- letta/adapters/letta_llm_adapter.py +1 -0
- letta/adapters/letta_llm_request_adapter.py +0 -1
- letta/adapters/letta_llm_stream_adapter.py +7 -2
- letta/adapters/simple_llm_request_adapter.py +88 -0
- letta/adapters/simple_llm_stream_adapter.py +192 -0
- letta/agents/agent_loop.py +6 -0
- letta/agents/ephemeral_summary_agent.py +2 -1
- letta/agents/helpers.py +142 -6
- letta/agents/letta_agent.py +13 -33
- letta/agents/letta_agent_batch.py +2 -4
- letta/agents/letta_agent_v2.py +87 -77
- letta/agents/letta_agent_v3.py +899 -0
- letta/agents/voice_agent.py +2 -6
- letta/constants.py +8 -4
- letta/errors.py +40 -0
- letta/functions/function_sets/base.py +84 -4
- letta/functions/function_sets/multi_agent.py +0 -3
- letta/functions/schema_generator.py +113 -71
- letta/groups/dynamic_multi_agent.py +3 -2
- letta/groups/helpers.py +1 -2
- letta/groups/round_robin_multi_agent.py +3 -2
- letta/groups/sleeptime_multi_agent.py +3 -2
- letta/groups/sleeptime_multi_agent_v2.py +1 -1
- letta/groups/sleeptime_multi_agent_v3.py +17 -17
- letta/groups/supervisor_multi_agent.py +84 -80
- letta/helpers/converters.py +3 -0
- letta/helpers/message_helper.py +4 -0
- letta/helpers/tool_rule_solver.py +92 -5
- letta/interfaces/anthropic_streaming_interface.py +409 -0
- letta/interfaces/gemini_streaming_interface.py +296 -0
- letta/interfaces/openai_streaming_interface.py +752 -1
- letta/llm_api/anthropic_client.py +126 -16
- letta/llm_api/bedrock_client.py +4 -2
- letta/llm_api/deepseek_client.py +4 -1
- letta/llm_api/google_vertex_client.py +123 -42
- letta/llm_api/groq_client.py +4 -1
- letta/llm_api/llm_api_tools.py +11 -4
- letta/llm_api/llm_client_base.py +6 -2
- letta/llm_api/openai.py +32 -2
- letta/llm_api/openai_client.py +423 -18
- letta/llm_api/xai_client.py +4 -1
- letta/main.py +9 -5
- letta/memory.py +1 -0
- letta/orm/__init__.py +1 -1
- letta/orm/agent.py +10 -0
- letta/orm/block.py +7 -16
- letta/orm/blocks_agents.py +8 -2
- letta/orm/files_agents.py +2 -0
- letta/orm/job.py +7 -5
- letta/orm/mcp_oauth.py +1 -0
- letta/orm/message.py +21 -6
- letta/orm/organization.py +2 -0
- letta/orm/provider.py +6 -2
- letta/orm/run.py +71 -0
- letta/orm/sandbox_config.py +7 -1
- letta/orm/sqlalchemy_base.py +0 -306
- letta/orm/step.py +6 -5
- letta/orm/step_metrics.py +5 -5
- letta/otel/tracing.py +28 -3
- letta/plugins/defaults.py +4 -4
- letta/prompts/system_prompts/__init__.py +2 -0
- letta/prompts/system_prompts/letta_v1.py +25 -0
- letta/schemas/agent.py +3 -2
- letta/schemas/agent_file.py +9 -3
- letta/schemas/block.py +23 -10
- letta/schemas/enums.py +21 -2
- letta/schemas/job.py +17 -4
- letta/schemas/letta_message_content.py +71 -2
- letta/schemas/letta_stop_reason.py +5 -5
- letta/schemas/llm_config.py +53 -3
- letta/schemas/memory.py +1 -1
- letta/schemas/message.py +504 -117
- letta/schemas/openai/responses_request.py +64 -0
- letta/schemas/providers/__init__.py +2 -0
- letta/schemas/providers/anthropic.py +16 -0
- letta/schemas/providers/ollama.py +115 -33
- letta/schemas/providers/openrouter.py +52 -0
- letta/schemas/providers/vllm.py +2 -1
- letta/schemas/run.py +48 -42
- letta/schemas/step.py +2 -2
- letta/schemas/step_metrics.py +1 -1
- letta/schemas/tool.py +15 -107
- letta/schemas/tool_rule.py +88 -5
- letta/serialize_schemas/marshmallow_agent.py +1 -0
- letta/server/db.py +86 -408
- letta/server/rest_api/app.py +61 -10
- letta/server/rest_api/dependencies.py +14 -0
- letta/server/rest_api/redis_stream_manager.py +19 -8
- letta/server/rest_api/routers/v1/agents.py +364 -292
- letta/server/rest_api/routers/v1/blocks.py +14 -20
- letta/server/rest_api/routers/v1/identities.py +45 -110
- letta/server/rest_api/routers/v1/internal_templates.py +21 -0
- letta/server/rest_api/routers/v1/jobs.py +23 -6
- letta/server/rest_api/routers/v1/messages.py +1 -1
- letta/server/rest_api/routers/v1/runs.py +126 -85
- letta/server/rest_api/routers/v1/sandbox_configs.py +10 -19
- letta/server/rest_api/routers/v1/tools.py +281 -594
- letta/server/rest_api/routers/v1/voice.py +1 -1
- letta/server/rest_api/streaming_response.py +29 -29
- letta/server/rest_api/utils.py +122 -64
- letta/server/server.py +160 -887
- letta/services/agent_manager.py +236 -919
- letta/services/agent_serialization_manager.py +16 -0
- letta/services/archive_manager.py +0 -100
- letta/services/block_manager.py +211 -168
- letta/services/file_manager.py +1 -1
- letta/services/files_agents_manager.py +24 -33
- letta/services/group_manager.py +0 -142
- letta/services/helpers/agent_manager_helper.py +7 -2
- letta/services/helpers/run_manager_helper.py +85 -0
- letta/services/job_manager.py +96 -411
- letta/services/lettuce/__init__.py +6 -0
- letta/services/lettuce/lettuce_client_base.py +86 -0
- letta/services/mcp_manager.py +38 -6
- letta/services/message_manager.py +165 -362
- letta/services/organization_manager.py +0 -36
- letta/services/passage_manager.py +0 -345
- letta/services/provider_manager.py +0 -80
- letta/services/run_manager.py +301 -0
- letta/services/sandbox_config_manager.py +0 -234
- letta/services/step_manager.py +62 -39
- letta/services/summarizer/summarizer.py +9 -7
- letta/services/telemetry_manager.py +0 -16
- letta/services/tool_executor/builtin_tool_executor.py +35 -0
- letta/services/tool_executor/core_tool_executor.py +397 -2
- letta/services/tool_executor/files_tool_executor.py +3 -3
- letta/services/tool_executor/multi_agent_tool_executor.py +30 -15
- letta/services/tool_executor/tool_execution_manager.py +6 -8
- letta/services/tool_executor/tool_executor_base.py +3 -3
- letta/services/tool_manager.py +85 -339
- letta/services/tool_sandbox/base.py +24 -13
- letta/services/tool_sandbox/e2b_sandbox.py +16 -1
- letta/services/tool_schema_generator.py +123 -0
- letta/services/user_manager.py +0 -99
- letta/settings.py +20 -4
- {letta_nightly-0.11.7.dev20251007104119.dist-info → letta_nightly-0.11.7.dev20251008104128.dist-info}/METADATA +3 -5
- {letta_nightly-0.11.7.dev20251007104119.dist-info → letta_nightly-0.11.7.dev20251008104128.dist-info}/RECORD +140 -132
- letta/agents/temporal/activities/__init__.py +0 -4
- letta/agents/temporal/activities/example_activity.py +0 -7
- letta/agents/temporal/activities/prepare_messages.py +0 -10
- letta/agents/temporal/temporal_agent_workflow.py +0 -56
- letta/agents/temporal/types.py +0 -25
- {letta_nightly-0.11.7.dev20251007104119.dist-info → letta_nightly-0.11.7.dev20251008104128.dist-info}/WHEEL +0 -0
- {letta_nightly-0.11.7.dev20251007104119.dist-info → letta_nightly-0.11.7.dev20251008104128.dist-info}/entry_points.txt +0 -0
- {letta_nightly-0.11.7.dev20251007104119.dist-info → letta_nightly-0.11.7.dev20251008104128.dist-info}/licenses/LICENSE +0 -0
@@ -1,56 +0,0 @@
|
|
1
|
-
from dataclasses import dataclass
|
2
|
-
from datetime import timedelta
|
3
|
-
from temporalio import workflow
|
4
|
-
|
5
|
-
from ...schemas.letta_stop_reason import StopReasonType
|
6
|
-
from ...schemas.usage import LettaUsageStatistics
|
7
|
-
|
8
|
-
# Import activity, passing it through the sandbox without reloading the module
|
9
|
-
with workflow.unsafe.imports_passed_through():
|
10
|
-
from .activities import prepare_messages, example_activity
|
11
|
-
from .types import WorkflowInputParams, FinalResult
|
12
|
-
|
13
|
-
@workflow.defn
|
14
|
-
class TemporalAgentWorkflow:
|
15
|
-
@workflow.run
|
16
|
-
async def run(self, params: WorkflowInputParams) -> FinalResult:
|
17
|
-
messages = await workflow.execute_activity(
|
18
|
-
prepare_messages, params, start_to_close_timeout=timedelta(seconds=5)
|
19
|
-
)
|
20
|
-
result = FinalResult(
|
21
|
-
stop_reason=StopReasonType.end_turn,
|
22
|
-
usage=LettaUsageStatistics(),
|
23
|
-
)
|
24
|
-
|
25
|
-
for i in range(params.max_steps):
|
26
|
-
_ = await workflow.execute_activity(
|
27
|
-
example_activity, messages, start_to_close_timeout=timedelta(seconds=5)
|
28
|
-
)
|
29
|
-
# self._maybe_get_approval_messages
|
30
|
-
# if approval
|
31
|
-
# parse tool params from approval message
|
32
|
-
# else
|
33
|
-
# self._check_run_cancellation
|
34
|
-
# self._refresh_messages
|
35
|
-
|
36
|
-
# try:
|
37
|
-
# self.llm_client.build_request_data
|
38
|
-
# self.llm_client.request_async
|
39
|
-
# self.llm_client.convert_response_to_chat_completion
|
40
|
-
# except ContextWindowExceededError:
|
41
|
-
# self.summarize_conversation_history
|
42
|
-
# self.llm_client.build_request_data
|
43
|
-
# self.llm_client.request_async
|
44
|
-
# self.llm_client.convert_response_to_chat_completion
|
45
|
-
|
46
|
-
# self._update_global_usage_stats
|
47
|
-
# parse tool call args
|
48
|
-
# self._handle_ai_response <-- this needs to be broken up into individual pieces
|
49
|
-
# self.agent_manager.update_message_ids_async
|
50
|
-
# convert message to letta message and return
|
51
|
-
pass
|
52
|
-
|
53
|
-
# self.summarize_conversation_history
|
54
|
-
# put together final result
|
55
|
-
|
56
|
-
return result
|
letta/agents/temporal/types.py
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
from dataclasses import dataclass
|
2
|
-
from typing import List
|
3
|
-
from letta.schemas.agent import AgentState
|
4
|
-
from letta.schemas.letta_stop_reason import StopReasonType
|
5
|
-
from letta.schemas.message import Message, MessageCreate
|
6
|
-
from letta.schemas.usage import LettaUsageStatistics
|
7
|
-
from letta.schemas.user import User
|
8
|
-
|
9
|
-
@dataclass
|
10
|
-
class WorkflowInputParams:
|
11
|
-
agent_state: AgentState
|
12
|
-
messages: list[MessageCreate]
|
13
|
-
actor: User
|
14
|
-
max_steps: int = 50
|
15
|
-
|
16
|
-
@dataclass
|
17
|
-
class PreparedMessages:
|
18
|
-
in_context_messages: List[Message]
|
19
|
-
input_messages_to_persist: List[Message]
|
20
|
-
|
21
|
-
|
22
|
-
@dataclass
|
23
|
-
class FinalResult:
|
24
|
-
stop_reason: StopReasonType
|
25
|
-
usage: LettaUsageStatistics
|
File without changes
|
File without changes
|