letta-nightly 0.6.48.dev20250407104216__tar.gz → 0.6.49.dev20250408030511__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of letta-nightly might be problematic. Click here for more details.

Files changed (326) hide show
  1. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/PKG-INFO +2 -2
  2. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/__init__.py +1 -1
  3. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/agent.py +47 -12
  4. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/agents/base_agent.py +7 -4
  5. letta_nightly-0.6.49.dev20250408030511/letta/agents/helpers.py +52 -0
  6. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/agents/letta_agent.py +105 -42
  7. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/agents/voice_agent.py +2 -2
  8. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/constants.py +13 -1
  9. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/errors.py +10 -3
  10. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/function_sets/base.py +65 -0
  11. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/interface.py +2 -2
  12. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/mcp_client/base_client.py +18 -1
  13. {letta_nightly-0.6.48.dev20250407104216/letta → letta_nightly-0.6.49.dev20250408030511/letta/groups}/dynamic_multi_agent.py +3 -0
  14. letta_nightly-0.6.49.dev20250408030511/letta/groups/helpers.py +113 -0
  15. {letta_nightly-0.6.48.dev20250407104216/letta → letta_nightly-0.6.49.dev20250408030511/letta/groups}/round_robin_multi_agent.py +2 -0
  16. letta_nightly-0.6.49.dev20250408030511/letta/groups/sleeptime_multi_agent.py +259 -0
  17. {letta_nightly-0.6.48.dev20250407104216/letta → letta_nightly-0.6.49.dev20250408030511/letta/groups}/supervisor_multi_agent.py +1 -0
  18. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/helpers/converters.py +109 -7
  19. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/helpers/message_helper.py +1 -0
  20. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/helpers/tool_rule_solver.py +40 -23
  21. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/interface.py +12 -5
  22. letta_nightly-0.6.49.dev20250408030511/letta/interfaces/anthropic_streaming_interface.py +329 -0
  23. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/anthropic.py +12 -1
  24. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/anthropic_client.py +65 -14
  25. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/azure_openai.py +2 -2
  26. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/google_ai_client.py +13 -2
  27. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/google_constants.py +3 -0
  28. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/google_vertex_client.py +2 -2
  29. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/llm_api_tools.py +1 -1
  30. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/llm_client.py +7 -0
  31. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/llm_client_base.py +2 -7
  32. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/openai.py +7 -1
  33. letta_nightly-0.6.49.dev20250408030511/letta/llm_api/openai_client.py +250 -0
  34. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/__init__.py +4 -0
  35. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/agent.py +6 -0
  36. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/block.py +32 -2
  37. letta_nightly-0.6.49.dev20250408030511/letta/orm/block_history.py +46 -0
  38. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/custom_columns.py +60 -0
  39. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/enums.py +7 -0
  40. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/group.py +6 -0
  41. letta_nightly-0.6.49.dev20250408030511/letta/orm/groups_blocks.py +13 -0
  42. letta_nightly-0.6.49.dev20250408030511/letta/orm/llm_batch_items.py +55 -0
  43. letta_nightly-0.6.49.dev20250408030511/letta/orm/llm_batch_job.py +48 -0
  44. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/message.py +7 -1
  45. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/organization.py +2 -0
  46. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/sqlalchemy_base.py +18 -15
  47. letta_nightly-0.6.49.dev20250408030511/letta/prompts/system/memgpt_sleeptime_chat.txt +52 -0
  48. letta_nightly-0.6.49.dev20250408030511/letta/prompts/system/sleeptime.txt +26 -0
  49. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/agent.py +13 -1
  50. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/enums.py +17 -2
  51. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/group.py +14 -1
  52. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/letta_message.py +5 -3
  53. letta_nightly-0.6.49.dev20250408030511/letta/schemas/llm_batch_job.py +53 -0
  54. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/llm_config.py +14 -4
  55. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/message.py +44 -0
  56. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/tool.py +3 -0
  57. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/usage.py +1 -0
  58. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/db.py +2 -0
  59. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/app.py +1 -1
  60. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/chat_completions_interface.py +8 -3
  61. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/interface.py +36 -7
  62. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/agents.py +53 -39
  63. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/runs.py +14 -2
  64. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/utils.py +15 -4
  65. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/server.py +120 -71
  66. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/agent_manager.py +70 -6
  67. letta_nightly-0.6.49.dev20250408030511/letta/services/block_manager.py +330 -0
  68. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/group_manager.py +68 -0
  69. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/helpers/agent_manager_helper.py +6 -4
  70. letta_nightly-0.6.49.dev20250408030511/letta/services/llm_batch_manager.py +139 -0
  71. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/message_manager.py +17 -31
  72. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/tool_executor/tool_execution_sandbox.py +1 -3
  73. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/tool_executor/tool_executor.py +9 -20
  74. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/tool_manager.py +14 -3
  75. letta_nightly-0.6.49.dev20250408030511/letta/services/tool_sandbox/__init__.py +0 -0
  76. letta_nightly-0.6.49.dev20250408030511/letta/services/tool_sandbox/base.py +188 -0
  77. letta_nightly-0.6.49.dev20250408030511/letta/services/tool_sandbox/e2b_sandbox.py +116 -0
  78. letta_nightly-0.6.49.dev20250408030511/letta/services/tool_sandbox/local_sandbox.py +221 -0
  79. letta_nightly-0.6.49.dev20250408030511/letta/sleeptime_agent.py +61 -0
  80. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/streaming_interface.py +20 -10
  81. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/utils.py +4 -0
  82. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/pyproject.toml +2 -2
  83. letta_nightly-0.6.48.dev20250407104216/letta/offline_memory_agent.py +0 -173
  84. letta_nightly-0.6.48.dev20250407104216/letta/services/block_manager.py +0 -142
  85. letta_nightly-0.6.48.dev20250407104216/letta/services/tool_executor/async_tool_execution_sandbox.py +0 -397
  86. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/LICENSE +0 -0
  87. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/README.md +0 -0
  88. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/__main__.py +0 -0
  89. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/agents/__init__.py +0 -0
  90. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/agents/ephemeral_agent.py +0 -0
  91. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/agents/ephemeral_memory_agent.py +0 -0
  92. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/benchmark/benchmark.py +0 -0
  93. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/benchmark/constants.py +0 -0
  94. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/cli/cli.py +0 -0
  95. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/cli/cli_config.py +0 -0
  96. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/cli/cli_load.py +0 -0
  97. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/client/__init__.py +0 -0
  98. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/client/client.py +0 -0
  99. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/client/streaming.py +0 -0
  100. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/client/utils.py +0 -0
  101. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/config.py +0 -0
  102. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/data_sources/connectors.py +0 -0
  103. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/data_sources/connectors_helper.py +0 -0
  104. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/embeddings.py +0 -0
  105. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/__init__.py +0 -0
  106. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/ast_parsers.py +0 -0
  107. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/function_sets/extras.py +0 -0
  108. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/function_sets/multi_agent.py +0 -0
  109. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/functions.py +0 -0
  110. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/helpers.py +0 -0
  111. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/mcp_client/__init__.py +0 -0
  112. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/mcp_client/exceptions.py +0 -0
  113. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/mcp_client/sse_client.py +0 -0
  114. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/mcp_client/stdio_client.py +0 -0
  115. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/mcp_client/types.py +0 -0
  116. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/functions/schema_generator.py +0 -0
  117. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/helpers/__init__.py +0 -0
  118. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/helpers/composio_helpers.py +0 -0
  119. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/helpers/datetime_helpers.py +0 -0
  120. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/helpers/json_helpers.py +0 -0
  121. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/helpers/tool_execution_helper.py +0 -0
  122. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/humans/__init__.py +0 -0
  123. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/humans/examples/basic.txt +0 -0
  124. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/humans/examples/cs_phd.txt +0 -0
  125. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/interfaces/__init__.py +0 -0
  126. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/interfaces/openai_chat_completions_streaming_interface.py +0 -0
  127. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/interfaces/utils.py +0 -0
  128. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/__init__.py +0 -0
  129. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/aws_bedrock.py +0 -0
  130. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/azure_openai_constants.py +0 -0
  131. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/cohere.py +0 -0
  132. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/deepseek.py +0 -0
  133. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/helpers.py +0 -0
  134. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/llm_api/mistral.py +0 -0
  135. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/README.md +0 -0
  136. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/__init__.py +0 -0
  137. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/chat_completion_proxy.py +0 -0
  138. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/constants.py +0 -0
  139. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/function_parser.py +0 -0
  140. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/grammars/__init__.py +0 -0
  141. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
  142. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/grammars/json.gbnf +0 -0
  143. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
  144. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/json_parser.py +0 -0
  145. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/koboldcpp/api.py +0 -0
  146. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/koboldcpp/settings.py +0 -0
  147. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llamacpp/api.py +0 -0
  148. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llamacpp/settings.py +0 -0
  149. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
  150. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
  151. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
  152. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
  153. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
  154. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
  155. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
  156. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
  157. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
  158. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/lmstudio/api.py +0 -0
  159. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/lmstudio/settings.py +0 -0
  160. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/ollama/api.py +0 -0
  161. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/ollama/settings.py +0 -0
  162. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/settings/__init__.py +0 -0
  163. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
  164. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/settings/settings.py +0 -0
  165. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/settings/simple.py +0 -0
  166. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/utils.py +0 -0
  167. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/vllm/api.py +0 -0
  168. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/webui/api.py +0 -0
  169. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/webui/legacy_api.py +0 -0
  170. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/webui/legacy_settings.py +0 -0
  171. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/local_llm/webui/settings.py +0 -0
  172. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/log.py +0 -0
  173. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/main.py +0 -0
  174. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/memory.py +0 -0
  175. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/openai_backcompat/__init__.py +0 -0
  176. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/openai_backcompat/openai_object.py +0 -0
  177. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/__all__.py +0 -0
  178. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/agents_tags.py +0 -0
  179. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/base.py +0 -0
  180. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/blocks_agents.py +0 -0
  181. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/errors.py +0 -0
  182. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/file.py +0 -0
  183. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/groups_agents.py +0 -0
  184. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/identities_agents.py +0 -0
  185. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/identities_blocks.py +0 -0
  186. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/identity.py +0 -0
  187. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/job.py +0 -0
  188. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/job_messages.py +0 -0
  189. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/mixins.py +0 -0
  190. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/passage.py +0 -0
  191. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/provider.py +0 -0
  192. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/sandbox_config.py +0 -0
  193. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/source.py +0 -0
  194. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/sources_agents.py +0 -0
  195. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/sqlite_functions.py +0 -0
  196. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/step.py +0 -0
  197. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/tool.py +0 -0
  198. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/tools_agents.py +0 -0
  199. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/orm/user.py +0 -0
  200. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/__init__.py +0 -0
  201. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/examples/anna_pa.txt +0 -0
  202. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/examples/google_search_persona.txt +0 -0
  203. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/examples/memgpt_doc.txt +0 -0
  204. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/examples/memgpt_starter.txt +0 -0
  205. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/examples/o1_persona.txt +0 -0
  206. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/examples/offline_memory_persona.txt +0 -0
  207. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/examples/sam.txt +0 -0
  208. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/examples/sam_pov.txt +0 -0
  209. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
  210. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/personas/examples/sqldb/test.db +0 -0
  211. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/__init__.py +0 -0
  212. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/gpt_summarize.py +0 -0
  213. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/gpt_system.py +0 -0
  214. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_base.txt +0 -0
  215. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_chat.txt +0 -0
  216. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
  217. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
  218. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_convo_only.txt +0 -0
  219. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_doc.txt +0 -0
  220. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
  221. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
  222. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_memory_only.txt +0 -0
  223. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
  224. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
  225. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
  226. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
  227. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/pytest.ini +0 -0
  228. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/block.py +0 -0
  229. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/embedding_config.py +0 -0
  230. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/embedding_config_overrides.py +0 -0
  231. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/environment_variables.py +0 -0
  232. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/file.py +0 -0
  233. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/health.py +0 -0
  234. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/identity.py +0 -0
  235. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/job.py +0 -0
  236. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/letta_base.py +0 -0
  237. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/letta_message_content.py +0 -0
  238. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/letta_request.py +0 -0
  239. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/letta_response.py +0 -0
  240. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/llm_config_overrides.py +0 -0
  241. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/memory.py +0 -0
  242. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/openai/chat_completion_request.py +0 -0
  243. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/openai/chat_completion_response.py +0 -0
  244. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/openai/chat_completions.py +0 -0
  245. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/openai/embedding_response.py +0 -0
  246. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/openai/openai.py +0 -0
  247. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/organization.py +0 -0
  248. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/passage.py +0 -0
  249. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/providers.py +0 -0
  250. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/run.py +0 -0
  251. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/sandbox_config.py +0 -0
  252. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/source.py +0 -0
  253. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/step.py +0 -0
  254. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/tool_rule.py +0 -0
  255. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/schemas/user.py +0 -0
  256. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/serialize_schemas/__init__.py +0 -0
  257. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/serialize_schemas/marshmallow_agent.py +0 -0
  258. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/serialize_schemas/marshmallow_agent_environment_variable.py +0 -0
  259. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/serialize_schemas/marshmallow_base.py +0 -0
  260. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/serialize_schemas/marshmallow_block.py +0 -0
  261. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/serialize_schemas/marshmallow_custom_fields.py +0 -0
  262. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/serialize_schemas/marshmallow_message.py +0 -0
  263. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/serialize_schemas/marshmallow_tag.py +0 -0
  264. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/serialize_schemas/marshmallow_tool.py +0 -0
  265. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/serialize_schemas/pydantic_agent_schema.py +0 -0
  266. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/__init__.py +0 -0
  267. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/constants.py +0 -0
  268. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/generate_openapi_schema.sh +0 -0
  269. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/__init__.py +0 -0
  270. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/auth/__init__.py +0 -0
  271. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/auth/index.py +0 -0
  272. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/auth_token.py +0 -0
  273. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/optimistic_json_parser.py +0 -0
  274. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/__init__.py +0 -0
  275. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
  276. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
  277. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/__init__.py +0 -0
  278. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/blocks.py +0 -0
  279. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/groups.py +0 -0
  280. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/health.py +0 -0
  281. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/identities.py +0 -0
  282. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/jobs.py +0 -0
  283. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/llms.py +0 -0
  284. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/organizations.py +0 -0
  285. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/providers.py +0 -0
  286. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
  287. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/sources.py +0 -0
  288. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/steps.py +0 -0
  289. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/tags.py +0 -0
  290. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/tools.py +0 -0
  291. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/users.py +0 -0
  292. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/routers/v1/voice.py +0 -0
  293. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/rest_api/static_files.py +0 -0
  294. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/startup.sh +0 -0
  295. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/static_files/assets/index-048c9598.js +0 -0
  296. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/static_files/assets/index-0e31b727.css +0 -0
  297. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/static_files/favicon.ico +0 -0
  298. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/static_files/index.html +0 -0
  299. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
  300. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/utils.py +0 -0
  301. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/ws_api/__init__.py +0 -0
  302. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/ws_api/example_client.py +0 -0
  303. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/ws_api/interface.py +0 -0
  304. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/ws_api/protocol.py +0 -0
  305. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/server/ws_api/server.py +0 -0
  306. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/__init__.py +0 -0
  307. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/helpers/tool_execution_helper.py +0 -0
  308. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/identity_manager.py +0 -0
  309. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/job_manager.py +0 -0
  310. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/organization_manager.py +0 -0
  311. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/passage_manager.py +0 -0
  312. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/per_agent_lock_manager.py +0 -0
  313. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/provider_manager.py +0 -0
  314. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/sandbox_config_manager.py +0 -0
  315. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/source_manager.py +0 -0
  316. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/step_manager.py +0 -0
  317. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/summarizer/__init__.py +0 -0
  318. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/summarizer/enums.py +0 -0
  319. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/summarizer/summarizer.py +0 -0
  320. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/tool_executor/__init__.py +0 -0
  321. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/tool_executor/tool_execution_manager.py +0 -0
  322. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/services/user_manager.py +0 -0
  323. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/settings.py +0 -0
  324. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/streaming_utils.py +0 -0
  325. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/system.py +0 -0
  326. {letta_nightly-0.6.48.dev20250407104216 → letta_nightly-0.6.49.dev20250408030511}/letta/tracing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-nightly
3
- Version: 0.6.48.dev20250407104216
3
+ Version: 0.6.49.dev20250408030511
4
4
  Summary: Create LLM agents with long-term memory and custom tools
5
5
  License: Apache License
6
6
  Author: Letta Team
@@ -49,7 +49,7 @@ Requires-Dist: isort (>=5.13.2,<6.0.0) ; extra == "dev" or extra == "all"
49
49
  Requires-Dist: jinja2 (>=3.1.5,<4.0.0)
50
50
  Requires-Dist: langchain (>=0.3.7,<0.4.0) ; extra == "external-tools" or extra == "desktop" or extra == "all"
51
51
  Requires-Dist: langchain-community (>=0.3.7,<0.4.0) ; extra == "external-tools" or extra == "desktop" or extra == "all"
52
- Requires-Dist: letta_client (>=0.1.65,<0.2.0) ; extra == "desktop"
52
+ Requires-Dist: letta_client (>=0.1.97,<0.2.0) ; extra == "desktop"
53
53
  Requires-Dist: llama-index (>=0.12.2,<0.13.0)
54
54
  Requires-Dist: llama-index-embeddings-openai (>=0.3.1,<0.4.0)
55
55
  Requires-Dist: locust (>=2.31.5,<3.0.0) ; extra == "dev" or extra == "desktop" or extra == "all"
@@ -1,4 +1,4 @@
1
- __version__ = "0.6.48"
1
+ __version__ = "0.6.49"
2
2
 
3
3
  # import clients
4
4
  from letta.client.client import LocalClient, RESTClient, create_client
@@ -52,7 +52,11 @@ from letta.schemas.tool_rule import TerminalToolRule
52
52
  from letta.schemas.usage import LettaUsageStatistics
53
53
  from letta.services.agent_manager import AgentManager
54
54
  from letta.services.block_manager import BlockManager
55
- from letta.services.helpers.agent_manager_helper import check_supports_structured_output, compile_memory_metadata_block
55
+ from letta.services.helpers.agent_manager_helper import (
56
+ check_supports_structured_output,
57
+ compile_memory_metadata_block,
58
+ compile_system_message,
59
+ )
56
60
  from letta.services.job_manager import JobManager
57
61
  from letta.services.message_manager import MessageManager
58
62
  from letta.services.passage_manager import PassageManager
@@ -130,6 +134,7 @@ class Agent(BaseAgent):
130
134
  # Different interfaces can handle events differently
131
135
  # e.g., print in CLI vs send a discord message with a discord bot
132
136
  self.interface = interface
137
+ self.chunk_index = 0
133
138
 
134
139
  # Create the persistence manager object based on the AgentState info
135
140
  self.message_manager = MessageManager()
@@ -246,9 +251,11 @@ class Agent(BaseAgent):
246
251
  group_id=group_id,
247
252
  )
248
253
  messages.append(new_message)
249
- self.interface.function_message(f"Error: {error_msg}", msg_obj=new_message)
254
+ self.interface.function_message(f"Error: {error_msg}", msg_obj=new_message, chunk_index=self.chunk_index)
255
+ self.chunk_index += 1
250
256
  if include_function_failed_message:
251
- self.interface.function_message(f"Ran {function_name}({function_args})", msg_obj=new_message)
257
+ self.interface.function_message(f"Ran {function_name}({function_args})", msg_obj=new_message, chunk_index=self.chunk_index)
258
+ self.chunk_index += 1
252
259
 
253
260
  # Return updated messages
254
261
  return messages
@@ -295,11 +302,35 @@ class Agent(BaseAgent):
295
302
  and not self.supports_structured_output
296
303
  and len(self.tool_rules_solver.init_tool_rules) > 0
297
304
  ):
305
+ # TODO: This just seems wrong? What if there are more than 1 init tool rules?
298
306
  force_tool_call = self.tool_rules_solver.init_tool_rules[0].tool_name
299
307
  # Force a tool call if exactly one tool is specified
300
308
  elif step_count is not None and step_count > 0 and len(allowed_tool_names) == 1:
301
309
  force_tool_call = allowed_tool_names[0]
302
310
 
311
+ if force_tool_call == "core_memory_insert":
312
+ current_system_message = message_sequence[0]
313
+ new_memory = Memory(
314
+ blocks=self.agent_state.memory.blocks,
315
+ prompt_template=(
316
+ "{% for block in blocks %}"
317
+ '<{{ block.label }} characters="{{ block.value|length }}/{{ block.limit }}">\n'
318
+ "{% for line in block.value.splitlines() %}"
319
+ "{{ loop.index0 }}: {{ line }}\n"
320
+ "{% endfor %}"
321
+ "</{{ block.label }}>"
322
+ "{% if not loop.last %}\n{% endif %}"
323
+ "{% endfor %}"
324
+ ),
325
+ )
326
+ new_system_message_str = compile_system_message(
327
+ system_prompt=self.agent_state.system,
328
+ in_context_memory=new_memory,
329
+ in_context_memory_last_edit=current_system_message.created_at,
330
+ previous_message_count=len(message_sequence),
331
+ )
332
+ message_sequence[0].content = [TextContent(text=new_system_message_str)]
333
+
303
334
  for attempt in range(1, empty_response_retry_limit + 1):
304
335
  try:
305
336
  log_telemetry(self.logger, "_get_ai_reply create start")
@@ -313,9 +344,7 @@ class Agent(BaseAgent):
313
344
  response = llm_client.send_llm_request(
314
345
  messages=message_sequence,
315
346
  tools=allowed_functions,
316
- tool_call=function_call,
317
347
  stream=stream,
318
- first_message=first_message,
319
348
  force_tool_call=force_tool_call,
320
349
  )
321
350
  else:
@@ -431,7 +460,8 @@ class Agent(BaseAgent):
431
460
  nonnull_content = False
432
461
  if response_message.content or response_message.reasoning_content or response_message.redacted_reasoning_content:
433
462
  # The content if then internal monologue, not chat
434
- self.interface.internal_monologue(response_message.content, msg_obj=messages[-1])
463
+ self.interface.internal_monologue(response_message.content, msg_obj=messages[-1], chunk_index=self.chunk_index)
464
+ self.chunk_index += 1
435
465
  # Flag to avoid printing a duplicate if inner thoughts get popped from the function call
436
466
  nonnull_content = True
437
467
 
@@ -480,7 +510,8 @@ class Agent(BaseAgent):
480
510
  response_message.content = function_args.pop("inner_thoughts")
481
511
  # The content if then internal monologue, not chat
482
512
  if response_message.content and not nonnull_content:
483
- self.interface.internal_monologue(response_message.content, msg_obj=messages[-1])
513
+ self.interface.internal_monologue(response_message.content, msg_obj=messages[-1], chunk_index=self.chunk_index)
514
+ self.chunk_index += 1
484
515
 
485
516
  # (Still parsing function args)
486
517
  # Handle requests for immediate heartbeat
@@ -502,7 +533,8 @@ class Agent(BaseAgent):
502
533
  # Failure case 3: function failed during execution
503
534
  # NOTE: the msg_obj associated with the "Running " message is the prior assistant message, not the function/tool role message
504
535
  # this is because the function/tool role message is only created once the function/tool has executed/returned
505
- self.interface.function_message(f"Running {function_name}({function_args})", msg_obj=messages[-1])
536
+ self.interface.function_message(f"Running {function_name}({function_args})", msg_obj=messages[-1], chunk_index=self.chunk_index)
537
+ self.chunk_index += 1
506
538
  try:
507
539
  # handle tool execution (sandbox) and state updates
508
540
  log_telemetry(
@@ -635,8 +667,10 @@ class Agent(BaseAgent):
635
667
  group_id=group_id,
636
668
  )
637
669
  ) # extend conversation with function response
638
- self.interface.function_message(f"Ran {function_name}({function_args})", msg_obj=messages[-1])
639
- self.interface.function_message(f"Success: {function_response_string}", msg_obj=messages[-1])
670
+ self.interface.function_message(f"Ran {function_name}({function_args})", msg_obj=messages[-1], chunk_index=self.chunk_index)
671
+ self.chunk_index += 1
672
+ self.interface.function_message(f"Success: {function_response_string}", msg_obj=messages[-1], chunk_index=self.chunk_index)
673
+ self.chunk_index += 1
640
674
  self.last_function_response = function_response
641
675
 
642
676
  else:
@@ -652,7 +686,8 @@ class Agent(BaseAgent):
652
686
  group_id=group_id,
653
687
  )
654
688
  ) # extend conversation with assistant's reply
655
- self.interface.internal_monologue(response_message.content, msg_obj=messages[-1])
689
+ self.interface.internal_monologue(response_message.content, msg_obj=messages[-1], chunk_index=self.chunk_index)
690
+ self.chunk_index += 1
656
691
  heartbeat_request = False
657
692
  function_failed = False
658
693
 
@@ -1243,7 +1278,7 @@ class Agent(BaseAgent):
1243
1278
  callable_func = get_function_from_module(LETTA_MULTI_AGENT_TOOL_MODULE_NAME, function_name)
1244
1279
  function_args["self"] = self # need to attach self to arg since it's dynamically linked
1245
1280
  function_response = callable_func(**function_args)
1246
- elif target_letta_tool.tool_type == ToolType.LETTA_MEMORY_CORE:
1281
+ elif target_letta_tool.tool_type == ToolType.LETTA_MEMORY_CORE or target_letta_tool.tool_type == ToolType.LETTA_SLEEPTIME_CORE:
1247
1282
  callable_func = get_function_from_module(LETTA_CORE_TOOL_MODULE_NAME, function_name)
1248
1283
  agent_state_copy = self.agent_state.__deepcopy__()
1249
1284
  function_args["agent_state"] = agent_state_copy # need to attach self to arg since it's dynamically linked
@@ -1,9 +1,10 @@
1
1
  from abc import ABC, abstractmethod
2
- from typing import Any, AsyncGenerator, Optional
2
+ from typing import Any, AsyncGenerator, Optional, Union
3
3
 
4
4
  import openai
5
5
 
6
- from letta.schemas.letta_message import UserMessage
6
+ from letta.schemas.enums import MessageStreamStatus
7
+ from letta.schemas.letta_message import LegacyLettaMessage, LettaMessage, UserMessage
7
8
  from letta.schemas.letta_response import LettaResponse
8
9
  from letta.schemas.user import User
9
10
  from letta.services.agent_manager import AgentManager
@@ -39,9 +40,11 @@ class BaseAgent(ABC):
39
40
  raise NotImplementedError
40
41
 
41
42
  @abstractmethod
42
- async def step_stream(self, input_message: UserMessage, max_steps: int = 10) -> AsyncGenerator[str, None]:
43
+ async def step_stream(
44
+ self, input_message: UserMessage, max_steps: int = 10
45
+ ) -> AsyncGenerator[Union[LettaMessage, LegacyLettaMessage, MessageStreamStatus], None]:
43
46
  """
44
- Main async execution loop for the agent. Implementations must yield messages as SSE events.
47
+ Main streaming execution loop for the agent.
45
48
  """
46
49
  raise NotImplementedError
47
50
 
@@ -0,0 +1,52 @@
1
+ from typing import Dict, List, Tuple
2
+
3
+ from letta.schemas.agent import AgentState
4
+ from letta.schemas.letta_response import LettaResponse
5
+ from letta.schemas.message import Message
6
+ from letta.schemas.usage import LettaUsageStatistics
7
+ from letta.schemas.user import User
8
+ from letta.server.rest_api.utils import create_user_message
9
+ from letta.services.message_manager import MessageManager
10
+
11
+
12
+ def _create_letta_response(new_in_context_messages: list[Message], use_assistant_message: bool) -> LettaResponse:
13
+ """
14
+ Converts the newly created/persisted messages into a LettaResponse.
15
+ """
16
+ response_messages = []
17
+ for msg in new_in_context_messages:
18
+ response_messages.extend(msg.to_letta_message(use_assistant_message=use_assistant_message))
19
+ return LettaResponse(messages=response_messages, usage=LettaUsageStatistics())
20
+
21
+
22
+ def _prepare_in_context_messages(
23
+ input_message: Dict, agent_state: AgentState, message_manager: MessageManager, actor: User
24
+ ) -> Tuple[List[Message], List[Message]]:
25
+ """
26
+ Prepares in-context messages for an agent, based on the current state and a new user input.
27
+
28
+ Args:
29
+ input_message (Dict): The new user input message to process.
30
+ agent_state (AgentState): The current state of the agent, including message buffer config.
31
+ message_manager (MessageManager): The manager used to retrieve and create messages.
32
+ actor (User): The user performing the action, used for access control and attribution.
33
+
34
+ Returns:
35
+ Tuple[List[Message], List[Message]]: A tuple containing:
36
+ - The current in-context messages (existing context for the agent).
37
+ - The new in-context messages (messages created from the new input).
38
+ """
39
+
40
+ if agent_state.message_buffer_autoclear:
41
+ # If autoclear is enabled, only include the most recent system message (usually at index 0)
42
+ current_in_context_messages = [message_manager.get_messages_by_ids(message_ids=agent_state.message_ids, actor=actor)[0]]
43
+ else:
44
+ # Otherwise, include the full list of messages by ID for context
45
+ current_in_context_messages = message_manager.get_messages_by_ids(message_ids=agent_state.message_ids, actor=actor)
46
+
47
+ # Create a new user message from the input and store it
48
+ new_in_context_messages = message_manager.create_many_messages(
49
+ [create_user_message(input_message=input_message, agent_id=agent_state.id, actor=actor)], actor=actor
50
+ )
51
+
52
+ return current_in_context_messages, new_in_context_messages
@@ -1,27 +1,32 @@
1
1
  import asyncio
2
2
  import json
3
3
  import uuid
4
- from typing import Any, AsyncGenerator, Dict, List, Tuple
4
+ from typing import Any, AsyncGenerator, Dict, List, Optional, Tuple, Union
5
5
 
6
6
  from openai import AsyncStream
7
7
  from openai.types.chat import ChatCompletion, ChatCompletionChunk
8
8
 
9
9
  from letta.agents.base_agent import BaseAgent
10
- from letta.constants import DEFAULT_MESSAGE_TOOL
10
+ from letta.agents.helpers import _create_letta_response, _prepare_in_context_messages
11
11
  from letta.helpers import ToolRulesSolver
12
12
  from letta.helpers.datetime_helpers import get_utc_time
13
13
  from letta.helpers.tool_execution_helper import enable_strict_mode
14
+ from letta.interfaces.anthropic_streaming_interface import AnthropicStreamingInterface
14
15
  from letta.llm_api.llm_client import LLMClient
16
+ from letta.llm_api.llm_client_base import LLMClientBase
17
+ from letta.local_llm.constants import INNER_THOUGHTS_KWARG
15
18
  from letta.log import get_logger
16
19
  from letta.orm.enums import ToolType
17
20
  from letta.schemas.agent import AgentState
21
+ from letta.schemas.enums import MessageStreamStatus
18
22
  from letta.schemas.letta_message import AssistantMessage
23
+ from letta.schemas.letta_message_content import OmittedReasoningContent, ReasoningContent, RedactedReasoningContent, TextContent
19
24
  from letta.schemas.letta_response import LettaResponse
20
25
  from letta.schemas.message import Message, MessageUpdate
21
26
  from letta.schemas.openai.chat_completion_request import UserMessage
22
- from letta.schemas.usage import LettaUsageStatistics
27
+ from letta.schemas.openai.chat_completion_response import ToolCall
23
28
  from letta.schemas.user import User
24
- from letta.server.rest_api.utils import create_tool_call_messages_from_openai_response, create_user_message
29
+ from letta.server.rest_api.utils import create_letta_messages_from_llm_response
25
30
  from letta.services.agent_manager import AgentManager
26
31
  from letta.services.block_manager import BlockManager
27
32
  from letta.services.helpers.agent_manager_helper import compile_system_message
@@ -58,76 +63,130 @@ class LettaAgent(BaseAgent):
58
63
  async def step(self, input_message: UserMessage, max_steps: int = 10) -> LettaResponse:
59
64
  input_message = self.pre_process_input_message(input_message)
60
65
  agent_state = self.agent_manager.get_agent_by_id(self.agent_id, actor=self.actor)
61
- # TODO: Extend to beyond just system message
62
- system_message = [self.message_manager.get_messages_by_ids(message_ids=agent_state.message_ids, actor=self.actor)[0]]
63
- persisted_letta_messages = self.message_manager.create_many_messages(
64
- [create_user_message(input_message=input_message, agent_id=agent_state.id, actor=self.actor)], actor=self.actor
66
+ current_in_context_messages, new_in_context_messages = _prepare_in_context_messages(
67
+ input_message, agent_state, self.message_manager, self.actor
65
68
  )
66
69
  tool_rules_solver = ToolRulesSolver(agent_state.tool_rules)
67
-
68
- # TODO: Note that we do absolutely 0 pulling in of in-context messages here
69
- # TODO: This is specific to B, and needs to be changed
70
+ llm_client = LLMClient.create(
71
+ llm_config=agent_state.llm_config,
72
+ put_inner_thoughts_first=True,
73
+ )
70
74
  for step in range(max_steps):
71
75
  response = await self._get_ai_reply(
72
- in_context_messages=system_message + persisted_letta_messages,
76
+ llm_client=llm_client,
77
+ in_context_messages=current_in_context_messages + new_in_context_messages,
73
78
  agent_state=agent_state,
74
79
  tool_rules_solver=tool_rules_solver,
80
+ stream=False,
75
81
  )
76
- persisted_messages, should_continue = await self._handle_ai_response(response, agent_state, tool_rules_solver)
77
- persisted_letta_messages.extend(persisted_messages)
82
+
83
+ tool_call = response.choices[0].message.tool_calls[0]
84
+ persisted_messages, should_continue = await self._handle_ai_response(tool_call, agent_state, tool_rules_solver)
85
+ new_in_context_messages.extend(persisted_messages)
78
86
 
79
87
  if not should_continue:
80
88
  break
81
89
 
82
- # Persist messages
83
- # Translate to letta response messages
84
- response_messages = []
85
- for message in persisted_letta_messages:
86
- response_messages += message.to_letta_message(use_assistant_message=self.use_assistant_message)
90
+ # Extend the in context message ids
91
+ if not agent_state.message_buffer_autoclear:
92
+ message_ids = [m.id for m in (current_in_context_messages + new_in_context_messages)]
93
+ self.agent_manager.set_in_context_messages(agent_id=self.agent_id, message_ids=message_ids, actor=self.actor)
87
94
 
88
- return LettaResponse(
89
- messages=response_messages,
90
- # TODO: Actually populate this
91
- usage=LettaUsageStatistics(),
92
- )
95
+ return _create_letta_response(new_in_context_messages=new_in_context_messages, use_assistant_message=self.use_assistant_message)
93
96
 
94
- async def step_stream(self, input_message: UserMessage, max_steps: int = 10) -> AsyncGenerator[str, None]:
97
+ @trace_method
98
+ async def step_stream(
99
+ self, input_message: UserMessage, max_steps: int = 10, use_assistant_message: bool = False
100
+ ) -> AsyncGenerator[str, None]:
95
101
  """
96
102
  Main streaming loop that yields partial tokens.
97
103
  Whenever we detect a tool call, we yield from _handle_ai_response as well.
98
104
  """
99
- raise NotImplementedError("Not implemented for letta agent")
105
+ input_message = self.pre_process_input_message(input_message)
106
+ agent_state = self.agent_manager.get_agent_by_id(self.agent_id, actor=self.actor)
107
+ current_in_context_messages, new_in_context_messages = _prepare_in_context_messages(
108
+ input_message, agent_state, self.message_manager, self.actor
109
+ )
110
+ tool_rules_solver = ToolRulesSolver(agent_state.tool_rules)
111
+ llm_client = LLMClient.create(
112
+ llm_config=agent_state.llm_config,
113
+ put_inner_thoughts_first=True,
114
+ )
115
+
116
+ for step in range(max_steps):
117
+ stream = await self._get_ai_reply(
118
+ llm_client=llm_client,
119
+ in_context_messages=current_in_context_messages + new_in_context_messages,
120
+ agent_state=agent_state,
121
+ tool_rules_solver=tool_rules_solver,
122
+ stream=True,
123
+ )
124
+
125
+ # TODO: THIS IS INCREDIBLY UGLY
126
+ # TODO: THERE ARE MULTIPLE COPIES OF THE LLM_CONFIG EVERYWHERE THAT ARE GETTING MANIPULATED
127
+ interface = AnthropicStreamingInterface(
128
+ use_assistant_message=use_assistant_message, put_inner_thoughts_in_kwarg=llm_client.llm_config.put_inner_thoughts_in_kwargs
129
+ )
130
+ async for chunk in interface.process(stream):
131
+ yield f"data: {chunk.model_dump_json()}\n\n"
132
+
133
+ # Process resulting stream content
134
+ tool_call = interface.get_tool_call_object()
135
+ reasoning_content = interface.get_reasoning_content()
136
+ persisted_messages, should_continue = await self._handle_ai_response(
137
+ tool_call,
138
+ agent_state,
139
+ tool_rules_solver,
140
+ reasoning_content=reasoning_content,
141
+ pre_computed_assistant_message_id=interface.letta_assistant_message_id,
142
+ pre_computed_tool_message_id=interface.letta_tool_message_id,
143
+ )
144
+ new_in_context_messages.extend(persisted_messages)
145
+
146
+ if not should_continue:
147
+ break
148
+
149
+ # Extend the in context message ids
150
+ if not agent_state.message_buffer_autoclear:
151
+ message_ids = [m.id for m in (current_in_context_messages + new_in_context_messages)]
152
+ self.agent_manager.set_in_context_messages(agent_id=self.agent_id, message_ids=message_ids, actor=self.actor)
153
+
154
+ # TODO: Also yield out a letta usage stats SSE
155
+
156
+ yield f"data: {MessageStreamStatus.done.model_dump_json()}\n\n"
100
157
 
101
158
  @trace_method
102
159
  async def _get_ai_reply(
103
160
  self,
161
+ llm_client: LLMClientBase,
104
162
  in_context_messages: List[Message],
105
163
  agent_state: AgentState,
106
164
  tool_rules_solver: ToolRulesSolver,
165
+ stream: bool,
107
166
  ) -> ChatCompletion | AsyncStream[ChatCompletionChunk]:
108
167
  in_context_messages = self._rebuild_memory(in_context_messages, agent_state)
109
168
 
110
169
  tools = [
111
170
  t
112
171
  for t in agent_state.tools
113
- if t.tool_type in {ToolType.CUSTOM}
114
- or (t.tool_type == ToolType.LETTA_CORE and t.name == DEFAULT_MESSAGE_TOOL)
172
+ if t.tool_type in {ToolType.CUSTOM, ToolType.LETTA_CORE, ToolType.LETTA_MEMORY_CORE}
115
173
  or (t.tool_type == ToolType.LETTA_MULTI_AGENT_CORE and t.name == "send_message_to_agents_matching_tags")
116
174
  ]
117
175
 
118
- valid_tool_names = set(tool_rules_solver.get_allowed_tool_names(available_tools=set([t.name for t in tools])))
119
- allowed_tools = [enable_strict_mode(t.json_schema) for t in tools if t.name in valid_tool_names]
176
+ valid_tool_names = tool_rules_solver.get_allowed_tool_names(available_tools=set([t.name for t in tools]))
177
+ # TODO: Copied from legacy agent loop, so please be cautious
178
+ # Set force tool
179
+ force_tool_call = None
180
+ if len(valid_tool_names) == 1:
181
+ force_tool_call = valid_tool_names[0]
120
182
 
121
- llm_client = LLMClient.create(
122
- llm_config=agent_state.llm_config,
123
- put_inner_thoughts_first=True,
124
- )
183
+ allowed_tools = [enable_strict_mode(t.json_schema) for t in tools if t.name in set(valid_tool_names)]
125
184
 
126
185
  response = await llm_client.send_llm_request_async(
127
186
  messages=in_context_messages,
128
187
  tools=allowed_tools,
129
- tool_call=None,
130
- stream=False,
188
+ force_tool_call=force_tool_call,
189
+ stream=stream,
131
190
  )
132
191
 
133
192
  return response
@@ -135,19 +194,18 @@ class LettaAgent(BaseAgent):
135
194
  @trace_method
136
195
  async def _handle_ai_response(
137
196
  self,
138
- chat_completion_response: ChatCompletion,
197
+ tool_call: ToolCall,
139
198
  agent_state: AgentState,
140
199
  tool_rules_solver: ToolRulesSolver,
200
+ reasoning_content: Optional[List[Union[TextContent, ReasoningContent, RedactedReasoningContent, OmittedReasoningContent]]] = None,
201
+ pre_computed_assistant_message_id: Optional[str] = None,
202
+ pre_computed_tool_message_id: Optional[str] = None,
141
203
  ) -> Tuple[List[Message], bool]:
142
204
  """
143
205
  Now that streaming is done, handle the final AI response.
144
206
  This might yield additional SSE tokens if we do stalling.
145
207
  At the end, set self._continue_execution accordingly.
146
208
  """
147
- # TODO: Some key assumptions here.
148
- # TODO: Assume every call has a tool call, i.e. tool_choice is REQUIRED
149
- tool_call = chat_completion_response.choices[0].message.tool_calls[0]
150
-
151
209
  tool_call_name = tool_call.function.name
152
210
  tool_call_args_str = tool_call.function.arguments
153
211
 
@@ -158,6 +216,8 @@ class LettaAgent(BaseAgent):
158
216
 
159
217
  # Get request heartbeats and coerce to bool
160
218
  request_heartbeat = tool_args.pop("request_heartbeat", False)
219
+ # Pre-emptively pop out inner_thoughts
220
+ tool_args.pop(INNER_THOUGHTS_KWARG, "")
161
221
 
162
222
  # So this is necessary, because sometimes non-structured outputs makes mistakes
163
223
  if not isinstance(request_heartbeat, bool):
@@ -186,7 +246,7 @@ class LettaAgent(BaseAgent):
186
246
  continue_stepping = True
187
247
 
188
248
  # 5. Persist to DB
189
- tool_call_messages = create_tool_call_messages_from_openai_response(
249
+ tool_call_messages = create_letta_messages_from_llm_response(
190
250
  agent_id=agent_state.id,
191
251
  model=agent_state.llm_config.model,
192
252
  function_name=tool_call_name,
@@ -196,6 +256,9 @@ class LettaAgent(BaseAgent):
196
256
  function_response=tool_result,
197
257
  actor=self.actor,
198
258
  add_heartbeat_request_system_message=continue_stepping,
259
+ reasoning_content=reasoning_content,
260
+ pre_computed_assistant_message_id=pre_computed_assistant_message_id,
261
+ pre_computed_tool_message_id=pre_computed_tool_message_id,
199
262
  )
200
263
  persisted_messages = self.message_manager.create_many_messages(tool_call_messages, actor=self.actor)
201
264
 
@@ -34,7 +34,7 @@ from letta.schemas.user import User
34
34
  from letta.server.rest_api.utils import (
35
35
  convert_letta_messages_to_openai,
36
36
  create_assistant_messages_from_openai_response,
37
- create_tool_call_messages_from_openai_response,
37
+ create_letta_messages_from_llm_response,
38
38
  create_user_message,
39
39
  )
40
40
  from letta.services.agent_manager import AgentManager
@@ -207,7 +207,7 @@ class VoiceAgent(BaseAgent):
207
207
  in_memory_message_history.append(heartbeat_user_message.model_dump())
208
208
 
209
209
  # 5. Also store in DB
210
- tool_call_messages = create_tool_call_messages_from_openai_response(
210
+ tool_call_messages = create_letta_messages_from_llm_response(
211
211
  agent_id=agent_state.id,
212
212
  model=agent_state.llm_config.model,
213
213
  function_name=tool_call_name,
@@ -52,10 +52,22 @@ DEFAULT_PRESET = "memgpt_chat"
52
52
  BASE_TOOLS = ["send_message", "conversation_search", "archival_memory_insert", "archival_memory_search"]
53
53
  # Base memory tools CAN be edited, and are added by default by the server
54
54
  BASE_MEMORY_TOOLS = ["core_memory_append", "core_memory_replace"]
55
+ # Base tools if the memgpt agent has enable_sleeptime on
56
+ BASE_SLEEPTIME_CHAT_TOOLS = ["send_message", "conversation_search", "archival_memory_search"]
57
+ # Base memory tools for sleeptime agent
58
+ BASE_SLEEPTIME_TOOLS = [
59
+ "rethink_memory",
60
+ "finish_rethinking_memory",
61
+ "view_core_memory_with_line_numbers",
62
+ "core_memory_insert",
63
+ "archival_memory_insert",
64
+ "archival_memory_search",
65
+ "conversation_search",
66
+ ]
55
67
  # Multi agent tools
56
68
  MULTI_AGENT_TOOLS = ["send_message_to_agent_and_wait_for_reply", "send_message_to_agents_matching_tags", "send_message_to_agent_async"]
57
69
  # Set of all built-in Letta tools
58
- LETTA_TOOL_SET = set(BASE_TOOLS + BASE_MEMORY_TOOLS + MULTI_AGENT_TOOLS)
70
+ LETTA_TOOL_SET = set(BASE_TOOLS + BASE_MEMORY_TOOLS + MULTI_AGENT_TOOLS + BASE_SLEEPTIME_TOOLS)
59
71
 
60
72
  # The name of the tool used to send message to the user
61
73
  # May not be relevant in cases where the agent has multiple ways to message to user (send_imessage, send_discord_mesasge, ...)
@@ -1,6 +1,6 @@
1
1
  import json
2
2
  from enum import Enum
3
- from typing import TYPE_CHECKING, List, Optional, Union
3
+ from typing import TYPE_CHECKING, Dict, List, Optional, Union
4
4
 
5
5
  # Avoid circular imports
6
6
  if TYPE_CHECKING:
@@ -10,6 +10,10 @@ if TYPE_CHECKING:
10
10
  class ErrorCode(Enum):
11
11
  """Enum for error codes used by client."""
12
12
 
13
+ NOT_FOUND = "NOT_FOUND"
14
+ UNAUTHENTICATED = "UNAUTHENTICATED"
15
+ PERMISSION_DENIED = "PERMISSION_DENIED"
16
+ INVALID_ARGUMENT = "INVALID_ARGUMENT"
13
17
  INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"
14
18
  CONTEXT_WINDOW_EXCEEDED = "CONTEXT_WINDOW_EXCEEDED"
15
19
  RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED"
@@ -18,7 +22,9 @@ class ErrorCode(Enum):
18
22
  class LettaError(Exception):
19
23
  """Base class for all Letta related errors."""
20
24
 
21
- def __init__(self, message: str, code: Optional[ErrorCode] = None, details: dict = {}):
25
+ def __init__(self, message: str, code: Optional[ErrorCode] = None, details: Optional[Union[Dict, str, object]] = None):
26
+ if details is None:
27
+ details = {}
22
28
  self.message = message
23
29
  self.code = code
24
30
  self.details = details
@@ -91,7 +97,8 @@ class LLMUnprocessableEntityError(LLMError):
91
97
 
92
98
 
93
99
  class LLMServerError(LLMError):
94
- """Error when LLM service encounters an internal error"""
100
+ """Error indicating an internal server error occurred within the LLM service itself
101
+ while processing the request."""
95
102
 
96
103
 
97
104
  class BedrockPermissionError(LettaError):
@@ -164,3 +164,68 @@ def core_memory_replace(agent_state: "AgentState", label: str, old_content: str,
164
164
  new_value = current_value.replace(str(old_content), str(new_content))
165
165
  agent_state.memory.update_block_value(label=label, value=new_value)
166
166
  return None
167
+
168
+
169
+ def rethink_memory(agent_state: "AgentState", new_memory: str, target_block_label: str) -> None:
170
+ """
171
+ Rewrite memory block for the main agent, new_memory should contain all current information from the block that is not outdated or inconsistent, integrating any new information, resulting in a new memory block that is organized, readable, and comprehensive.
172
+
173
+ Args:
174
+ new_memory (str): The new memory with information integrated from the memory block. If there is no new information, then this should be the same as the content in the source block.
175
+ target_block_label (str): The name of the block to write to.
176
+
177
+ Returns:
178
+ None: None is always returned as this function does not produce a response.
179
+ """
180
+
181
+ if agent_state.memory.get_block(target_block_label) is None:
182
+ agent_state.memory.create_block(label=target_block_label, value=new_memory)
183
+
184
+ agent_state.memory.update_block_value(label=target_block_label, value=new_memory)
185
+ return None
186
+
187
+
188
+ def finish_rethinking_memory(agent_state: "AgentState") -> None: # type: ignore
189
+ """
190
+ This function is called when the agent is done rethinking the memory.
191
+
192
+ Returns:
193
+ Optional[str]: None is always returned as this function does not produce a response.
194
+ """
195
+ return None
196
+
197
+
198
+ def view_core_memory_with_line_numbers(agent_state: "AgentState", target_block_label: str) -> None: # type: ignore
199
+ """
200
+ View the contents of core memory in editor mode with line numbers. Called before `core_memory_insert` to see line numbers of memory block.
201
+
202
+ Args:
203
+ target_block_label (str): The name of the block to view.
204
+
205
+ Returns:
206
+ None: None is always returned as this function does not produce a response.
207
+ """
208
+ return None
209
+
210
+
211
+ def core_memory_insert(agent_state: "AgentState", target_block_label: str, new_memory: str, line_number: Optional[int] = None, replace: bool = False) -> None: # type: ignore
212
+ """
213
+ Insert new memory content into a core memory block at a specific line number. Call `view_core_memory_with_line_numbers` to see line numbers of the memory block before using this tool.
214
+
215
+ Args:
216
+ target_block_label (str): The name of the block to write to.
217
+ new_memory (str): The new memory content to insert.
218
+ line_number (Optional[int]): Line number to insert content into, 0 indexed (None for end of file).
219
+ replace (bool): Whether to overwrite the content at the specified line number.
220
+
221
+ Returns:
222
+ None: None is always returned as this function does not produce a response.
223
+ """
224
+ current_value = str(agent_state.memory.get_block(target_block_label).value)
225
+ current_value_list = current_value.split("\n")
226
+ if line_number is None:
227
+ line_number = len(current_value_list)
228
+ current_value_list.insert(line_number, new_memory)
229
+ new_value = "\n".join(current_value_list)
230
+ agent_state.memory.update_block_value(label=target_block_label, value=new_value)
231
+ return None