letta-nightly 0.6.1.dev20241208192034__tar.gz → 0.6.2.dev20241210030252__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 (239) hide show
  1. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/PKG-INFO +1 -1
  2. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/__init__.py +1 -1
  3. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/agent.py +7 -1
  4. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/cli/cli.py +1 -0
  5. letta_nightly-0.6.2.dev20241210030252/letta/cli/cli_load.py +68 -0
  6. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/client/client.py +69 -13
  7. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/errors.py +24 -0
  8. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/llm_api/llm_api_tools.py +13 -6
  9. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/main.py +0 -1
  10. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/offline_memory_agent.py +2 -5
  11. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/sqlalchemy_base.py +1 -1
  12. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/tool.py +6 -8
  13. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/message.py +14 -1
  14. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/tool.py +5 -0
  15. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/app.py +30 -0
  16. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/agents.py +100 -1
  17. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/server.py +4 -3
  18. letta_nightly-0.6.2.dev20241210030252/letta/server/startup.sh +49 -0
  19. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/utils.py +5 -6
  20. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/pyproject.toml +3 -3
  21. letta_nightly-0.6.1.dev20241208192034/letta/cli/cli_load.py +0 -116
  22. letta_nightly-0.6.1.dev20241208192034/letta/server/startup.sh +0 -17
  23. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/LICENSE +0 -0
  24. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/README.md +0 -0
  25. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/__main__.py +0 -0
  26. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/agent_store/chroma.py +0 -0
  27. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/agent_store/db.py +0 -0
  28. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/agent_store/milvus.py +0 -0
  29. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/agent_store/qdrant.py +0 -0
  30. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/agent_store/storage.py +0 -0
  31. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/benchmark/benchmark.py +0 -0
  32. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/benchmark/constants.py +0 -0
  33. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/chat_only_agent.py +0 -0
  34. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/cli/cli_config.py +0 -0
  35. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/client/__init__.py +0 -0
  36. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/client/streaming.py +0 -0
  37. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/client/utils.py +0 -0
  38. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/config.py +0 -0
  39. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/constants.py +0 -0
  40. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/credentials.py +0 -0
  41. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/data_sources/connectors.py +0 -0
  42. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/data_sources/connectors_helper.py +0 -0
  43. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/embeddings.py +0 -0
  44. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/functions/__init__.py +0 -0
  45. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/functions/function_sets/base.py +0 -0
  46. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/functions/function_sets/extras.py +0 -0
  47. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/functions/functions.py +0 -0
  48. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/functions/helpers.py +0 -0
  49. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/functions/schema_generator.py +0 -0
  50. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/helpers/__init__.py +0 -0
  51. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/helpers/tool_rule_solver.py +0 -0
  52. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/humans/__init__.py +0 -0
  53. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/humans/examples/basic.txt +0 -0
  54. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/humans/examples/cs_phd.txt +0 -0
  55. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/interface.py +0 -0
  56. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/llm_api/__init__.py +0 -0
  57. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/llm_api/anthropic.py +0 -0
  58. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/llm_api/azure_openai.py +0 -0
  59. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/llm_api/azure_openai_constants.py +0 -0
  60. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/llm_api/cohere.py +0 -0
  61. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/llm_api/google_ai.py +0 -0
  62. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/llm_api/helpers.py +0 -0
  63. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/llm_api/mistral.py +0 -0
  64. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/llm_api/openai.py +0 -0
  65. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/README.md +0 -0
  66. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/__init__.py +0 -0
  67. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/chat_completion_proxy.py +0 -0
  68. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/constants.py +0 -0
  69. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/function_parser.py +0 -0
  70. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/grammars/__init__.py +0 -0
  71. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
  72. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/grammars/json.gbnf +0 -0
  73. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
  74. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/json_parser.py +0 -0
  75. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/koboldcpp/api.py +0 -0
  76. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/koboldcpp/settings.py +0 -0
  77. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llamacpp/api.py +0 -0
  78. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llamacpp/settings.py +0 -0
  79. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
  80. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
  81. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
  82. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
  83. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
  84. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
  85. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
  86. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
  87. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
  88. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/lmstudio/api.py +0 -0
  89. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/lmstudio/settings.py +0 -0
  90. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/ollama/api.py +0 -0
  91. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/ollama/settings.py +0 -0
  92. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/settings/__init__.py +0 -0
  93. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
  94. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/settings/settings.py +0 -0
  95. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/settings/simple.py +0 -0
  96. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/utils.py +0 -0
  97. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/vllm/api.py +0 -0
  98. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/webui/api.py +0 -0
  99. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/webui/legacy_api.py +0 -0
  100. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/webui/legacy_settings.py +0 -0
  101. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/local_llm/webui/settings.py +0 -0
  102. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/log.py +0 -0
  103. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/memory.py +0 -0
  104. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/metadata.py +0 -0
  105. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/o1_agent.py +0 -0
  106. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/openai_backcompat/__init__.py +0 -0
  107. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/openai_backcompat/openai_object.py +0 -0
  108. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/__all__.py +0 -0
  109. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/__init__.py +0 -0
  110. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/agents_tags.py +0 -0
  111. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/base.py +0 -0
  112. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/block.py +0 -0
  113. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/blocks_agents.py +0 -0
  114. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/enums.py +0 -0
  115. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/errors.py +0 -0
  116. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/file.py +0 -0
  117. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/job.py +0 -0
  118. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/message.py +0 -0
  119. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/mixins.py +0 -0
  120. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/organization.py +0 -0
  121. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/sandbox_config.py +0 -0
  122. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/source.py +0 -0
  123. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/tools_agents.py +0 -0
  124. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/orm/user.py +0 -0
  125. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/__init__.py +0 -0
  126. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/examples/anna_pa.txt +0 -0
  127. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/examples/google_search_persona.txt +0 -0
  128. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/examples/memgpt_doc.txt +0 -0
  129. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/examples/memgpt_starter.txt +0 -0
  130. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/examples/o1_persona.txt +0 -0
  131. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/examples/offline_memory_persona.txt +0 -0
  132. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/examples/sam.txt +0 -0
  133. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/examples/sam_pov.txt +0 -0
  134. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
  135. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/personas/examples/sqldb/test.db +0 -0
  136. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/__init__.py +0 -0
  137. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/gpt_summarize.py +0 -0
  138. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/gpt_system.py +0 -0
  139. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_base.txt +0 -0
  140. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_chat.txt +0 -0
  141. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
  142. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
  143. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_convo_only.txt +0 -0
  144. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_doc.txt +0 -0
  145. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
  146. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
  147. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
  148. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
  149. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
  150. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
  151. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/providers.py +0 -0
  152. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/pytest.ini +0 -0
  153. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/agent.py +0 -0
  154. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/agents_tags.py +0 -0
  155. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/api_key.py +0 -0
  156. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/block.py +0 -0
  157. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/blocks_agents.py +0 -0
  158. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/embedding_config.py +0 -0
  159. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/enums.py +0 -0
  160. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/file.py +0 -0
  161. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/health.py +0 -0
  162. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/job.py +0 -0
  163. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/letta_base.py +0 -0
  164. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/letta_message.py +0 -0
  165. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/letta_request.py +0 -0
  166. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/letta_response.py +0 -0
  167. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/llm_config.py +0 -0
  168. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/memory.py +0 -0
  169. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/openai/chat_completion_request.py +0 -0
  170. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/openai/chat_completion_response.py +0 -0
  171. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/openai/chat_completions.py +0 -0
  172. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/openai/embedding_response.py +0 -0
  173. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/openai/openai.py +0 -0
  174. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/organization.py +0 -0
  175. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/passage.py +0 -0
  176. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/sandbox_config.py +0 -0
  177. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/source.py +0 -0
  178. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/tool_rule.py +0 -0
  179. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/tools_agents.py +0 -0
  180. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/usage.py +0 -0
  181. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/schemas/user.py +0 -0
  182. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/__init__.py +0 -0
  183. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/constants.py +0 -0
  184. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/generate_openapi_schema.sh +0 -0
  185. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/__init__.py +0 -0
  186. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/auth/__init__.py +0 -0
  187. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/auth/index.py +0 -0
  188. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/auth_token.py +0 -0
  189. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/interface.py +0 -0
  190. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/__init__.py +0 -0
  191. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/openai/__init__.py +0 -0
  192. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
  193. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
  194. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
  195. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/openai/assistants/threads.py +0 -0
  196. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
  197. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
  198. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/__init__.py +0 -0
  199. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/blocks.py +0 -0
  200. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/health.py +0 -0
  201. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/jobs.py +0 -0
  202. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/llms.py +0 -0
  203. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/organizations.py +0 -0
  204. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
  205. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/sources.py +0 -0
  206. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/tools.py +0 -0
  207. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/routers/v1/users.py +0 -0
  208. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/static_files.py +0 -0
  209. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/rest_api/utils.py +0 -0
  210. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/static_files/assets/index-43ab4d62.css +0 -0
  211. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/static_files/assets/index-4848e3d7.js +0 -0
  212. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/static_files/favicon.ico +0 -0
  213. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/static_files/index.html +0 -0
  214. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
  215. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/utils.py +0 -0
  216. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/ws_api/__init__.py +0 -0
  217. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/ws_api/example_client.py +0 -0
  218. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/ws_api/interface.py +0 -0
  219. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/ws_api/protocol.py +0 -0
  220. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/server/ws_api/server.py +0 -0
  221. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/__init__.py +0 -0
  222. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/agents_tags_manager.py +0 -0
  223. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/block_manager.py +0 -0
  224. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/blocks_agents_manager.py +0 -0
  225. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/job_manager.py +0 -0
  226. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/message_manager.py +0 -0
  227. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/organization_manager.py +0 -0
  228. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/per_agent_lock_manager.py +0 -0
  229. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/sandbox_config_manager.py +0 -0
  230. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/source_manager.py +0 -0
  231. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/tool_execution_sandbox.py +0 -0
  232. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/tool_manager.py +0 -0
  233. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/tool_sandbox_env/.gitkeep +0 -0
  234. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/tools_agents_manager.py +0 -0
  235. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/services/user_manager.py +0 -0
  236. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/settings.py +0 -0
  237. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/streaming_interface.py +0 -0
  238. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/streaming_utils.py +0 -0
  239. {letta_nightly-0.6.1.dev20241208192034 → letta_nightly-0.6.2.dev20241210030252}/letta/system.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-nightly
3
- Version: 0.6.1.dev20241208192034
3
+ Version: 0.6.2.dev20241210030252
4
4
  Summary: Create LLM agents with long-term memory and custom tools
5
5
  License: Apache License
6
6
  Author: Letta Team
@@ -1,4 +1,4 @@
1
- __version__ = "0.6.1"
1
+ __version__ = "0.6.2"
2
2
 
3
3
  # import clients
4
4
  from letta.client.client import LocalClient, RESTClient, create_client
@@ -801,7 +801,13 @@ class Agent(BaseAgent):
801
801
  # but by default, we add a truncation safeguard to prevent bad functions from
802
802
  # overflow the agent context window
803
803
  truncate = True
804
- function_response_string = validate_function_response(function_response, truncate=truncate)
804
+
805
+ # get the function response limit
806
+ tool_obj = [tool for tool in self.agent_state.tools if tool.name == function_name][0]
807
+ return_char_limit = tool_obj.return_char_limit
808
+ function_response_string = validate_function_response(
809
+ function_response, return_char_limit=return_char_limit, truncate=truncate
810
+ )
805
811
  function_args.pop("self", None)
806
812
  function_response = package_function_response(True, function_response_string)
807
813
  function_failed = False
@@ -51,6 +51,7 @@ def server(
51
51
  port: Annotated[Optional[int], typer.Option(help="Port to run the server on")] = None,
52
52
  host: Annotated[Optional[str], typer.Option(help="Host to run the server on (default to localhost)")] = None,
53
53
  debug: Annotated[bool, typer.Option(help="Turn debugging output on")] = False,
54
+ ade: Annotated[bool, typer.Option(help="Allows remote access")] = False, # NOTE: deprecated
54
55
  secure: Annotated[bool, typer.Option(help="Adds simple security access")] = False,
55
56
  ):
56
57
  """Launch a Letta server process"""
@@ -0,0 +1,68 @@
1
+ """
2
+ This file contains functions for loading data into Letta's archival storage.
3
+
4
+ Data can be loaded with the following command, once a load function is defined:
5
+ ```
6
+ letta load <data-connector-type> --name <dataset-name> [ADDITIONAL ARGS]
7
+ ```
8
+
9
+ """
10
+
11
+ import uuid
12
+ from typing import Annotated, List, Optional
13
+
14
+ import questionary
15
+ import typer
16
+
17
+ from letta import create_client
18
+ from letta.data_sources.connectors import DirectoryConnector
19
+
20
+ app = typer.Typer()
21
+
22
+
23
+ default_extensions = ".txt,.md,.pdf"
24
+
25
+
26
+ @app.command("directory")
27
+ def load_directory(
28
+ name: Annotated[str, typer.Option(help="Name of dataset to load.")],
29
+ input_dir: Annotated[Optional[str], typer.Option(help="Path to directory containing dataset.")] = None,
30
+ input_files: Annotated[List[str], typer.Option(help="List of paths to files containing dataset.")] = [],
31
+ recursive: Annotated[bool, typer.Option(help="Recursively search for files in directory.")] = False,
32
+ extensions: Annotated[str, typer.Option(help="Comma separated list of file extensions to load")] = default_extensions,
33
+ user_id: Annotated[Optional[uuid.UUID], typer.Option(help="User ID to associate with dataset.")] = None, # TODO: remove
34
+ description: Annotated[Optional[str], typer.Option(help="Description of the source.")] = None,
35
+ ):
36
+ client = create_client()
37
+
38
+ # create connector
39
+ connector = DirectoryConnector(input_files=input_files, input_directory=input_dir, recursive=recursive, extensions=extensions)
40
+
41
+ # choose form list of embedding configs
42
+ embedding_configs = client.list_embedding_configs()
43
+ embedding_options = [embedding_config.embedding_model for embedding_config in embedding_configs]
44
+
45
+ embedding_choices = [
46
+ questionary.Choice(title=embedding_config.pretty_print(), value=embedding_config) for embedding_config in embedding_configs
47
+ ]
48
+
49
+ # select model
50
+ if len(embedding_options) == 0:
51
+ raise ValueError("No embedding models found. Please enable a provider.")
52
+ elif len(embedding_options) == 1:
53
+ embedding_model_name = embedding_options[0]
54
+ else:
55
+ embedding_model_name = questionary.select("Select embedding model:", choices=embedding_choices).ask().embedding_model
56
+ embedding_config = [
57
+ embedding_config for embedding_config in embedding_configs if embedding_config.embedding_model == embedding_model_name
58
+ ][0]
59
+
60
+ # create source
61
+ source = client.create_source(name=name, embedding_config=embedding_config)
62
+
63
+ # load data
64
+ try:
65
+ client.load_data(connector, source_name=name)
66
+ except Exception as e:
67
+ typer.secho(f"Failed to load data from provided information.\n{e}", fg=typer.colors.RED)
68
+ client.delete_source(source.id)
@@ -11,6 +11,7 @@ from letta.constants import (
11
11
  BASE_TOOLS,
12
12
  DEFAULT_HUMAN,
13
13
  DEFAULT_PERSONA,
14
+ FUNCTION_RETURN_CHAR_LIMIT,
14
15
  )
15
16
  from letta.data_sources.connectors import DataConnector
16
17
  from letta.functions.functions import parse_source_code
@@ -200,18 +201,12 @@ class AbstractClient(object):
200
201
  raise NotImplementedError
201
202
 
202
203
  def create_tool(
203
- self,
204
- func,
205
- name: Optional[str] = None,
206
- tags: Optional[List[str]] = None,
204
+ self, func, name: Optional[str] = None, tags: Optional[List[str]] = None, return_char_limit: int = FUNCTION_RETURN_CHAR_LIMIT
207
205
  ) -> Tool:
208
206
  raise NotImplementedError
209
207
 
210
208
  def create_or_update_tool(
211
- self,
212
- func,
213
- name: Optional[str] = None,
214
- tags: Optional[List[str]] = None,
209
+ self, func, name: Optional[str] = None, tags: Optional[List[str]] = None, return_char_limit: int = FUNCTION_RETURN_CHAR_LIMIT
215
210
  ) -> Tool:
216
211
  raise NotImplementedError
217
212
 
@@ -222,6 +217,7 @@ class AbstractClient(object):
222
217
  description: Optional[str] = None,
223
218
  func: Optional[Callable] = None,
224
219
  tags: Optional[List[str]] = None,
220
+ return_char_limit: int = FUNCTION_RETURN_CHAR_LIMIT,
225
221
  ) -> Tool:
226
222
  raise NotImplementedError
227
223
 
@@ -960,7 +956,6 @@ class RESTClient(AbstractClient):
960
956
  # TODO: figure out how to handle stream_steps and stream_tokens
961
957
 
962
958
  # When streaming steps is True, stream_tokens must be False
963
- request = LettaRequest(messages=messages)
964
959
  if stream_tokens or stream_steps:
965
960
  from letta.client.streaming import _sse_post
966
961
 
@@ -985,6 +980,39 @@ class RESTClient(AbstractClient):
985
980
 
986
981
  return response
987
982
 
983
+ def send_message_async(
984
+ self,
985
+ message: str,
986
+ role: str,
987
+ agent_id: Optional[str] = None,
988
+ name: Optional[str] = None,
989
+ ) -> Job:
990
+ """
991
+ Send a message to an agent (async, returns a job)
992
+
993
+ Args:
994
+ message (str): Message to send
995
+ role (str): Role of the message
996
+ agent_id (str): ID of the agent
997
+ name(str): Name of the sender
998
+
999
+ Returns:
1000
+ job (Job): Information about the async job
1001
+ """
1002
+ messages = [MessageCreate(role=MessageRole(role), text=message, name=name)]
1003
+
1004
+ request = LettaRequest(messages=messages)
1005
+ response = requests.post(
1006
+ f"{self.base_url}/{self.api_prefix}/agents/{agent_id}/messages/async",
1007
+ json=request.model_dump(),
1008
+ headers=self.headers,
1009
+ )
1010
+ if response.status_code != 200:
1011
+ raise ValueError(f"Failed to send message: {response.text}")
1012
+ response = Job(**response.json())
1013
+
1014
+ return response
1015
+
988
1016
  # humans / personas
989
1017
 
990
1018
  def list_blocks(self, label: Optional[str] = None, templates_only: Optional[bool] = True) -> List[Block]:
@@ -1319,6 +1347,7 @@ class RESTClient(AbstractClient):
1319
1347
  Returns:
1320
1348
  source (Source): Created source
1321
1349
  """
1350
+ assert embedding_config or self._default_embedding_config, f"Must specify embedding_config for source"
1322
1351
  source_create = SourceCreate(name=name, embedding_config=embedding_config or self._default_embedding_config)
1323
1352
  payload = source_create.model_dump()
1324
1353
  response = requests.post(f"{self.base_url}/{self.api_prefix}/sources", json=payload, headers=self.headers)
@@ -1432,6 +1461,7 @@ class RESTClient(AbstractClient):
1432
1461
  func: Callable,
1433
1462
  name: Optional[str] = None,
1434
1463
  tags: Optional[List[str]] = None,
1464
+ return_char_limit: int = FUNCTION_RETURN_CHAR_LIMIT,
1435
1465
  ) -> Tool:
1436
1466
  """
1437
1467
  Create a tool. This stores the source code of function on the server, so that the server can execute the function and generate an OpenAI JSON schemas for it when using with an agent.
@@ -1440,6 +1470,7 @@ class RESTClient(AbstractClient):
1440
1470
  func (callable): The function to create a tool for.
1441
1471
  name: (str): Name of the tool (must be unique per-user.)
1442
1472
  tags (Optional[List[str]], optional): Tags for the tool. Defaults to None.
1473
+ return_char_limit (int): The character limit for the tool's return value. Defaults to FUNCTION_RETURN_CHAR_LIMIT.
1443
1474
 
1444
1475
  Returns:
1445
1476
  tool (Tool): The created tool.
@@ -1448,7 +1479,9 @@ class RESTClient(AbstractClient):
1448
1479
  source_type = "python"
1449
1480
 
1450
1481
  # call server function
1451
- request = ToolCreate(source_type=source_type, source_code=source_code, name=name, tags=tags)
1482
+ request = ToolCreate(source_type=source_type, source_code=source_code, name=name, return_char_limit=return_char_limit)
1483
+ if tags:
1484
+ request.tags = tags
1452
1485
  response = requests.post(f"{self.base_url}/{self.api_prefix}/tools", json=request.model_dump(), headers=self.headers)
1453
1486
  if response.status_code != 200:
1454
1487
  raise ValueError(f"Failed to create tool: {response.text}")
@@ -1459,6 +1492,7 @@ class RESTClient(AbstractClient):
1459
1492
  func: Callable,
1460
1493
  name: Optional[str] = None,
1461
1494
  tags: Optional[List[str]] = None,
1495
+ return_char_limit: int = FUNCTION_RETURN_CHAR_LIMIT,
1462
1496
  ) -> Tool:
1463
1497
  """
1464
1498
  Creates or updates a tool. This stores the source code of function on the server, so that the server can execute the function and generate an OpenAI JSON schemas for it when using with an agent.
@@ -1467,6 +1501,7 @@ class RESTClient(AbstractClient):
1467
1501
  func (callable): The function to create a tool for.
1468
1502
  name: (str): Name of the tool (must be unique per-user.)
1469
1503
  tags (Optional[List[str]], optional): Tags for the tool. Defaults to None.
1504
+ return_char_limit (int): The character limit for the tool's return value. Defaults to FUNCTION_RETURN_CHAR_LIMIT.
1470
1505
 
1471
1506
  Returns:
1472
1507
  tool (Tool): The created tool.
@@ -1475,7 +1510,9 @@ class RESTClient(AbstractClient):
1475
1510
  source_type = "python"
1476
1511
 
1477
1512
  # call server function
1478
- request = ToolCreate(source_type=source_type, source_code=source_code, name=name, tags=tags)
1513
+ request = ToolCreate(source_type=source_type, source_code=source_code, name=name, return_char_limit=return_char_limit)
1514
+ if tags:
1515
+ request.tags = tags
1479
1516
  response = requests.put(f"{self.base_url}/{self.api_prefix}/tools", json=request.model_dump(), headers=self.headers)
1480
1517
  if response.status_code != 200:
1481
1518
  raise ValueError(f"Failed to create tool: {response.text}")
@@ -1488,6 +1525,7 @@ class RESTClient(AbstractClient):
1488
1525
  description: Optional[str] = None,
1489
1526
  func: Optional[Callable] = None,
1490
1527
  tags: Optional[List[str]] = None,
1528
+ return_char_limit: int = FUNCTION_RETURN_CHAR_LIMIT,
1491
1529
  ) -> Tool:
1492
1530
  """
1493
1531
  Update a tool with provided parameters (name, func, tags)
@@ -1497,6 +1535,7 @@ class RESTClient(AbstractClient):
1497
1535
  name (str): Name of the tool
1498
1536
  func (callable): Function to wrap in a tool
1499
1537
  tags (List[str]): Tags for the tool
1538
+ return_char_limit (int): The character limit for the tool's return value. Defaults to FUNCTION_RETURN_CHAR_LIMIT.
1500
1539
 
1501
1540
  Returns:
1502
1541
  tool (Tool): Updated tool
@@ -1508,7 +1547,14 @@ class RESTClient(AbstractClient):
1508
1547
 
1509
1548
  source_type = "python"
1510
1549
 
1511
- request = ToolUpdate(description=description, source_type=source_type, source_code=source_code, tags=tags, name=name)
1550
+ request = ToolUpdate(
1551
+ description=description,
1552
+ source_type=source_type,
1553
+ source_code=source_code,
1554
+ tags=tags,
1555
+ name=name,
1556
+ return_char_limit=return_char_limit,
1557
+ )
1512
1558
  response = requests.patch(f"{self.base_url}/{self.api_prefix}/tools/{id}", json=request.model_dump(), headers=self.headers)
1513
1559
  if response.status_code != 200:
1514
1560
  raise ValueError(f"Failed to update tool: {response.text}")
@@ -2693,6 +2739,7 @@ class LocalClient(AbstractClient):
2693
2739
  name: Optional[str] = None,
2694
2740
  tags: Optional[List[str]] = None,
2695
2741
  description: Optional[str] = None,
2742
+ return_char_limit: int = FUNCTION_RETURN_CHAR_LIMIT,
2696
2743
  ) -> Tool:
2697
2744
  """
2698
2745
  Create a tool. This stores the source code of function on the server, so that the server can execute the function and generate an OpenAI JSON schemas for it when using with an agent.
@@ -2702,6 +2749,7 @@ class LocalClient(AbstractClient):
2702
2749
  name: (str): Name of the tool (must be unique per-user.)
2703
2750
  tags (Optional[List[str]], optional): Tags for the tool. Defaults to None.
2704
2751
  description (str, optional): The description.
2752
+ return_char_limit (int): The character limit for the tool's return value. Defaults to FUNCTION_RETURN_CHAR_LIMIT.
2705
2753
 
2706
2754
  Returns:
2707
2755
  tool (Tool): The created tool.
@@ -2722,6 +2770,7 @@ class LocalClient(AbstractClient):
2722
2770
  name=name,
2723
2771
  tags=tags,
2724
2772
  description=description,
2773
+ return_char_limit=return_char_limit,
2725
2774
  ),
2726
2775
  actor=self.user,
2727
2776
  )
@@ -2732,6 +2781,7 @@ class LocalClient(AbstractClient):
2732
2781
  name: Optional[str] = None,
2733
2782
  tags: Optional[List[str]] = None,
2734
2783
  description: Optional[str] = None,
2784
+ return_char_limit: int = FUNCTION_RETURN_CHAR_LIMIT,
2735
2785
  ) -> Tool:
2736
2786
  """
2737
2787
  Creates or updates a tool. This stores the source code of function on the server, so that the server can execute the function and generate an OpenAI JSON schemas for it when using with an agent.
@@ -2741,6 +2791,7 @@ class LocalClient(AbstractClient):
2741
2791
  name: (str): Name of the tool (must be unique per-user.)
2742
2792
  tags (Optional[List[str]], optional): Tags for the tool. Defaults to None.
2743
2793
  description (str, optional): The description.
2794
+ return_char_limit (int): The character limit for the tool's return value. Defaults to FUNCTION_RETURN_CHAR_LIMIT.
2744
2795
 
2745
2796
  Returns:
2746
2797
  tool (Tool): The created tool.
@@ -2758,6 +2809,7 @@ class LocalClient(AbstractClient):
2758
2809
  name=name,
2759
2810
  tags=tags,
2760
2811
  description=description,
2812
+ return_char_limit=return_char_limit,
2761
2813
  ),
2762
2814
  actor=self.user,
2763
2815
  )
@@ -2769,6 +2821,7 @@ class LocalClient(AbstractClient):
2769
2821
  description: Optional[str] = None,
2770
2822
  func: Optional[callable] = None,
2771
2823
  tags: Optional[List[str]] = None,
2824
+ return_char_limit: int = FUNCTION_RETURN_CHAR_LIMIT,
2772
2825
  ) -> Tool:
2773
2826
  """
2774
2827
  Update a tool with provided parameters (name, func, tags)
@@ -2778,6 +2831,7 @@ class LocalClient(AbstractClient):
2778
2831
  name (str): Name of the tool
2779
2832
  func (callable): Function to wrap in a tool
2780
2833
  tags (List[str]): Tags for the tool
2834
+ return_char_limit (int): The character limit for the tool's return value. Defaults to FUNCTION_RETURN_CHAR_LIMIT.
2781
2835
 
2782
2836
  Returns:
2783
2837
  tool (Tool): Updated tool
@@ -2788,6 +2842,7 @@ class LocalClient(AbstractClient):
2788
2842
  "tags": tags,
2789
2843
  "name": name,
2790
2844
  "description": description,
2845
+ "return_char_limit": return_char_limit,
2791
2846
  }
2792
2847
 
2793
2848
  # Filter out any None values from the dictionary
@@ -2836,7 +2891,7 @@ class LocalClient(AbstractClient):
2836
2891
  id (str): ID of the tool (`None` if not found)
2837
2892
  """
2838
2893
  tool = self.server.tool_manager.get_tool_by_name(tool_name=name, actor=self.user)
2839
- return tool.id
2894
+ return tool.id if tool else None
2840
2895
 
2841
2896
  def load_data(self, connector: DataConnector, source_name: str):
2842
2897
  """
@@ -2896,6 +2951,7 @@ class LocalClient(AbstractClient):
2896
2951
  Returns:
2897
2952
  source (Source): Created source
2898
2953
  """
2954
+ assert embedding_config or self._default_embedding_config, f"Must specify embedding_config for source"
2899
2955
  source = Source(
2900
2956
  name=name, embedding_config=embedding_config or self._default_embedding_config, organization_id=self.user.organization_id
2901
2957
  )
@@ -22,6 +22,30 @@ class LettaToolCreateError(LettaError):
22
22
  super().__init__(self.message)
23
23
 
24
24
 
25
+ class LettaConfigurationError(LettaError):
26
+ """Error raised when there are configuration-related issues."""
27
+
28
+ def __init__(self, message: str, missing_fields: Optional[List[str]] = None):
29
+ self.missing_fields = missing_fields or []
30
+ super().__init__(message)
31
+
32
+
33
+ class LettaAgentNotFoundError(LettaError):
34
+ """Error raised when an agent is not found."""
35
+
36
+ def __init__(self, message: str):
37
+ self.message = message
38
+ super().__init__(self.message)
39
+
40
+
41
+ class LettaUserNotFoundError(LettaError):
42
+ """Error raised when a user is not found."""
43
+
44
+ def __init__(self, message: str):
45
+ self.message = message
46
+ super().__init__(self.message)
47
+
48
+
25
49
  class LLMError(LettaError):
26
50
  pass
27
51
 
@@ -5,6 +5,7 @@ from typing import List, Optional, Union
5
5
  import requests
6
6
 
7
7
  from letta.constants import CLI_WARNING_PREFIX
8
+ from letta.errors import LettaConfigurationError
8
9
  from letta.llm_api.anthropic import anthropic_chat_completions_request
9
10
  from letta.llm_api.azure_openai import azure_openai_chat_completions_request
10
11
  from letta.llm_api.google_ai import (
@@ -148,7 +149,7 @@ def create(
148
149
  if llm_config.model_endpoint_type == "openai":
149
150
  if model_settings.openai_api_key is None and llm_config.model_endpoint == "https://api.openai.com/v1":
150
151
  # only is a problem if we are *not* using an openai proxy
151
- raise ValueError(f"OpenAI key is missing from letta config file")
152
+ raise LettaConfigurationError(message="OpenAI key is missing from letta config file", missing_fields=["openai_api_key"])
152
153
 
153
154
  data = build_openai_chat_completions_request(llm_config, messages, user_id, functions, function_call, use_tool_naming, max_tokens)
154
155
  if stream: # Client requested token streaming
@@ -187,13 +188,19 @@ def create(
187
188
  raise NotImplementedError(f"Streaming not yet implemented for {llm_config.model_endpoint_type}")
188
189
 
189
190
  if model_settings.azure_api_key is None:
190
- raise ValueError(f"Azure API key is missing. Did you set AZURE_API_KEY in your env?")
191
+ raise LettaConfigurationError(
192
+ message="Azure API key is missing. Did you set AZURE_API_KEY in your env?", missing_fields=["azure_api_key"]
193
+ )
191
194
 
192
195
  if model_settings.azure_base_url is None:
193
- raise ValueError(f"Azure base url is missing. Did you set AZURE_BASE_URL in your env?")
196
+ raise LettaConfigurationError(
197
+ message="Azure base url is missing. Did you set AZURE_BASE_URL in your env?", missing_fields=["azure_base_url"]
198
+ )
194
199
 
195
200
  if model_settings.azure_api_version is None:
196
- raise ValueError(f"Azure API version is missing. Did you set AZURE_API_VERSION in your env?")
201
+ raise LettaConfigurationError(
202
+ message="Azure API version is missing. Did you set AZURE_API_VERSION in your env?", missing_fields=["azure_api_version"]
203
+ )
197
204
 
198
205
  # Set the llm config model_endpoint from model_settings
199
206
  # For Azure, this model_endpoint is required to be configured via env variable, so users don't need to provide it in the LLM config
@@ -291,7 +298,7 @@ def create(
291
298
  raise NotImplementedError(f"Streaming not yet implemented for Groq.")
292
299
 
293
300
  if model_settings.groq_api_key is None and llm_config.model_endpoint == "https://api.groq.com/openai/v1/chat/completions":
294
- raise ValueError(f"Groq key is missing from letta config file")
301
+ raise LettaConfigurationError(message="Groq key is missing from letta config file", missing_fields=["groq_api_key"])
295
302
 
296
303
  # force to true for groq, since they don't support 'content' is non-null
297
304
  if llm_config.put_inner_thoughts_in_kwargs:
@@ -344,7 +351,7 @@ def create(
344
351
  raise NotImplementedError(f"Streaming not yet implemented for TogetherAI (via the /completions endpoint).")
345
352
 
346
353
  if model_settings.together_api_key is None and llm_config.model_endpoint == "https://api.together.ai/v1/completions":
347
- raise ValueError(f"TogetherAI key is missing from letta config file")
354
+ raise LettaConfigurationError(message="TogetherAI key is missing from letta config file", missing_fields=["together_api_key"])
348
355
 
349
356
  return get_chat_completion(
350
357
  model=llm_config.model,
@@ -191,7 +191,6 @@ def run_agent_loop(
191
191
  print(f"\nDumping memory contents:\n")
192
192
  print(f"{letta_agent.agent_state.memory.compile()}")
193
193
  print(f"{letta_agent.archival_memory.compile()}")
194
- print(f"{letta_agent.recall_memory.compile()}")
195
194
  continue
196
195
 
197
196
  elif user_input.lower() == "/model":
@@ -150,11 +150,8 @@ class OfflineMemoryAgent(Agent):
150
150
  step_count = 0
151
151
 
152
152
  while counter < self.max_memory_rethinks:
153
- # This is hacky but we need to do this for now
154
- # TODO: REMOVE THIS
155
- for m in next_input_message:
156
- m.id = m._generate_id()
157
-
153
+ if counter > 0:
154
+ next_input_message = []
158
155
  kwargs["ms"] = ms
159
156
  kwargs["first_message"] = False
160
157
  step_response = self.inner_step(
@@ -187,7 +187,7 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
187
187
  logger.exception(f"Failed to hard delete {self.__class__.__name__} with ID {self.id}")
188
188
  raise ValueError(f"Failed to hard delete {self.__class__.__name__} with ID {self.id}: {e}")
189
189
  else:
190
- logger.info(f"{self.__class__.__name__} with ID {self.id} successfully hard deleted")
190
+ logger.debug(f"{self.__class__.__name__} with ID {self.id} successfully hard deleted")
191
191
 
192
192
  def update(self, db_session: "Session", actor: Optional["User"] = None) -> Type["SqlalchemyBase"]:
193
193
  logger.debug(f"Updating {self.__class__.__name__} with ID: {self.id} with actor={actor}")
@@ -30,6 +30,7 @@ class Tool(SqlalchemyBase, OrganizationMixin):
30
30
  __table_args__ = (UniqueConstraint("name", "organization_id", name="uix_name_organization"),)
31
31
 
32
32
  name: Mapped[str] = mapped_column(doc="The display name of the tool.")
33
+ return_char_limit: Mapped[int] = mapped_column(nullable=True, doc="The maximum number of characters the tool can return.")
33
34
  description: Mapped[Optional[str]] = mapped_column(nullable=True, doc="The description of the tool.")
34
35
  tags: Mapped[List] = mapped_column(JSON, doc="Metadata tags used to filter tools.")
35
36
  source_type: Mapped[ToolSourceType] = mapped_column(String, doc="The type of the source code.", default=ToolSourceType.json)
@@ -45,19 +46,16 @@ class Tool(SqlalchemyBase, OrganizationMixin):
45
46
 
46
47
 
47
48
  # Add event listener to update tool_name in ToolsAgents when Tool name changes
48
- @event.listens_for(Tool, 'before_update')
49
+ @event.listens_for(Tool, "before_update")
49
50
  def update_tool_name_in_tools_agents(mapper, connection, target):
50
51
  """Update tool_name in ToolsAgents when Tool name changes."""
51
52
  state = target._sa_instance_state
52
- history = state.get_history('name', passive=True)
53
+ history = state.get_history("name", passive=True)
53
54
  if not history.has_changes():
54
55
  return
55
-
56
+
56
57
  # Get the new name and update all associated ToolsAgents records
57
58
  new_name = target.name
58
59
  from letta.orm.tools_agents import ToolsAgents
59
- connection.execute(
60
- ToolsAgents.__table__.update().where(
61
- ToolsAgents.tool_id == target.id
62
- ).values(tool_name=new_name)
63
- )
60
+
61
+ connection.execute(ToolsAgents.__table__.update().where(ToolsAgents.tool_id == target.id).values(tool_name=new_name))
@@ -481,7 +481,20 @@ class Message(BaseMessage):
481
481
  return f"<{xml_tag}>{string}</{xml_tag}" if xml_tag else string
482
482
 
483
483
  if self.role == "system":
484
- raise ValueError(f"Anthropic 'system' role not supported")
484
+ # NOTE: this is not for system instructions, but instead system "events"
485
+
486
+ assert all([v is not None for v in [self.text, self.role]]), vars(self)
487
+ # Two options here, we would use system.package_system_message,
488
+ # or use a more Anthropic-specific packaging ie xml tags
489
+ user_system_event = add_xml_tag(string=f"SYSTEM ALERT: {self.text}", xml_tag="event")
490
+ anthropic_message = {
491
+ "content": user_system_event,
492
+ "role": "user",
493
+ }
494
+
495
+ # Optional field, do not include if null
496
+ if self.name is not None:
497
+ anthropic_message["name"] = self.name
485
498
 
486
499
  elif self.role == "user":
487
500
  assert all([v is not None for v in [self.text, self.role]]), vars(self)
@@ -2,6 +2,7 @@ from typing import Dict, List, Optional
2
2
 
3
3
  from pydantic import Field, model_validator
4
4
 
5
+ from letta.constants import FUNCTION_RETURN_CHAR_LIMIT
5
6
  from letta.functions.functions import derive_openai_json_schema
6
7
  from letta.functions.helpers import (
7
8
  generate_composio_tool_wrapper,
@@ -41,6 +42,9 @@ class Tool(BaseTool):
41
42
  source_code: str = Field(..., description="The source code of the function.")
42
43
  json_schema: Optional[Dict] = Field(None, description="The JSON schema of the function.")
43
44
 
45
+ # tool configuration
46
+ return_char_limit: int = Field(FUNCTION_RETURN_CHAR_LIMIT, description="The maximum number of characters in the response.")
47
+
44
48
  # metadata fields
45
49
  created_by_id: Optional[str] = Field(None, description="The id of the user that made this Tool.")
46
50
  last_updated_by_id: Optional[str] = Field(None, description="The id of the user that made this Tool.")
@@ -91,6 +95,7 @@ class ToolCreate(LettaBase):
91
95
  json_schema: Optional[Dict] = Field(
92
96
  None, description="The JSON schema of the function (auto-generated from source_code if not provided)"
93
97
  )
98
+ return_char_limit: int = Field(FUNCTION_RETURN_CHAR_LIMIT, description="The maximum number of characters in the response.")
94
99
 
95
100
  @classmethod
96
101
  def from_composio(cls, action_name: str, api_key: Optional[str] = None) -> "ToolCreate":
@@ -13,6 +13,7 @@ from starlette.middleware.cors import CORSMiddleware
13
13
 
14
14
  from letta.__init__ import __version__
15
15
  from letta.constants import ADMIN_PREFIX, API_PREFIX, OPENAI_API_PREFIX
16
+ from letta.errors import LettaAgentNotFoundError, LettaUserNotFoundError
16
17
  from letta.schemas.letta_response import LettaResponse
17
18
  from letta.server.constants import REST_DEFAULT_PORT
18
19
 
@@ -144,6 +145,35 @@ def create_application() -> "FastAPI":
144
145
  debug=True,
145
146
  )
146
147
 
148
+ @app.exception_handler(Exception)
149
+ async def generic_error_handler(request, exc):
150
+ # Log the actual error for debugging
151
+ log.error(f"Unhandled error: {exc}", exc_info=True)
152
+
153
+ # Print the stack trace
154
+ print(f"Stack trace: {exc.__traceback__}")
155
+ if (os.getenv("SENTRY_DSN") is not None) and (os.getenv("SENTRY_DSN") != ""):
156
+ import sentry_sdk
157
+
158
+ sentry_sdk.capture_exception(exc)
159
+
160
+ return JSONResponse(
161
+ status_code=500,
162
+ content={
163
+ "detail": "An internal server error occurred",
164
+ # Only include error details in debug/development mode
165
+ # "debug_info": str(exc) if settings.debug else None
166
+ },
167
+ )
168
+
169
+ @app.exception_handler(LettaAgentNotFoundError)
170
+ async def agent_not_found_handler(request, exc):
171
+ return JSONResponse(status_code=404, content={"detail": "Agent not found"})
172
+
173
+ @app.exception_handler(LettaUserNotFoundError)
174
+ async def user_not_found_handler(request, exc):
175
+ return JSONResponse(status_code=404, content={"detail": "User not found"})
176
+
147
177
  settings.cors_origins.append("https://app.letta.com")
148
178
  print(f"▶ View using ADE at: https://app.letta.com/development-servers/local/dashboard")
149
179