letta-nightly 0.6.36.dev20250305002337__tar.gz → 0.6.37.dev20250306002740__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 (280) hide show
  1. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/PKG-INFO +5 -5
  2. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/__init__.py +1 -1
  3. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/agent.py +48 -4
  4. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/helpers/converters.py +36 -0
  5. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/custom_columns.py +15 -0
  6. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/message.py +8 -3
  7. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/agent.py +0 -5
  8. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/message.py +19 -2
  9. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/serialize_schemas/agent.py +5 -1
  10. letta_nightly-0.6.37.dev20250306002740/letta/serialize_schemas/agent_environment_variable.py +21 -0
  11. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/serialize_schemas/base.py +14 -3
  12. letta_nightly-0.6.37.dev20250306002740/letta/serialize_schemas/tag.py +18 -0
  13. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/app.py +3 -1
  14. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/interface.py +6 -2
  15. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/agents.py +63 -1
  16. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/agent_manager.py +21 -3
  17. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/settings.py +15 -7
  18. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/pyproject.toml +4 -4
  19. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/LICENSE +0 -0
  20. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/README.md +0 -0
  21. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/__main__.py +0 -0
  22. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/agents/__init__.py +0 -0
  23. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/agents/base_agent.py +0 -0
  24. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/agents/ephemeral_agent.py +0 -0
  25. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/agents/low_latency_agent.py +0 -0
  26. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/benchmark/benchmark.py +0 -0
  27. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/benchmark/constants.py +0 -0
  28. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/cli/cli.py +0 -0
  29. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/cli/cli_config.py +0 -0
  30. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/cli/cli_load.py +0 -0
  31. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/client/__init__.py +0 -0
  32. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/client/client.py +0 -0
  33. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/client/streaming.py +0 -0
  34. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/client/utils.py +0 -0
  35. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/config.py +0 -0
  36. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/constants.py +0 -0
  37. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/data_sources/connectors.py +0 -0
  38. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/data_sources/connectors_helper.py +0 -0
  39. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/embeddings.py +0 -0
  40. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/errors.py +0 -0
  41. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/functions/__init__.py +0 -0
  42. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/functions/ast_parsers.py +0 -0
  43. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/functions/function_sets/base.py +0 -0
  44. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/functions/function_sets/extras.py +0 -0
  45. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/functions/function_sets/multi_agent.py +0 -0
  46. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/functions/functions.py +0 -0
  47. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/functions/helpers.py +0 -0
  48. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/functions/interface.py +0 -0
  49. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/functions/schema_generator.py +0 -0
  50. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/helpers/__init__.py +0 -0
  51. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/helpers/composio_helpers.py +0 -0
  52. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/helpers/datetime_helpers.py +0 -0
  53. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/helpers/json_helpers.py +0 -0
  54. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/helpers/tool_execution_helper.py +0 -0
  55. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/helpers/tool_rule_solver.py +0 -0
  56. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/humans/__init__.py +0 -0
  57. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/humans/examples/basic.txt +0 -0
  58. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/humans/examples/cs_phd.txt +0 -0
  59. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/interface.py +0 -0
  60. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/interfaces/__init__.py +0 -0
  61. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/interfaces/openai_chat_completions_streaming_interface.py +0 -0
  62. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/interfaces/utils.py +0 -0
  63. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/__init__.py +0 -0
  64. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/anthropic.py +0 -0
  65. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/aws_bedrock.py +0 -0
  66. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/azure_openai.py +0 -0
  67. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/azure_openai_constants.py +0 -0
  68. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/cohere.py +0 -0
  69. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/deepseek.py +0 -0
  70. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/google_ai.py +0 -0
  71. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/google_constants.py +0 -0
  72. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/google_vertex.py +0 -0
  73. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/helpers.py +0 -0
  74. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/llm_api_tools.py +0 -0
  75. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/mistral.py +0 -0
  76. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/llm_api/openai.py +0 -0
  77. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/README.md +0 -0
  78. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/__init__.py +0 -0
  79. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/chat_completion_proxy.py +0 -0
  80. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/constants.py +0 -0
  81. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/function_parser.py +0 -0
  82. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/grammars/__init__.py +0 -0
  83. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
  84. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/grammars/json.gbnf +0 -0
  85. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
  86. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/json_parser.py +0 -0
  87. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/koboldcpp/api.py +0 -0
  88. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/koboldcpp/settings.py +0 -0
  89. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llamacpp/api.py +0 -0
  90. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llamacpp/settings.py +0 -0
  91. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
  92. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
  93. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
  94. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
  95. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
  96. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
  97. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
  98. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
  99. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
  100. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/lmstudio/api.py +0 -0
  101. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/lmstudio/settings.py +0 -0
  102. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/ollama/api.py +0 -0
  103. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/ollama/settings.py +0 -0
  104. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/settings/__init__.py +0 -0
  105. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
  106. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/settings/settings.py +0 -0
  107. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/settings/simple.py +0 -0
  108. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/utils.py +0 -0
  109. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/vllm/api.py +0 -0
  110. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/webui/api.py +0 -0
  111. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/webui/legacy_api.py +0 -0
  112. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/webui/legacy_settings.py +0 -0
  113. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/local_llm/webui/settings.py +0 -0
  114. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/log.py +0 -0
  115. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/main.py +0 -0
  116. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/memory.py +0 -0
  117. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/offline_memory_agent.py +0 -0
  118. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/openai_backcompat/__init__.py +0 -0
  119. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/openai_backcompat/openai_object.py +0 -0
  120. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/__all__.py +0 -0
  121. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/__init__.py +0 -0
  122. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/agent.py +0 -0
  123. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/agents_tags.py +0 -0
  124. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/base.py +0 -0
  125. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/block.py +0 -0
  126. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/blocks_agents.py +0 -0
  127. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/enums.py +0 -0
  128. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/errors.py +0 -0
  129. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/file.py +0 -0
  130. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/identities_agents.py +0 -0
  131. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/identity.py +0 -0
  132. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/job.py +0 -0
  133. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/job_messages.py +0 -0
  134. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/mixins.py +0 -0
  135. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/organization.py +0 -0
  136. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/passage.py +0 -0
  137. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/provider.py +0 -0
  138. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/sandbox_config.py +0 -0
  139. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/source.py +0 -0
  140. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/sources_agents.py +0 -0
  141. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/sqlalchemy_base.py +0 -0
  142. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/sqlite_functions.py +0 -0
  143. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/step.py +0 -0
  144. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/tool.py +0 -0
  145. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/tools_agents.py +0 -0
  146. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/orm/user.py +0 -0
  147. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/__init__.py +0 -0
  148. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/examples/anna_pa.txt +0 -0
  149. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/examples/google_search_persona.txt +0 -0
  150. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/examples/memgpt_doc.txt +0 -0
  151. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/examples/memgpt_starter.txt +0 -0
  152. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/examples/o1_persona.txt +0 -0
  153. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/examples/offline_memory_persona.txt +0 -0
  154. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/examples/sam.txt +0 -0
  155. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/examples/sam_pov.txt +0 -0
  156. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
  157. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/personas/examples/sqldb/test.db +0 -0
  158. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/__init__.py +0 -0
  159. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/gpt_summarize.py +0 -0
  160. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/gpt_system.py +0 -0
  161. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_base.txt +0 -0
  162. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_chat.txt +0 -0
  163. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
  164. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
  165. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_convo_only.txt +0 -0
  166. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_doc.txt +0 -0
  167. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
  168. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
  169. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_memory_only.txt +0 -0
  170. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
  171. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
  172. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
  173. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
  174. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/pytest.ini +0 -0
  175. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/block.py +0 -0
  176. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/embedding_config.py +0 -0
  177. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/embedding_config_overrides.py +0 -0
  178. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/enums.py +0 -0
  179. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/environment_variables.py +0 -0
  180. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/file.py +0 -0
  181. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/health.py +0 -0
  182. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/identity.py +0 -0
  183. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/job.py +0 -0
  184. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/letta_base.py +0 -0
  185. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/letta_message.py +0 -0
  186. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/letta_request.py +0 -0
  187. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/letta_response.py +0 -0
  188. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/llm_config.py +0 -0
  189. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/llm_config_overrides.py +0 -0
  190. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/memory.py +0 -0
  191. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/openai/chat_completion_request.py +0 -0
  192. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/openai/chat_completion_response.py +0 -0
  193. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/openai/chat_completions.py +0 -0
  194. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/openai/embedding_response.py +0 -0
  195. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/openai/openai.py +0 -0
  196. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/organization.py +0 -0
  197. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/passage.py +0 -0
  198. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/providers.py +0 -0
  199. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/run.py +0 -0
  200. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/sandbox_config.py +0 -0
  201. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/source.py +0 -0
  202. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/step.py +0 -0
  203. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/tool.py +0 -0
  204. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/tool_rule.py +0 -0
  205. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/usage.py +0 -0
  206. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/schemas/user.py +0 -0
  207. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/serialize_schemas/__init__.py +0 -0
  208. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/serialize_schemas/block.py +0 -0
  209. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/serialize_schemas/custom_fields.py +0 -0
  210. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/serialize_schemas/message.py +0 -0
  211. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/serialize_schemas/tool.py +0 -0
  212. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/__init__.py +0 -0
  213. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/constants.py +0 -0
  214. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/db.py +0 -0
  215. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/generate_openapi_schema.sh +0 -0
  216. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/__init__.py +0 -0
  217. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/auth/__init__.py +0 -0
  218. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/auth/index.py +0 -0
  219. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/auth_token.py +0 -0
  220. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/chat_completions_interface.py +0 -0
  221. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/optimistic_json_parser.py +0 -0
  222. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/__init__.py +0 -0
  223. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
  224. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
  225. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/__init__.py +0 -0
  226. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/blocks.py +0 -0
  227. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/health.py +0 -0
  228. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/identities.py +0 -0
  229. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/jobs.py +0 -0
  230. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/llms.py +0 -0
  231. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/organizations.py +0 -0
  232. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/providers.py +0 -0
  233. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/runs.py +0 -0
  234. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
  235. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/sources.py +0 -0
  236. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/steps.py +0 -0
  237. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/tags.py +0 -0
  238. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/tools.py +0 -0
  239. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/users.py +0 -0
  240. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/routers/v1/voice.py +0 -0
  241. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/static_files.py +0 -0
  242. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/rest_api/utils.py +0 -0
  243. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/server.py +0 -0
  244. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/startup.sh +0 -0
  245. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/static_files/assets/index-048c9598.js +0 -0
  246. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/static_files/assets/index-0e31b727.css +0 -0
  247. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/static_files/favicon.ico +0 -0
  248. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/static_files/index.html +0 -0
  249. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
  250. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/utils.py +0 -0
  251. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/ws_api/__init__.py +0 -0
  252. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/ws_api/example_client.py +0 -0
  253. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/ws_api/interface.py +0 -0
  254. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/ws_api/protocol.py +0 -0
  255. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/server/ws_api/server.py +0 -0
  256. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/__init__.py +0 -0
  257. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/block_manager.py +0 -0
  258. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/helpers/agent_manager_helper.py +0 -0
  259. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/helpers/tool_execution_helper.py +0 -0
  260. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/identity_manager.py +0 -0
  261. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/job_manager.py +0 -0
  262. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/message_manager.py +0 -0
  263. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/organization_manager.py +0 -0
  264. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/passage_manager.py +0 -0
  265. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/per_agent_lock_manager.py +0 -0
  266. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/provider_manager.py +0 -0
  267. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/sandbox_config_manager.py +0 -0
  268. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/source_manager.py +0 -0
  269. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/step_manager.py +0 -0
  270. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/summarizer/__init__.py +0 -0
  271. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/summarizer/enums.py +0 -0
  272. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/summarizer/summarizer.py +0 -0
  273. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/tool_execution_sandbox.py +0 -0
  274. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/tool_manager.py +0 -0
  275. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/services/user_manager.py +0 -0
  276. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/streaming_interface.py +0 -0
  277. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/streaming_utils.py +0 -0
  278. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/system.py +0 -0
  279. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/tracing.py +0 -0
  280. {letta_nightly-0.6.36.dev20250305002337 → letta_nightly-0.6.37.dev20250306002740}/letta/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-nightly
3
- Version: 0.6.36.dev20250305002337
3
+ Version: 0.6.37.dev20250306002740
4
4
  Summary: Create LLM agents with long-term memory and custom tools
5
5
  License: Apache License
6
6
  Author: Letta Team
@@ -25,7 +25,7 @@ Requires-Dist: alembic (>=1.13.3,<2.0.0)
25
25
  Requires-Dist: anthropic (>=0.43.0,<0.44.0)
26
26
  Requires-Dist: autoflake (>=2.3.0,<3.0.0) ; extra == "dev" or extra == "all"
27
27
  Requires-Dist: black[jupyter] (>=24.2.0,<25.0.0) ; extra == "dev" or extra == "all"
28
- Requires-Dist: boto3 (>=1.36.24,<2.0.0) ; extra == "bedrock" or extra == "all"
28
+ Requires-Dist: boto3 (>=1.36.24,<2.0.0) ; extra == "bedrock"
29
29
  Requires-Dist: brotli (>=1.1.0,<2.0.0)
30
30
  Requires-Dist: colorama (>=0.4.6,<0.5.0)
31
31
  Requires-Dist: composio-core (>=0.7.2,<0.8.0)
@@ -39,7 +39,7 @@ Requires-Dist: docx2txt (>=0.8,<0.9)
39
39
  Requires-Dist: e2b-code-interpreter (>=1.0.3,<2.0.0) ; extra == "cloud-tool-sandbox"
40
40
  Requires-Dist: faker (>=36.1.0,<37.0.0)
41
41
  Requires-Dist: fastapi (>=0.115.6,<0.116.0) ; extra == "server" or extra == "all"
42
- Requires-Dist: google-genai (>=1.1.0,<2.0.0) ; extra == "google" or extra == "all"
42
+ Requires-Dist: google-genai (>=1.1.0,<2.0.0) ; extra == "google"
43
43
  Requires-Dist: grpcio (>=1.68.1,<2.0.0)
44
44
  Requires-Dist: grpcio-tools (>=1.68.1,<2.0.0)
45
45
  Requires-Dist: html2text (>=2020.1.16,<2021.0.0)
@@ -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 == "all"
51
51
  Requires-Dist: langchain-community (>=0.3.7,<0.4.0) ; extra == "external-tools" or extra == "all"
52
- Requires-Dist: letta_client (>=0.1.23,<0.2.0)
52
+ Requires-Dist: letta_client (>=0.1.54,<0.2.0)
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 == "all"
@@ -89,7 +89,7 @@ Requires-Dist: sqlalchemy-json (>=0.7.0,<0.8.0)
89
89
  Requires-Dist: sqlalchemy-utils (>=0.41.2,<0.42.0)
90
90
  Requires-Dist: sqlmodel (>=0.0.16,<0.0.17)
91
91
  Requires-Dist: tqdm (>=4.66.1,<5.0.0)
92
- Requires-Dist: typer (>=0.12,<1.0)
92
+ Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
93
93
  Requires-Dist: uvicorn (>=0.24.0.post1,<0.25.0) ; extra == "server" or extra == "all"
94
94
  Requires-Dist: wikipedia (>=1.4.0,<2.0.0) ; extra == "external-tools" or extra == "tests" or extra == "all"
95
95
  Description-Content-Type: text/markdown
@@ -1,4 +1,4 @@
1
- __version__ = "0.6.36"
1
+ __version__ = "0.6.37"
2
2
 
3
3
  # import clients
4
4
  from letta.client.client import LocalClient, RESTClient, create_client
@@ -39,7 +39,7 @@ from letta.schemas.block import BlockUpdate
39
39
  from letta.schemas.embedding_config import EmbeddingConfig
40
40
  from letta.schemas.enums import MessageRole
41
41
  from letta.schemas.memory import ContextWindowOverview, Memory
42
- from letta.schemas.message import Message
42
+ from letta.schemas.message import Message, ToolReturn
43
43
  from letta.schemas.openai.chat_completion_response import ChatCompletionResponse
44
44
  from letta.schemas.openai.chat_completion_response import Message as ChatCompletionMessage
45
45
  from letta.schemas.openai.chat_completion_response import UsageStatistics
@@ -277,6 +277,7 @@ class Agent(BaseAgent):
277
277
  function_args: dict,
278
278
  function_response: str,
279
279
  messages: List[Message],
280
+ tool_returns: Optional[List[ToolReturn]] = None,
280
281
  include_function_failed_message: bool = False,
281
282
  ) -> List[Message]:
282
283
  """
@@ -298,6 +299,7 @@ class Agent(BaseAgent):
298
299
  "content": function_response,
299
300
  "tool_call_id": tool_call_id,
300
301
  },
302
+ tool_returns=tool_returns,
301
303
  )
302
304
  messages.append(new_message)
303
305
  self.interface.function_message(f"Error: {error_msg}", msg_obj=new_message)
@@ -561,8 +563,17 @@ class Agent(BaseAgent):
561
563
  )
562
564
 
563
565
  if sandbox_run_result and sandbox_run_result.status == "error":
566
+ tool_return = ToolReturn(
567
+ status=sandbox_run_result.status, stdout=sandbox_run_result.stdout, stderr=sandbox_run_result.stderr
568
+ )
564
569
  messages = self._handle_function_error_response(
565
- function_response, tool_call_id, function_name, function_args, function_response, messages
570
+ function_response,
571
+ tool_call_id,
572
+ function_name,
573
+ function_args,
574
+ function_response,
575
+ messages,
576
+ [tool_return],
566
577
  )
567
578
  return messages, False, True # force a heartbeat to allow agent to handle error
568
579
 
@@ -591,20 +602,52 @@ class Agent(BaseAgent):
591
602
  error_msg_user = f"{error_msg}\n{traceback.format_exc()}"
592
603
  self.logger.error(error_msg_user)
593
604
  messages = self._handle_function_error_response(
594
- error_msg, tool_call_id, function_name, function_args, function_response, messages, include_function_failed_message=True
605
+ error_msg,
606
+ tool_call_id,
607
+ function_name,
608
+ function_args,
609
+ function_response,
610
+ messages,
611
+ [ToolReturn(status="error", stderr=[error_msg_user])],
612
+ include_function_failed_message=True,
595
613
  )
596
614
  return messages, False, True # force a heartbeat to allow agent to handle error
597
615
 
598
616
  # Step 4: check if function response is an error
599
617
  if function_response_string.startswith(ERROR_MESSAGE_PREFIX):
600
618
  error_msg = function_response_string
619
+ tool_return = (
620
+ ToolReturn(
621
+ status=sandbox_run_result.status,
622
+ stdout=sandbox_run_result.stdout,
623
+ stderr=sandbox_run_result.stderr,
624
+ )
625
+ if sandbox_run_result
626
+ else None
627
+ )
601
628
  messages = self._handle_function_error_response(
602
- error_msg, tool_call_id, function_name, function_args, function_response, messages, include_function_failed_message=True
629
+ error_msg,
630
+ tool_call_id,
631
+ function_name,
632
+ function_args,
633
+ function_response,
634
+ messages,
635
+ [tool_return] if tool_return else None,
636
+ include_function_failed_message=True,
603
637
  )
604
638
  return messages, False, True # force a heartbeat to allow agent to handle error
605
639
 
606
640
  # If no failures happened along the way: ...
607
641
  # Step 5: send the info on the function call and function response to GPT
642
+ tool_return = (
643
+ ToolReturn(
644
+ status=sandbox_run_result.status,
645
+ stdout=sandbox_run_result.stdout,
646
+ stderr=sandbox_run_result.stderr,
647
+ )
648
+ if sandbox_run_result
649
+ else None
650
+ )
608
651
  messages.append(
609
652
  Message.dict_to_message(
610
653
  agent_id=self.agent_state.id,
@@ -616,6 +659,7 @@ class Agent(BaseAgent):
616
659
  "content": function_response,
617
660
  "tool_call_id": tool_call_id,
618
661
  },
662
+ tool_returns=[tool_return] if tool_return else None,
619
663
  )
620
664
  ) # extend conversation with function response
621
665
  self.interface.function_message(f"Ran {function_name}({function_args})", msg_obj=messages[-1])
@@ -9,6 +9,7 @@ from sqlalchemy import Dialect
9
9
  from letta.schemas.embedding_config import EmbeddingConfig
10
10
  from letta.schemas.enums import ToolRuleType
11
11
  from letta.schemas.llm_config import LLMConfig
12
+ from letta.schemas.message import ToolReturn
12
13
  from letta.schemas.tool_rule import ChildToolRule, ConditionalToolRule, ContinueToolRule, InitToolRule, TerminalToolRule, ToolRule
13
14
 
14
15
  # --------------------------
@@ -127,6 +128,41 @@ def deserialize_tool_calls(data: Optional[List[Dict]]) -> List[OpenAIToolCall]:
127
128
  return calls
128
129
 
129
130
 
131
+ # --------------------------
132
+ # ToolReturn Serialization
133
+ # --------------------------
134
+
135
+
136
+ def serialize_tool_returns(tool_returns: Optional[List[Union[ToolReturn, dict]]]) -> List[Dict]:
137
+ """Convert a list of ToolReturn objects into JSON-serializable format."""
138
+ if not tool_returns:
139
+ return []
140
+
141
+ serialized_tool_returns = []
142
+ for tool_return in tool_returns:
143
+ if isinstance(tool_return, ToolReturn):
144
+ serialized_tool_returns.append(tool_return.model_dump())
145
+ elif isinstance(tool_return, dict):
146
+ serialized_tool_returns.append(tool_return) # Already a dictionary, leave it as-is
147
+ else:
148
+ raise TypeError(f"Unexpected tool return type: {type(tool_return)}")
149
+
150
+ return serialized_tool_returns
151
+
152
+
153
+ def deserialize_tool_returns(data: Optional[List[Dict]]) -> List[ToolReturn]:
154
+ """Convert a JSON list back into ToolReturn objects."""
155
+ if not data:
156
+ return []
157
+
158
+ tool_returns = []
159
+ for item in data:
160
+ tool_return = ToolReturn(**item)
161
+ tool_returns.append(tool_return)
162
+
163
+ return tool_returns
164
+
165
+
130
166
  # --------------------------
131
167
  # Vector Serialization
132
168
  # --------------------------
@@ -5,11 +5,13 @@ from letta.helpers.converters import (
5
5
  deserialize_embedding_config,
6
6
  deserialize_llm_config,
7
7
  deserialize_tool_calls,
8
+ deserialize_tool_returns,
8
9
  deserialize_tool_rules,
9
10
  deserialize_vector,
10
11
  serialize_embedding_config,
11
12
  serialize_llm_config,
12
13
  serialize_tool_calls,
14
+ serialize_tool_returns,
13
15
  serialize_tool_rules,
14
16
  serialize_vector,
15
17
  )
@@ -67,6 +69,19 @@ class ToolCallColumn(TypeDecorator):
67
69
  return deserialize_tool_calls(value)
68
70
 
69
71
 
72
+ class ToolReturnColumn(TypeDecorator):
73
+ """Custom SQLAlchemy column type for storing the return value of a tool call as JSON."""
74
+
75
+ impl = JSON
76
+ cache_ok = True
77
+
78
+ def process_bind_param(self, value, dialect):
79
+ return serialize_tool_returns(value)
80
+
81
+ def process_result_value(self, value, dialect):
82
+ return deserialize_tool_returns(value)
83
+
84
+
70
85
  class CommonVector(TypeDecorator):
71
86
  """Custom SQLAlchemy column type for storing vectors in SQLite."""
72
87
 
@@ -1,14 +1,15 @@
1
- from typing import Optional
1
+ from typing import List, Optional
2
2
 
3
3
  from openai.types.chat.chat_completion_message_tool_call import ChatCompletionMessageToolCall as OpenAIToolCall
4
4
  from sqlalchemy import ForeignKey, Index
5
5
  from sqlalchemy.orm import Mapped, mapped_column, relationship
6
6
 
7
- from letta.orm.custom_columns import ToolCallColumn
7
+ from letta.orm.custom_columns import ToolCallColumn, ToolReturnColumn
8
8
  from letta.orm.mixins import AgentMixin, OrganizationMixin
9
9
  from letta.orm.sqlalchemy_base import SqlalchemyBase
10
10
  from letta.schemas.message import Message as PydanticMessage
11
11
  from letta.schemas.message import TextContent as PydanticTextContent
12
+ from letta.schemas.message import ToolReturn
12
13
 
13
14
 
14
15
  class Message(SqlalchemyBase, OrganizationMixin, AgentMixin):
@@ -26,11 +27,15 @@ class Message(SqlalchemyBase, OrganizationMixin, AgentMixin):
26
27
  text: Mapped[Optional[str]] = mapped_column(nullable=True, doc="Message content")
27
28
  model: Mapped[Optional[str]] = mapped_column(nullable=True, doc="LLM model used")
28
29
  name: Mapped[Optional[str]] = mapped_column(nullable=True, doc="Name for multi-agent scenarios")
29
- tool_calls: Mapped[OpenAIToolCall] = mapped_column(ToolCallColumn, doc="Tool call information")
30
+ tool_calls: Mapped[List[OpenAIToolCall]] = mapped_column(ToolCallColumn, doc="Tool call information")
30
31
  tool_call_id: Mapped[Optional[str]] = mapped_column(nullable=True, doc="ID of the tool call")
31
32
  step_id: Mapped[Optional[str]] = mapped_column(
32
33
  ForeignKey("steps.id", ondelete="SET NULL"), nullable=True, doc="ID of the step that this message belongs to"
33
34
  )
35
+ otid: Mapped[Optional[str]] = mapped_column(nullable=True, doc="The offline threading ID associated with this message")
36
+ tool_returns: Mapped[List[ToolReturn]] = mapped_column(
37
+ ToolReturnColumn, nullable=True, doc="Tool execution return information for prior tool calls"
38
+ )
34
39
 
35
40
  # Relationships
36
41
  agent: Mapped["Agent"] = relationship("Agent", back_populates="messages", lazy="selectin")
@@ -175,11 +175,6 @@ class CreateAgent(BaseModel, validate_assignment=True): #
175
175
  # don't check if not provided
176
176
  return name
177
177
 
178
- # TODO: this check should also be added to other model (e.g. User.name)
179
- # Length check
180
- if not (1 <= len(name) <= 50):
181
- raise ValueError("Name length must be between 1 and 50 characters.")
182
-
183
178
  # Regex for allowed characters (alphanumeric, spaces, hyphens, underscores)
184
179
  if not re.match("^[A-Za-z0-9 _-]+$", name):
185
180
  raise ValueError("Name contains invalid characters.")
@@ -124,9 +124,11 @@ class Message(BaseMessage):
124
124
  agent_id: Optional[str] = Field(None, description="The unique identifier of the agent.")
125
125
  model: Optional[str] = Field(None, description="The model used to make the function call.")
126
126
  name: Optional[str] = Field(None, description="The name of the participant.")
127
- tool_calls: Optional[List[OpenAIToolCall,]] = Field(None, description="The list of tool calls requested.")
127
+ tool_calls: Optional[List[OpenAIToolCall]] = Field(None, description="The list of tool calls requested.")
128
128
  tool_call_id: Optional[str] = Field(None, description="The id of the tool call.")
129
129
  step_id: Optional[str] = Field(None, description="The id of the step that this message was created in.")
130
+ otid: Optional[str] = Field(None, description="The offline threading id associated with this message")
131
+ tool_returns: Optional[List[ToolReturn]] = Field(None, description="Tool execution return information for prior tool calls")
130
132
 
131
133
  # This overrides the optional base orm schema, created_at MUST exist on all messages objects
132
134
  created_at: datetime = Field(default_factory=get_utc_time, description="The timestamp when the object was created.")
@@ -299,8 +301,10 @@ class Message(BaseMessage):
299
301
  id=self.id,
300
302
  date=self.created_at,
301
303
  tool_return=self.text,
302
- status=status_enum,
304
+ status=self.tool_returns[0].status if self.tool_returns else status_enum,
303
305
  tool_call_id=self.tool_call_id,
306
+ stdout=self.tool_returns[0].stdout if self.tool_returns else None,
307
+ stderr=self.tool_returns[0].stderr if self.tool_returns else None,
304
308
  )
305
309
  )
306
310
  elif self.role == MessageRole.user:
@@ -338,6 +342,7 @@ class Message(BaseMessage):
338
342
  allow_functions_style: bool = False, # allow deprecated functions style?
339
343
  created_at: Optional[datetime] = None,
340
344
  id: Optional[str] = None,
345
+ tool_returns: Optional[List[ToolReturn]] = None,
341
346
  ):
342
347
  """Convert a ChatCompletion message object into a Message object (synced to DB)"""
343
348
  if not created_at:
@@ -366,6 +371,7 @@ class Message(BaseMessage):
366
371
  tool_call_id=openai_message_dict["tool_call_id"] if "tool_call_id" in openai_message_dict else None,
367
372
  created_at=created_at,
368
373
  id=str(id),
374
+ tool_returns=tool_returns,
369
375
  )
370
376
  else:
371
377
  return Message(
@@ -378,6 +384,7 @@ class Message(BaseMessage):
378
384
  tool_calls=openai_message_dict["tool_calls"] if "tool_calls" in openai_message_dict else None,
379
385
  tool_call_id=openai_message_dict["tool_call_id"] if "tool_call_id" in openai_message_dict else None,
380
386
  created_at=created_at,
387
+ tool_returns=tool_returns,
381
388
  )
382
389
 
383
390
  elif "function_call" in openai_message_dict and openai_message_dict["function_call"] is not None:
@@ -411,6 +418,7 @@ class Message(BaseMessage):
411
418
  tool_call_id=None, # NOTE: None, since this field is only non-null for role=='tool'
412
419
  created_at=created_at,
413
420
  id=str(id),
421
+ tool_returns=tool_returns,
414
422
  )
415
423
  else:
416
424
  return Message(
@@ -423,6 +431,7 @@ class Message(BaseMessage):
423
431
  tool_calls=tool_calls,
424
432
  tool_call_id=None, # NOTE: None, since this field is only non-null for role=='tool'
425
433
  created_at=created_at,
434
+ tool_returns=tool_returns,
426
435
  )
427
436
 
428
437
  else:
@@ -456,6 +465,7 @@ class Message(BaseMessage):
456
465
  tool_call_id=openai_message_dict["tool_call_id"] if "tool_call_id" in openai_message_dict else None,
457
466
  created_at=created_at,
458
467
  id=str(id),
468
+ tool_returns=tool_returns,
459
469
  )
460
470
  else:
461
471
  return Message(
@@ -468,6 +478,7 @@ class Message(BaseMessage):
468
478
  tool_calls=tool_calls,
469
479
  tool_call_id=openai_message_dict["tool_call_id"] if "tool_call_id" in openai_message_dict else None,
470
480
  created_at=created_at,
481
+ tool_returns=tool_returns,
471
482
  )
472
483
 
473
484
  def to_openai_dict_search_results(self, max_tool_id_length: int = TOOL_CALL_ID_MAX_LEN) -> dict:
@@ -844,3 +855,9 @@ class Message(BaseMessage):
844
855
  raise ValueError(self.role)
845
856
 
846
857
  return cohere_message
858
+
859
+
860
+ class ToolReturn(BaseModel):
861
+ status: Literal["success", "error"] = Field(..., description="The status of the tool call")
862
+ stdout: Optional[List[str]] = Field(None, description="Captured stdout (e.g. prints, logs) from the tool invocation")
863
+ stderr: Optional[List[str]] = Field(None, description="Captured stderr from the tool invocation")
@@ -5,10 +5,12 @@ from marshmallow import fields, post_dump
5
5
  from letta.orm import Agent
6
6
  from letta.schemas.agent import AgentState as PydanticAgentState
7
7
  from letta.schemas.user import User
8
+ from letta.serialize_schemas.agent_environment_variable import SerializedAgentEnvironmentVariableSchema
8
9
  from letta.serialize_schemas.base import BaseSchema
9
10
  from letta.serialize_schemas.block import SerializedBlockSchema
10
11
  from letta.serialize_schemas.custom_fields import EmbeddingConfigField, LLMConfigField, ToolRulesField
11
12
  from letta.serialize_schemas.message import SerializedMessageSchema
13
+ from letta.serialize_schemas.tag import SerializedAgentTagSchema
12
14
  from letta.serialize_schemas.tool import SerializedToolSchema
13
15
  from letta.server.db import SessionLocal
14
16
 
@@ -28,6 +30,8 @@ class SerializedAgentSchema(BaseSchema):
28
30
  messages = fields.List(fields.Nested(SerializedMessageSchema))
29
31
  core_memory = fields.List(fields.Nested(SerializedBlockSchema))
30
32
  tools = fields.List(fields.Nested(SerializedToolSchema))
33
+ tool_exec_environment_variables = fields.List(fields.Nested(SerializedAgentEnvironmentVariableSchema))
34
+ tags = fields.List(fields.Nested(SerializedAgentTagSchema))
31
35
 
32
36
  def __init__(self, *args, session: SessionLocal, actor: User, **kwargs):
33
37
  super().__init__(*args, actor=actor, **kwargs)
@@ -66,4 +70,4 @@ class SerializedAgentSchema(BaseSchema):
66
70
  class Meta(BaseSchema.Meta):
67
71
  model = Agent
68
72
  # TODO: Serialize these as well...
69
- exclude = BaseSchema.Meta.exclude + ("sources", "tags", "source_passages", "agent_passages")
73
+ exclude = BaseSchema.Meta.exclude + ("sources", "source_passages", "agent_passages")
@@ -0,0 +1,21 @@
1
+ import uuid
2
+ from typing import Optional
3
+
4
+ from letta.orm.sandbox_config import AgentEnvironmentVariable
5
+ from letta.serialize_schemas.base import BaseSchema
6
+
7
+
8
+ class SerializedAgentEnvironmentVariableSchema(BaseSchema):
9
+ """
10
+ Marshmallow schema for serializing/deserializing AgentEnvironmentVariable objects.
11
+ """
12
+
13
+ __pydantic_model__ = None
14
+
15
+ def generate_id(self) -> Optional[str]:
16
+ # TODO: This is brittle and duplicated in orm/sandbox_config.py
17
+ return f"agent-env-{uuid.uuid4()}"
18
+
19
+ class Meta(BaseSchema.Meta):
20
+ model = AgentEnvironmentVariable
21
+ exclude = BaseSchema.Meta.exclude + ("agent",)
@@ -22,9 +22,20 @@ class BaseSchema(SQLAlchemyAutoSchema):
22
22
  super().__init__(*args, **kwargs)
23
23
  self.actor = actor
24
24
 
25
+ def generate_id(self) -> Optional[str]:
26
+ if self.__pydantic_model__:
27
+ return self.__pydantic_model__.generate_id()
28
+
29
+ return None
30
+
25
31
  @post_dump
26
- def sanitize_ids(self, data: Dict, **kwargs):
27
- data["id"] = self.__pydantic_model__.generate_id()
32
+ def sanitize_ids(self, data: Dict, **kwargs) -> Dict:
33
+ if self.Meta.model:
34
+ mapper = inspect(self.Meta.model)
35
+ if "id" in mapper.columns:
36
+ generated_id = self.generate_id()
37
+ if generated_id:
38
+ data["id"] = generated_id
28
39
 
29
40
  for sensitive_id in BaseSchema.sensitive_ids.union(BaseSchema.sensitive_relationships):
30
41
  if sensitive_id in data:
@@ -33,7 +44,7 @@ class BaseSchema(SQLAlchemyAutoSchema):
33
44
  return data
34
45
 
35
46
  @pre_load
36
- def regenerate_ids(self, data: Dict, **kwargs):
47
+ def regenerate_ids(self, data: Dict, **kwargs) -> Dict:
37
48
  if self.Meta.model:
38
49
  mapper = inspect(self.Meta.model)
39
50
  for sensitive_id in BaseSchema.sensitive_ids:
@@ -0,0 +1,18 @@
1
+ from marshmallow import fields
2
+
3
+ from letta.orm.agents_tags import AgentsTags
4
+ from letta.serialize_schemas.base import BaseSchema
5
+
6
+
7
+ class SerializedAgentTagSchema(BaseSchema):
8
+ """
9
+ Marshmallow schema for serializing/deserializing Agent Tags.
10
+ """
11
+
12
+ __pydantic_model__ = None
13
+
14
+ tag = fields.String(required=True)
15
+
16
+ class Meta(BaseSchema.Meta):
17
+ model = AgentsTags
18
+ exclude = BaseSchema.Meta.exclude + ("agent",)
@@ -235,12 +235,14 @@ def create_application() -> "FastAPI":
235
235
  endpoint = os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT")
236
236
  if endpoint:
237
237
  print(f"▶ Using OTLP tracing with endpoint: {endpoint}")
238
+ env_name_suffix = os.getenv("ENV_NAME")
239
+ service_name = f"letta-server-{env_name_suffix.lower()}" if env_name_suffix else "letta-server"
238
240
  from letta.tracing import setup_tracing
239
241
 
240
242
  setup_tracing(
241
243
  endpoint=endpoint,
242
244
  app=app,
243
- service_name="memgpt-server",
245
+ service_name=service_name,
244
246
  )
245
247
 
246
248
  for route in v1_routes:
@@ -1169,8 +1169,10 @@ class StreamingServerInterface(AgentChunkStreamingInterface):
1169
1169
  id=msg_obj.id,
1170
1170
  date=msg_obj.created_at,
1171
1171
  tool_return=msg,
1172
- status="success",
1172
+ status=msg_obj.tool_returns[0].status if msg_obj.tool_returns else "success",
1173
1173
  tool_call_id=msg_obj.tool_call_id,
1174
+ stdout=msg_obj.tool_returns[0].stdout if msg_obj.tool_returns else None,
1175
+ stderr=msg_obj.tool_returns[0].stderr if msg_obj.tool_returns else None,
1174
1176
  )
1175
1177
 
1176
1178
  elif msg.startswith("Error: "):
@@ -1181,8 +1183,10 @@ class StreamingServerInterface(AgentChunkStreamingInterface):
1181
1183
  id=msg_obj.id,
1182
1184
  date=msg_obj.created_at,
1183
1185
  tool_return=msg,
1184
- status="error",
1186
+ status=msg_obj.tool_returns[0].status if msg_obj.tool_returns else "error",
1185
1187
  tool_call_id=msg_obj.tool_call_id,
1188
+ stdout=msg_obj.tool_returns[0].stdout if msg_obj.tool_returns else None,
1189
+ stderr=msg_obj.tool_returns[0].stderr if msg_obj.tool_returns else None,
1186
1190
  )
1187
1191
 
1188
1192
  else:
@@ -1,10 +1,13 @@
1
+ import json
1
2
  import traceback
2
3
  from datetime import datetime
3
4
  from typing import Annotated, List, Optional
4
5
 
5
- from fastapi import APIRouter, BackgroundTasks, Body, Depends, Header, HTTPException, Query, status
6
+ from fastapi import APIRouter, BackgroundTasks, Body, Depends, File, Header, HTTPException, Query, UploadFile, status
6
7
  from fastapi.responses import JSONResponse
8
+ from marshmallow import ValidationError
7
9
  from pydantic import Field
10
+ from sqlalchemy.exc import IntegrityError, OperationalError
8
11
 
9
12
  from letta.constants import DEFAULT_MESSAGE_TOOL, DEFAULT_MESSAGE_TOOL_KWARG
10
13
  from letta.log import get_logger
@@ -88,6 +91,65 @@ def list_agents(
88
91
  return agents
89
92
 
90
93
 
94
+ @router.get("/{agent_id}/download", operation_id="download_agent_serialized")
95
+ def download_agent_serialized(
96
+ agent_id: str,
97
+ server: "SyncServer" = Depends(get_letta_server),
98
+ actor_id: Optional[str] = Header(None, alias="user_id"),
99
+ ):
100
+ """
101
+ Download the serialized JSON representation of an agent.
102
+ """
103
+ actor = server.user_manager.get_user_or_default(user_id=actor_id)
104
+
105
+ try:
106
+ serialized_agent = server.agent_manager.serialize(agent_id=agent_id, actor=actor)
107
+ return JSONResponse(content=serialized_agent, media_type="application/json")
108
+ except NoResultFound:
109
+ raise HTTPException(status_code=404, detail=f"Agent with id={agent_id} not found for user_id={actor.id}.")
110
+
111
+
112
+ @router.post("/upload", response_model=AgentState, operation_id="upload_agent_serialized")
113
+ async def upload_agent_serialized(
114
+ file: UploadFile = File(...),
115
+ server: "SyncServer" = Depends(get_letta_server),
116
+ actor_id: Optional[str] = Header(None, alias="user_id"),
117
+ append_copy_suffix: bool = Query(True, description='If set to True, appends "_copy" to the end of the agent name.'),
118
+ override_existing_tools: bool = Query(
119
+ True,
120
+ description="If set to True, existing tools can get their source code overwritten by the uploaded tool definitions. Note that Letta core tools can never be updated externally.",
121
+ ),
122
+ ):
123
+ """
124
+ Upload a serialized agent JSON file and recreate the agent in the system.
125
+ """
126
+ actor = server.user_manager.get_user_or_default(user_id=actor_id)
127
+
128
+ try:
129
+ serialized_data = await file.read()
130
+ agent_json = json.loads(serialized_data)
131
+ new_agent = server.agent_manager.deserialize(
132
+ serialized_agent=agent_json, actor=actor, append_copy_suffix=append_copy_suffix, override_existing_tools=override_existing_tools
133
+ )
134
+ return new_agent
135
+
136
+ except json.JSONDecodeError:
137
+ raise HTTPException(status_code=400, detail="Corrupted agent file format.")
138
+
139
+ except ValidationError as e:
140
+ raise HTTPException(status_code=422, detail=f"Invalid agent schema: {str(e)}")
141
+
142
+ except IntegrityError as e:
143
+ raise HTTPException(status_code=409, detail=f"Database integrity error: {str(e)}")
144
+
145
+ except OperationalError as e:
146
+ raise HTTPException(status_code=503, detail=f"Database connection error. Please try again later: {str(e)}")
147
+
148
+ except Exception:
149
+ traceback.print_exc()
150
+ raise HTTPException(status_code=500, detail="An unexpected error occurred while uploading the agent.")
151
+
152
+
91
153
  @router.get("/{agent_id}/context", response_model=ContextWindowOverview, operation_id="retrieve_agent_context_window")
92
154
  def retrieve_agent_context_window(
93
155
  agent_id: str,
@@ -15,6 +15,7 @@ from letta.orm import Identity as IdentityModel
15
15
  from letta.orm import Source as SourceModel
16
16
  from letta.orm import SourcePassage, SourcesAgents
17
17
  from letta.orm import Tool as ToolModel
18
+ from letta.orm.enums import ToolType
18
19
  from letta.orm.errors import NoResultFound
19
20
  from letta.orm.sandbox_config import AgentEnvironmentVariable as AgentEnvironmentVariableModel
20
21
  from letta.orm.sqlite_functions import adapt_array
@@ -399,13 +400,15 @@ class AgentManager:
399
400
  return schema.dump(agent)
400
401
 
401
402
  @enforce_types
402
- def deserialize(self, serialized_agent: dict, actor: PydanticUser, mark_as_copy: bool = True) -> PydanticAgentState:
403
+ def deserialize(
404
+ self, serialized_agent: dict, actor: PydanticUser, append_copy_suffix: bool = True, override_existing_tools: bool = True
405
+ ) -> PydanticAgentState:
403
406
  tool_data_list = serialized_agent.pop("tools", [])
404
407
 
405
408
  with self.session_maker() as session:
406
409
  schema = SerializedAgentSchema(session=session, actor=actor)
407
410
  agent = schema.load(serialized_agent, session=session)
408
- if mark_as_copy:
411
+ if append_copy_suffix:
409
412
  agent.name += "_copy"
410
413
  agent.create(session, actor=actor)
411
414
  pydantic_agent = agent.to_pydantic()
@@ -413,7 +416,20 @@ class AgentManager:
413
416
  # Need to do this separately as there's some fancy upsert logic that SqlAlchemy cannot handle
414
417
  for tool_data in tool_data_list:
415
418
  pydantic_tool = SerializedToolSchema(actor=actor).load(tool_data, transient=True).to_pydantic()
416
- pydantic_tool = self.tool_manager.create_or_update_tool(pydantic_tool, actor=actor)
419
+
420
+ existing_pydantic_tool = self.tool_manager.get_tool_by_name(pydantic_tool.name, actor=actor)
421
+ # If the tool exists
422
+ # AND EITHER:
423
+ # 1) override_existing_tools is set to False
424
+ # 2) existing_pydantic_tool is NOT any type of Letta core tool
425
+ if existing_pydantic_tool and (
426
+ existing_pydantic_tool.tool_type in {ToolType.LETTA_CORE, ToolType.LETTA_MULTI_AGENT_CORE, ToolType.LETTA_MEMORY_CORE}
427
+ or not override_existing_tools
428
+ ):
429
+ pydantic_tool = existing_pydantic_tool
430
+ else:
431
+ pydantic_tool = self.tool_manager.create_or_update_tool(pydantic_tool, actor=actor)
432
+
417
433
  pydantic_agent = self.attach_tool(agent_id=pydantic_agent.id, tool_id=pydantic_tool.id, actor=actor)
418
434
 
419
435
  return pydantic_agent
@@ -461,6 +477,8 @@ class AgentManager:
461
477
  value=value,
462
478
  agent_id=agent_id,
463
479
  organization_id=actor.organization_id,
480
+ created_by_id=actor.id,
481
+ last_updated_by_id=actor.id,
464
482
  )
465
483
  )
466
484