letta-nightly 0.6.7.dev20250106104119__tar.gz → 0.6.7.dev20250106211813__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 (232) hide show
  1. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/PKG-INFO +1 -1
  2. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/client/client.py +6 -10
  3. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/client/streaming.py +0 -1
  4. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/agent.py +9 -1
  5. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/organization.py +4 -0
  6. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/sandbox_config.py +22 -2
  7. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/agent.py +10 -0
  8. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/enums.py +2 -2
  9. letta_nightly-0.6.7.dev20250106211813/letta/schemas/environment_variables.py +62 -0
  10. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/letta_response.py +8 -7
  11. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/sandbox_config.py +0 -28
  12. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/interface.py +7 -7
  13. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/sandbox_configs.py +3 -3
  14. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/server.py +2 -1
  15. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/agent_manager.py +54 -0
  16. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/sandbox_config_manager.py +3 -3
  17. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/tool_execution_sandbox.py +5 -2
  18. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/pyproject.toml +1 -1
  19. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/LICENSE +0 -0
  20. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/README.md +0 -0
  21. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/__init__.py +0 -0
  22. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/__main__.py +0 -0
  23. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/agent.py +0 -0
  24. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/benchmark/benchmark.py +0 -0
  25. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/benchmark/constants.py +0 -0
  26. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/chat_only_agent.py +0 -0
  27. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/cli/cli.py +0 -0
  28. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/cli/cli_config.py +0 -0
  29. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/cli/cli_load.py +0 -0
  30. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/client/__init__.py +0 -0
  31. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/client/utils.py +0 -0
  32. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/config.py +0 -0
  33. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/constants.py +0 -0
  34. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/credentials.py +0 -0
  35. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/data_sources/connectors.py +0 -0
  36. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/data_sources/connectors_helper.py +0 -0
  37. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/embeddings.py +0 -0
  38. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/errors.py +0 -0
  39. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/functions/__init__.py +0 -0
  40. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/functions/function_sets/base.py +0 -0
  41. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/functions/function_sets/extras.py +0 -0
  42. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/functions/functions.py +0 -0
  43. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/functions/helpers.py +0 -0
  44. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/functions/schema_generator.py +0 -0
  45. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/helpers/__init__.py +0 -0
  46. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/helpers/tool_rule_solver.py +0 -0
  47. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/humans/__init__.py +0 -0
  48. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/humans/examples/basic.txt +0 -0
  49. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/humans/examples/cs_phd.txt +0 -0
  50. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/interface.py +0 -0
  51. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/llm_api/__init__.py +0 -0
  52. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/llm_api/anthropic.py +0 -0
  53. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/llm_api/azure_openai.py +0 -0
  54. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/llm_api/azure_openai_constants.py +0 -0
  55. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/llm_api/cohere.py +0 -0
  56. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/llm_api/google_ai.py +0 -0
  57. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/llm_api/helpers.py +0 -0
  58. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/llm_api/llm_api_tools.py +0 -0
  59. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/llm_api/mistral.py +0 -0
  60. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/llm_api/openai.py +0 -0
  61. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/README.md +0 -0
  62. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/__init__.py +0 -0
  63. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/chat_completion_proxy.py +0 -0
  64. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/constants.py +0 -0
  65. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/function_parser.py +0 -0
  66. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/grammars/__init__.py +0 -0
  67. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
  68. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/grammars/json.gbnf +0 -0
  69. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
  70. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/json_parser.py +0 -0
  71. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/koboldcpp/api.py +0 -0
  72. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/koboldcpp/settings.py +0 -0
  73. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llamacpp/api.py +0 -0
  74. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llamacpp/settings.py +0 -0
  75. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
  76. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
  77. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
  78. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
  79. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
  80. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
  81. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
  82. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
  83. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
  84. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/lmstudio/api.py +0 -0
  85. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/lmstudio/settings.py +0 -0
  86. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/ollama/api.py +0 -0
  87. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/ollama/settings.py +0 -0
  88. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/settings/__init__.py +0 -0
  89. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
  90. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/settings/settings.py +0 -0
  91. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/settings/simple.py +0 -0
  92. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/utils.py +0 -0
  93. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/vllm/api.py +0 -0
  94. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/webui/api.py +0 -0
  95. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/webui/legacy_api.py +0 -0
  96. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/webui/legacy_settings.py +0 -0
  97. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/local_llm/webui/settings.py +0 -0
  98. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/log.py +0 -0
  99. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/main.py +0 -0
  100. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/memory.py +0 -0
  101. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/o1_agent.py +0 -0
  102. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/offline_memory_agent.py +0 -0
  103. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/openai_backcompat/__init__.py +0 -0
  104. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/openai_backcompat/openai_object.py +0 -0
  105. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/__all__.py +0 -0
  106. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/__init__.py +0 -0
  107. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/agents_tags.py +0 -0
  108. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/base.py +0 -0
  109. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/block.py +0 -0
  110. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/blocks_agents.py +0 -0
  111. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/custom_columns.py +0 -0
  112. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/enums.py +0 -0
  113. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/errors.py +0 -0
  114. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/file.py +0 -0
  115. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/job.py +0 -0
  116. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/message.py +0 -0
  117. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/mixins.py +0 -0
  118. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/passage.py +0 -0
  119. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/source.py +0 -0
  120. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/sources_agents.py +0 -0
  121. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/sqlalchemy_base.py +0 -0
  122. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/sqlite_functions.py +0 -0
  123. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/tool.py +0 -0
  124. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/tools_agents.py +0 -0
  125. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/orm/user.py +0 -0
  126. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/__init__.py +0 -0
  127. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/examples/anna_pa.txt +0 -0
  128. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/examples/google_search_persona.txt +0 -0
  129. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/examples/memgpt_doc.txt +0 -0
  130. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/examples/memgpt_starter.txt +0 -0
  131. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/examples/o1_persona.txt +0 -0
  132. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/examples/offline_memory_persona.txt +0 -0
  133. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/examples/sam.txt +0 -0
  134. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/examples/sam_pov.txt +0 -0
  135. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
  136. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/personas/examples/sqldb/test.db +0 -0
  137. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/__init__.py +0 -0
  138. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/gpt_summarize.py +0 -0
  139. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/gpt_system.py +0 -0
  140. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_base.txt +0 -0
  141. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_chat.txt +0 -0
  142. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
  143. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
  144. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_convo_only.txt +0 -0
  145. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_doc.txt +0 -0
  146. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
  147. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
  148. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
  149. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
  150. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
  151. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
  152. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/providers.py +0 -0
  153. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/pytest.ini +0 -0
  154. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/block.py +0 -0
  155. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/embedding_config.py +0 -0
  156. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/file.py +0 -0
  157. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/health.py +0 -0
  158. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/job.py +0 -0
  159. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/letta_base.py +0 -0
  160. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/letta_message.py +0 -0
  161. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/letta_request.py +0 -0
  162. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/llm_config.py +0 -0
  163. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/memory.py +0 -0
  164. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/message.py +0 -0
  165. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/openai/chat_completion_request.py +0 -0
  166. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/openai/chat_completion_response.py +0 -0
  167. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/openai/chat_completions.py +0 -0
  168. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/openai/embedding_response.py +0 -0
  169. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/openai/openai.py +0 -0
  170. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/organization.py +0 -0
  171. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/passage.py +0 -0
  172. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/source.py +0 -0
  173. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/tool.py +0 -0
  174. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/tool_rule.py +0 -0
  175. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/usage.py +0 -0
  176. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/schemas/user.py +0 -0
  177. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/__init__.py +0 -0
  178. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/constants.py +0 -0
  179. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/generate_openapi_schema.sh +0 -0
  180. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/__init__.py +0 -0
  181. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/app.py +0 -0
  182. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/auth/__init__.py +0 -0
  183. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/auth/index.py +0 -0
  184. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/auth_token.py +0 -0
  185. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/__init__.py +0 -0
  186. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/openai/__init__.py +0 -0
  187. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
  188. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
  189. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
  190. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
  191. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
  192. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/__init__.py +0 -0
  193. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/agents.py +0 -0
  194. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/blocks.py +0 -0
  195. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/health.py +0 -0
  196. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/jobs.py +0 -0
  197. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/llms.py +0 -0
  198. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/organizations.py +0 -0
  199. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/sources.py +0 -0
  200. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/tools.py +0 -0
  201. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/routers/v1/users.py +0 -0
  202. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/static_files.py +0 -0
  203. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/rest_api/utils.py +0 -0
  204. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/startup.sh +0 -0
  205. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/static_files/assets/index-048c9598.js +0 -0
  206. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/static_files/assets/index-0e31b727.css +0 -0
  207. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/static_files/favicon.ico +0 -0
  208. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/static_files/index.html +0 -0
  209. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
  210. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/utils.py +0 -0
  211. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/ws_api/__init__.py +0 -0
  212. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/ws_api/example_client.py +0 -0
  213. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/ws_api/interface.py +0 -0
  214. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/ws_api/protocol.py +0 -0
  215. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/server/ws_api/server.py +0 -0
  216. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/__init__.py +0 -0
  217. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/block_manager.py +0 -0
  218. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/helpers/agent_manager_helper.py +0 -0
  219. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/job_manager.py +0 -0
  220. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/message_manager.py +0 -0
  221. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/organization_manager.py +0 -0
  222. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/passage_manager.py +0 -0
  223. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/per_agent_lock_manager.py +0 -0
  224. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/source_manager.py +0 -0
  225. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/tool_manager.py +0 -0
  226. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/tool_sandbox_env/.gitkeep +0 -0
  227. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/services/user_manager.py +0 -0
  228. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/settings.py +0 -0
  229. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/streaming_interface.py +0 -0
  230. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/streaming_utils.py +0 -0
  231. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/system.py +0 -0
  232. {letta_nightly-0.6.7.dev20250106104119 → letta_nightly-0.6.7.dev20250106211813}/letta/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-nightly
3
- Version: 0.6.7.dev20250106104119
3
+ Version: 0.6.7.dev20250106211813
4
4
  Summary: Create LLM agents with long-term memory and custom tools
5
5
  License: Apache License
6
6
  Author: Letta Team
@@ -15,6 +15,11 @@ from letta.schemas.embedding_config import EmbeddingConfig
15
15
 
16
16
  # new schemas
17
17
  from letta.schemas.enums import JobStatus, MessageRole
18
+ from letta.schemas.environment_variables import (
19
+ SandboxEnvironmentVariable,
20
+ SandboxEnvironmentVariableCreate,
21
+ SandboxEnvironmentVariableUpdate,
22
+ )
18
23
  from letta.schemas.file import FileMetadata
19
24
  from letta.schemas.job import Job
20
25
  from letta.schemas.letta_request import LettaRequest, LettaStreamingRequest
@@ -25,16 +30,7 @@ from letta.schemas.message import Message, MessageCreate, MessageUpdate
25
30
  from letta.schemas.openai.chat_completions import ToolCall
26
31
  from letta.schemas.organization import Organization
27
32
  from letta.schemas.passage import Passage
28
- from letta.schemas.sandbox_config import (
29
- E2BSandboxConfig,
30
- LocalSandboxConfig,
31
- SandboxConfig,
32
- SandboxConfigCreate,
33
- SandboxConfigUpdate,
34
- SandboxEnvironmentVariable,
35
- SandboxEnvironmentVariableCreate,
36
- SandboxEnvironmentVariableUpdate,
37
- )
33
+ from letta.schemas.sandbox_config import E2BSandboxConfig, LocalSandboxConfig, SandboxConfig, SandboxConfigCreate, SandboxConfigUpdate
38
34
  from letta.schemas.source import Source, SourceCreate, SourceUpdate
39
35
  from letta.schemas.tool import Tool, ToolCreate, ToolUpdate
40
36
  from letta.schemas.tool_rule import BaseToolRule
@@ -45,7 +45,6 @@ def _sse_post(url: str, data: dict, headers: dict) -> Generator[LettaStreamingRe
45
45
  # break
46
46
  if sse.data in [status.value for status in MessageStreamStatus]:
47
47
  # break
48
- # print("sse.data::", sse.data)
49
48
  yield MessageStreamStatus(sse.data)
50
49
  else:
51
50
  chunk_data = json.loads(sse.data)
@@ -31,7 +31,7 @@ class Agent(SqlalchemyBase, OrganizationMixin):
31
31
 
32
32
  # agent generates its own id
33
33
  # TODO: We want to migrate all the ORM models to do this, so we will need to move this to the SqlalchemyBase
34
- # TODO: Move this in this PR? at the very end?
34
+ # TODO: Some still rely on the Pydantic object to do this
35
35
  id: Mapped[str] = mapped_column(String, primary_key=True, default=lambda: f"agent-{uuid.uuid4()}")
36
36
 
37
37
  # Descriptor fields
@@ -61,6 +61,13 @@ class Agent(SqlalchemyBase, OrganizationMixin):
61
61
 
62
62
  # relationships
63
63
  organization: Mapped["Organization"] = relationship("Organization", back_populates="agents")
64
+ tool_exec_environment_variables: Mapped[List["AgentEnvironmentVariable"]] = relationship(
65
+ "AgentEnvironmentVariable",
66
+ back_populates="agent",
67
+ cascade="all, delete-orphan",
68
+ lazy="selectin",
69
+ doc="Environment variables associated with this agent.",
70
+ )
64
71
  tools: Mapped[List["Tool"]] = relationship("Tool", secondary="tools_agents", lazy="selectin", passive_deletes=True)
65
72
  sources: Mapped[List["Source"]] = relationship("Source", secondary="sources_agents", lazy="selectin")
66
73
  core_memory: Mapped[List["Block"]] = relationship("Block", secondary="blocks_agents", lazy="selectin")
@@ -119,5 +126,6 @@ class Agent(SqlalchemyBase, OrganizationMixin):
119
126
  "last_updated_by_id": self.last_updated_by_id,
120
127
  "created_at": self.created_at,
121
128
  "updated_at": self.updated_at,
129
+ "tool_exec_environment_variables": self.tool_exec_environment_variables,
122
130
  }
123
131
  return self.__pydantic_model__(**state)
@@ -9,6 +9,7 @@ if TYPE_CHECKING:
9
9
 
10
10
  from letta.orm.agent import Agent
11
11
  from letta.orm.file import FileMetadata
12
+ from letta.orm.sandbox_config import AgentEnvironmentVariable
12
13
  from letta.orm.tool import Tool
13
14
  from letta.orm.user import User
14
15
 
@@ -33,6 +34,9 @@ class Organization(SqlalchemyBase):
33
34
  sandbox_environment_variables: Mapped[List["SandboxEnvironmentVariable"]] = relationship(
34
35
  "SandboxEnvironmentVariable", back_populates="organization", cascade="all, delete-orphan"
35
36
  )
37
+ agent_environment_variables: Mapped[List["AgentEnvironmentVariable"]] = relationship(
38
+ "AgentEnvironmentVariable", back_populates="organization", cascade="all, delete-orphan"
39
+ )
36
40
 
37
41
  # relationships
38
42
  agents: Mapped[List["Agent"]] = relationship("Agent", back_populates="organization", cascade="all, delete-orphan")
@@ -1,3 +1,4 @@
1
+ import uuid
1
2
  from typing import TYPE_CHECKING, Dict, List, Optional
2
3
 
3
4
  from sqlalchemy import JSON
@@ -5,13 +6,14 @@ from sqlalchemy import Enum as SqlEnum
5
6
  from sqlalchemy import String, UniqueConstraint
6
7
  from sqlalchemy.orm import Mapped, mapped_column, relationship
7
8
 
8
- from letta.orm.mixins import OrganizationMixin, SandboxConfigMixin
9
+ from letta.orm.mixins import AgentMixin, OrganizationMixin, SandboxConfigMixin
9
10
  from letta.orm.sqlalchemy_base import SqlalchemyBase
11
+ from letta.schemas.environment_variables import SandboxEnvironmentVariable as PydanticSandboxEnvironmentVariable
10
12
  from letta.schemas.sandbox_config import SandboxConfig as PydanticSandboxConfig
11
- from letta.schemas.sandbox_config import SandboxEnvironmentVariable as PydanticSandboxEnvironmentVariable
12
13
  from letta.schemas.sandbox_config import SandboxType
13
14
 
14
15
  if TYPE_CHECKING:
16
+ from letta.orm.agent import Agent
15
17
  from letta.orm.organization import Organization
16
18
 
17
19
 
@@ -52,3 +54,21 @@ class SandboxEnvironmentVariable(SqlalchemyBase, OrganizationMixin, SandboxConfi
52
54
  # relationships
53
55
  organization: Mapped["Organization"] = relationship("Organization", back_populates="sandbox_environment_variables")
54
56
  sandbox_config: Mapped["SandboxConfig"] = relationship("SandboxConfig", back_populates="sandbox_environment_variables")
57
+
58
+
59
+ class AgentEnvironmentVariable(SqlalchemyBase, OrganizationMixin, AgentMixin):
60
+ """ORM model for environment variables associated with agents."""
61
+
62
+ __tablename__ = "agent_environment_variables"
63
+ # We cannot have duplicate key names for the same agent, the env var would get overwritten
64
+ __table_args__ = (UniqueConstraint("key", "agent_id", name="uix_key_agent"),)
65
+
66
+ # agent_env_var generates its own id
67
+ # TODO: We want to migrate all the ORM models to do this, so we will need to move this to the SqlalchemyBase
68
+ id: Mapped[str] = mapped_column(String, primary_key=True, default=lambda: f"agent-env-{uuid.uuid4()}")
69
+ key: Mapped[str] = mapped_column(String, nullable=False, doc="The name of the environment variable.")
70
+ value: Mapped[str] = mapped_column(String, nullable=False, doc="The value of the environment variable.")
71
+ description: Mapped[Optional[str]] = mapped_column(String, nullable=True, doc="An optional description of the environment variable.")
72
+
73
+ organization: Mapped["Organization"] = relationship("Organization", back_populates="agent_environment_variables")
74
+ agent: Mapped[List["Agent"]] = relationship("Agent", back_populates="tool_exec_environment_variables")
@@ -6,6 +6,7 @@ from pydantic import BaseModel, Field, field_validator
6
6
  from letta.constants import DEFAULT_EMBEDDING_CHUNK_SIZE
7
7
  from letta.schemas.block import CreateBlock
8
8
  from letta.schemas.embedding_config import EmbeddingConfig
9
+ from letta.schemas.environment_variables import AgentEnvironmentVariable
9
10
  from letta.schemas.letta_base import OrmMetadataBase
10
11
  from letta.schemas.llm_config import LLMConfig
11
12
  from letta.schemas.memory import Memory
@@ -78,6 +79,9 @@ class AgentState(OrmMetadataBase, validate_assignment=True):
78
79
  tools: List[Tool] = Field(..., description="The tools used by the agent.")
79
80
  sources: List[Source] = Field(..., description="The sources used by the agent.")
80
81
  tags: List[str] = Field(..., description="The tags associated with the agent.")
82
+ tool_exec_environment_variables: List[AgentEnvironmentVariable] = Field(
83
+ ..., description="The environment variables for tool execution specific to this agent."
84
+ )
81
85
 
82
86
 
83
87
  class CreateAgent(BaseModel, validate_assignment=True): #
@@ -120,6 +124,9 @@ class CreateAgent(BaseModel, validate_assignment=True): #
120
124
  embedding_chunk_size: Optional[int] = Field(DEFAULT_EMBEDDING_CHUNK_SIZE, description="The embedding chunk size used by the agent.")
121
125
  from_template: Optional[str] = Field(None, description="The template id used to configure the agent")
122
126
  project_id: Optional[str] = Field(None, description="The project id that the agent will be associated with.")
127
+ tool_exec_environment_variables: Optional[Dict[str, str]] = Field(
128
+ None, description="The environment variables for tool execution specific to this agent."
129
+ )
123
130
 
124
131
  @field_validator("name")
125
132
  @classmethod
@@ -184,6 +191,9 @@ class UpdateAgent(BaseModel):
184
191
  message_ids: Optional[List[str]] = Field(None, description="The ids of the messages in the agent's in-context memory.")
185
192
  description: Optional[str] = Field(None, description="The description of the agent.")
186
193
  metadata_: Optional[Dict] = Field(None, description="The metadata of the agent.", alias="metadata_")
194
+ tool_exec_environment_variables: Optional[Dict[str, str]] = Field(
195
+ None, description="The environment variables for tool execution specific to this agent."
196
+ )
187
197
 
188
198
  class Config:
189
199
  extra = "ignore" # Ignores extra fields
@@ -30,8 +30,8 @@ class JobStatus(str, Enum):
30
30
 
31
31
 
32
32
  class MessageStreamStatus(str, Enum):
33
- done_generation = "[DONE_GEN]"
34
- done_step = "[DONE_STEP]"
33
+ # done_generation = "[DONE_GEN]"
34
+ # done_step = "[DONE_STEP]"
35
35
  done = "[DONE]"
36
36
 
37
37
 
@@ -0,0 +1,62 @@
1
+ from typing import Optional
2
+
3
+ from pydantic import Field
4
+
5
+ from letta.schemas.letta_base import LettaBase, OrmMetadataBase
6
+
7
+
8
+ # Base Environment Variable
9
+ class EnvironmentVariableBase(OrmMetadataBase):
10
+ id: str = Field(..., description="The unique identifier for the environment variable.")
11
+ key: str = Field(..., description="The name of the environment variable.")
12
+ value: str = Field(..., description="The value of the environment variable.")
13
+ description: Optional[str] = Field(None, description="An optional description of the environment variable.")
14
+ organization_id: Optional[str] = Field(None, description="The ID of the organization this environment variable belongs to.")
15
+
16
+
17
+ class EnvironmentVariableCreateBase(LettaBase):
18
+ key: str = Field(..., description="The name of the environment variable.")
19
+ value: str = Field(..., description="The value of the environment variable.")
20
+ description: Optional[str] = Field(None, description="An optional description of the environment variable.")
21
+
22
+
23
+ class EnvironmentVariableUpdateBase(LettaBase):
24
+ key: Optional[str] = Field(None, description="The name of the environment variable.")
25
+ value: Optional[str] = Field(None, description="The value of the environment variable.")
26
+ description: Optional[str] = Field(None, description="An optional description of the environment variable.")
27
+
28
+
29
+ # Sandbox-Specific Environment Variable
30
+ class SandboxEnvironmentVariableBase(EnvironmentVariableBase):
31
+ __id_prefix__ = "sandbox-env"
32
+ sandbox_config_id: str = Field(..., description="The ID of the sandbox config this environment variable belongs to.")
33
+
34
+
35
+ class SandboxEnvironmentVariable(SandboxEnvironmentVariableBase):
36
+ id: str = SandboxEnvironmentVariableBase.generate_id_field()
37
+
38
+
39
+ class SandboxEnvironmentVariableCreate(EnvironmentVariableCreateBase):
40
+ pass
41
+
42
+
43
+ class SandboxEnvironmentVariableUpdate(EnvironmentVariableUpdateBase):
44
+ pass
45
+
46
+
47
+ # Agent-Specific Environment Variable
48
+ class AgentEnvironmentVariableBase(EnvironmentVariableBase):
49
+ __id_prefix__ = "agent-env"
50
+ agent_id: str = Field(..., description="The ID of the agent this environment variable belongs to.")
51
+
52
+
53
+ class AgentEnvironmentVariable(AgentEnvironmentVariableBase):
54
+ id: str = AgentEnvironmentVariableBase.generate_id_field()
55
+
56
+
57
+ class AgentEnvironmentVariableCreate(EnvironmentVariableCreateBase):
58
+ pass
59
+
60
+
61
+ class AgentEnvironmentVariableUpdate(EnvironmentVariableUpdateBase):
62
+ pass
@@ -29,19 +29,20 @@ class LettaResponse(BaseModel):
29
29
  json_schema_extra={
30
30
  "items": {
31
31
  "oneOf": [
32
- {"x-ref-name": "SystemMessage"},
33
- {"x-ref-name": "UserMessage"},
34
- {"x-ref-name": "ReasoningMessage"},
35
- {"x-ref-name": "ToolCallMessage"},
36
- {"x-ref-name": "ToolReturnMessage"},
37
- {"x-ref-name": "AssistantMessage"},
32
+ {"$ref": "#/components/schemas/SystemMessage-Output"},
33
+ {"$ref": "#/components/schemas/UserMessage-Output"},
34
+ {"$ref": "#/components/schemas/ReasoningMessage"},
35
+ {"$ref": "#/components/schemas/ToolCallMessage"},
36
+ {"$ref": "#/components/schemas/ToolReturnMessage"},
37
+ {"$ref": "#/components/schemas/AssistantMessage-Output"},
38
38
  ],
39
39
  "discriminator": {"propertyName": "message_type"},
40
40
  }
41
41
  },
42
42
  )
43
43
  usage: LettaUsageStatistics = Field(
44
- ..., description="The usage statistics of the agent.", json_schema_extra={"x-ref-name": "LettaUsageStatistics"}
44
+ ...,
45
+ description="The usage statistics of the agent.",
45
46
  )
46
47
 
47
48
  def __str__(self):
@@ -102,31 +102,3 @@ class SandboxConfigUpdate(LettaBase):
102
102
  """Pydantic model for updating SandboxConfig fields."""
103
103
 
104
104
  config: Union[LocalSandboxConfig, E2BSandboxConfig] = Field(None, description="The JSON configuration data for the sandbox.")
105
-
106
-
107
- # Environment Variable
108
- class SandboxEnvironmentVariableBase(OrmMetadataBase):
109
- __id_prefix__ = "sandbox-env"
110
-
111
-
112
- class SandboxEnvironmentVariable(SandboxEnvironmentVariableBase):
113
- id: str = SandboxEnvironmentVariableBase.generate_id_field()
114
- key: str = Field(..., description="The name of the environment variable.")
115
- value: str = Field(..., description="The value of the environment variable.")
116
- description: Optional[str] = Field(None, description="An optional description of the environment variable.")
117
- sandbox_config_id: str = Field(..., description="The ID of the sandbox config this environment variable belongs to.")
118
- organization_id: Optional[str] = Field(None, description="The ID of the organization this environment variable belongs to.")
119
-
120
-
121
- class SandboxEnvironmentVariableCreate(LettaBase):
122
- key: str = Field(..., description="The name of the environment variable.")
123
- value: str = Field(..., description="The value of the environment variable.")
124
- description: Optional[str] = Field(None, description="An optional description of the environment variable.")
125
-
126
-
127
- class SandboxEnvironmentVariableUpdate(LettaBase):
128
- """Pydantic model for updating SandboxEnvironmentVariable fields."""
129
-
130
- key: Optional[str] = Field(None, description="The name of the environment variable.")
131
- value: Optional[str] = Field(None, description="The value of the environment variable.")
132
- description: Optional[str] = Field(None, description="An optional description of the environment variable.")
@@ -292,8 +292,8 @@ class StreamingServerInterface(AgentChunkStreamingInterface):
292
292
  # if multi_step = True, the stream ends when the agent yields
293
293
  # if multi_step = False, the stream ends when the step ends
294
294
  self.multi_step = multi_step
295
- self.multi_step_indicator = MessageStreamStatus.done_step
296
- self.multi_step_gen_indicator = MessageStreamStatus.done_generation
295
+ # self.multi_step_indicator = MessageStreamStatus.done_step
296
+ # self.multi_step_gen_indicator = MessageStreamStatus.done_generation
297
297
 
298
298
  # Support for AssistantMessage
299
299
  self.use_assistant_message = False # TODO: Remove this
@@ -378,8 +378,8 @@ class StreamingServerInterface(AgentChunkStreamingInterface):
378
378
  """Clean up the stream by deactivating and clearing chunks."""
379
379
  self.streaming_chat_completion_mode_function_name = None
380
380
 
381
- if not self.streaming_chat_completion_mode and not self.nonstreaming_legacy_mode:
382
- self._push_to_buffer(self.multi_step_gen_indicator)
381
+ # if not self.streaming_chat_completion_mode and not self.nonstreaming_legacy_mode:
382
+ # self._push_to_buffer(self.multi_step_gen_indicator)
383
383
 
384
384
  # Wipe the inner thoughts buffers
385
385
  self._reset_inner_thoughts_json_reader()
@@ -390,9 +390,9 @@ class StreamingServerInterface(AgentChunkStreamingInterface):
390
390
  # end the stream
391
391
  self._active = False
392
392
  self._event.set() # Unblock the generator if it's waiting to allow it to complete
393
- elif not self.streaming_chat_completion_mode and not self.nonstreaming_legacy_mode:
394
- # signal that a new step has started in the stream
395
- self._push_to_buffer(self.multi_step_indicator)
393
+ # elif not self.streaming_chat_completion_mode and not self.nonstreaming_legacy_mode:
394
+ # # signal that a new step has started in the stream
395
+ # self._push_to_buffer(self.multi_step_indicator)
396
396
 
397
397
  # Wipe the inner thoughts buffers
398
398
  self._reset_inner_thoughts_json_reader()
@@ -2,10 +2,10 @@ from typing import List, Optional
2
2
 
3
3
  from fastapi import APIRouter, Depends, Query
4
4
 
5
+ from letta.schemas.environment_variables import SandboxEnvironmentVariable as PydanticEnvVar
6
+ from letta.schemas.environment_variables import SandboxEnvironmentVariableCreate, SandboxEnvironmentVariableUpdate
5
7
  from letta.schemas.sandbox_config import SandboxConfig as PydanticSandboxConfig
6
- from letta.schemas.sandbox_config import SandboxConfigCreate, SandboxConfigUpdate
7
- from letta.schemas.sandbox_config import SandboxEnvironmentVariable as PydanticEnvVar
8
- from letta.schemas.sandbox_config import SandboxEnvironmentVariableCreate, SandboxEnvironmentVariableUpdate, SandboxType
8
+ from letta.schemas.sandbox_config import SandboxConfigCreate, SandboxConfigUpdate, SandboxType
9
9
  from letta.server.rest_api.utils import get_letta_server, get_user_id
10
10
  from letta.server.server import SyncServer
11
11
 
@@ -46,6 +46,7 @@ from letta.schemas.embedding_config import EmbeddingConfig
46
46
 
47
47
  # openai schemas
48
48
  from letta.schemas.enums import JobStatus
49
+ from letta.schemas.environment_variables import SandboxEnvironmentVariableCreate
49
50
  from letta.schemas.job import Job, JobUpdate
50
51
  from letta.schemas.letta_message import LettaMessage, ToolReturnMessage
51
52
  from letta.schemas.llm_config import LLMConfig
@@ -53,7 +54,7 @@ from letta.schemas.memory import ArchivalMemorySummary, ContextWindowOverview, M
53
54
  from letta.schemas.message import Message, MessageCreate, MessageRole, MessageUpdate
54
55
  from letta.schemas.organization import Organization
55
56
  from letta.schemas.passage import Passage
56
- from letta.schemas.sandbox_config import SandboxEnvironmentVariableCreate, SandboxType
57
+ from letta.schemas.sandbox_config import SandboxType
57
58
  from letta.schemas.source import Source
58
59
  from letta.schemas.tool import Tool
59
60
  from letta.schemas.usage import LettaUsageStatistics
@@ -14,6 +14,7 @@ from letta.orm import Source as SourceModel
14
14
  from letta.orm import SourcePassage, SourcesAgents
15
15
  from letta.orm import Tool as ToolModel
16
16
  from letta.orm.errors import NoResultFound
17
+ from letta.orm.sandbox_config import AgentEnvironmentVariable as AgentEnvironmentVariableModel
17
18
  from letta.orm.sqlite_functions import adapt_array
18
19
  from letta.schemas.agent import AgentState as PydanticAgentState
19
20
  from letta.schemas.agent import AgentType, CreateAgent, UpdateAgent
@@ -116,6 +117,14 @@ class AgentManager:
116
117
  actor=actor,
117
118
  )
118
119
 
120
+ # If there are provided environment variables, add them in
121
+ if agent_create.tool_exec_environment_variables:
122
+ agent_state = self._set_environment_variables(
123
+ agent_id=agent_state.id,
124
+ env_vars=agent_create.tool_exec_environment_variables,
125
+ actor=actor,
126
+ )
127
+
119
128
  # TODO: See if we can merge this into the above SQL create call for performance reasons
120
129
  # Generate a sequence of initial messages to put in the buffer
121
130
  init_messages = initialize_message_sequence(
@@ -192,6 +201,14 @@ class AgentManager:
192
201
  def update_agent(self, agent_id: str, agent_update: UpdateAgent, actor: PydanticUser) -> PydanticAgentState:
193
202
  agent_state = self._update_agent(agent_id=agent_id, agent_update=agent_update, actor=actor)
194
203
 
204
+ # If there are provided environment variables, add them in
205
+ if agent_update.tool_exec_environment_variables:
206
+ agent_state = self._set_environment_variables(
207
+ agent_id=agent_state.id,
208
+ env_vars=agent_update.tool_exec_environment_variables,
209
+ actor=actor,
210
+ )
211
+
195
212
  # Rebuild the system prompt if it's different
196
213
  if agent_update.system and agent_update.system != agent_state.system:
197
214
  agent_state = self.rebuild_system_prompt(agent_id=agent_state.id, actor=actor, force=True, update_timestamp=False)
@@ -296,6 +313,43 @@ class AgentManager:
296
313
  agent = AgentModel.read(db_session=session, identifier=agent_id, actor=actor)
297
314
  agent.hard_delete(session)
298
315
 
316
+ # ======================================================================================================================
317
+ # Per Agent Environment Variable Management
318
+ # ======================================================================================================================
319
+ @enforce_types
320
+ def _set_environment_variables(
321
+ self,
322
+ agent_id: str,
323
+ env_vars: Dict[str, str],
324
+ actor: PydanticUser,
325
+ ) -> PydanticAgentState:
326
+ """
327
+ Adds or replaces the environment variables for the specified agent.
328
+
329
+ Args:
330
+ agent_id: The agent id.
331
+ env_vars: A dictionary of environment variable key-value pairs.
332
+ actor: The user performing the action.
333
+
334
+ Returns:
335
+ PydanticAgentState: The updated agent as a Pydantic model.
336
+ """
337
+ with self.session_maker() as session:
338
+ # Retrieve the agent
339
+ agent = AgentModel.read(db_session=session, identifier=agent_id, actor=actor)
340
+
341
+ # Replace the environment variables
342
+ agent.tool_exec_environment_variables = [
343
+ AgentEnvironmentVariableModel(key=key, value=value, agent_id=agent_id, organization_id=actor.organization_id)
344
+ for key, value in env_vars.items()
345
+ ]
346
+
347
+ # Update the agent in the database
348
+ agent.update(session, actor=actor)
349
+
350
+ # Return the updated agent state
351
+ return agent.to_pydantic()
352
+
299
353
  # ======================================================================================================================
300
354
  # In Context Messages Management
301
355
  # ======================================================================================================================
@@ -5,11 +5,11 @@ from letta.log import get_logger
5
5
  from letta.orm.errors import NoResultFound
6
6
  from letta.orm.sandbox_config import SandboxConfig as SandboxConfigModel
7
7
  from letta.orm.sandbox_config import SandboxEnvironmentVariable as SandboxEnvVarModel
8
+ from letta.schemas.environment_variables import SandboxEnvironmentVariable as PydanticEnvVar
9
+ from letta.schemas.environment_variables import SandboxEnvironmentVariableCreate, SandboxEnvironmentVariableUpdate
8
10
  from letta.schemas.sandbox_config import LocalSandboxConfig
9
11
  from letta.schemas.sandbox_config import SandboxConfig as PydanticSandboxConfig
10
- from letta.schemas.sandbox_config import SandboxConfigCreate, SandboxConfigUpdate
11
- from letta.schemas.sandbox_config import SandboxEnvironmentVariable as PydanticEnvVar
12
- from letta.schemas.sandbox_config import SandboxEnvironmentVariableCreate, SandboxEnvironmentVariableUpdate, SandboxType
12
+ from letta.schemas.sandbox_config import SandboxConfigCreate, SandboxConfigUpdate, SandboxType
13
13
  from letta.schemas.user import User as PydanticUser
14
14
  from letta.utils import enforce_types, printd
15
15
 
@@ -278,11 +278,14 @@ class ToolExecutionSandbox:
278
278
  sbx = self.get_running_e2b_sandbox_with_same_state(sbx_config)
279
279
  if not sbx or self.force_recreate:
280
280
  if not sbx:
281
- logger.info(f"No running e2b sandbox found with the same state: {sbx_config}")
281
+ logger.info(f"No running e2b sandbox found with the same state: {sbx_config}")
282
282
  else:
283
- logger.info(f"Force recreated e2b sandbox with state: {sbx_config}")
283
+ logger.info(f"Force recreated e2b sandbox with state: {sbx_config}")
284
284
  sbx = self.create_e2b_sandbox_with_metadata_hash(sandbox_config=sbx_config)
285
285
 
286
+ logger.info(f"E2B Sandbox configurations: {sbx_config}")
287
+ logger.info(f"E2B Sandbox ID: {sbx.sandbox_id}")
288
+
286
289
  # Since this sandbox was used, we extend its lifecycle by the timeout
287
290
  sbx.set_timeout(sbx_config.get_e2b_config().timeout)
288
291
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "letta-nightly"
3
- version = "0.6.7.dev20250106104119"
3
+ version = "0.6.7.dev20250106211813"
4
4
  packages = [
5
5
  {include = "letta"}
6
6
  ]