letta-nightly 0.6.32.dev20250225104119__tar.gz → 0.6.33.dev20250226015402__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 (266) hide show
  1. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/PKG-INFO +1 -1
  2. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/__init__.py +1 -1
  3. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/agent.py +10 -5
  4. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/constants.py +7 -0
  5. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/functions/ast_parsers.py +13 -0
  6. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/functions/schema_generator.py +14 -2
  7. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/helpers/composio_helpers.py +3 -2
  8. letta_nightly-0.6.33.dev20250226015402/letta/helpers/tool_execution_helper.py +171 -0
  9. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/anthropic.py +37 -1
  10. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/source.py +2 -2
  11. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/openai/chat_completion_request.py +1 -1
  12. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/providers.py +43 -4
  13. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/tool.py +1 -13
  14. letta_nightly-0.6.33.dev20250226015402/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +425 -0
  15. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/agents.py +57 -55
  16. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/blocks.py +12 -12
  17. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/identities.py +12 -12
  18. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/jobs.py +8 -8
  19. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/providers.py +11 -5
  20. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/runs.py +12 -12
  21. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/sandbox_configs.py +24 -24
  22. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/sources.py +20 -20
  23. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/steps.py +8 -7
  24. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/tags.py +2 -2
  25. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/tools.py +20 -20
  26. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/utils.py +2 -3
  27. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/agent_manager.py +36 -0
  28. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/block_manager.py +4 -2
  29. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/identity_manager.py +6 -0
  30. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/message_manager.py +4 -1
  31. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/provider_manager.py +10 -9
  32. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/step_manager.py +2 -2
  33. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/pyproject.toml +1 -1
  34. letta_nightly-0.6.32.dev20250225104119/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -235
  35. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/LICENSE +0 -0
  36. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/README.md +0 -0
  37. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/__main__.py +0 -0
  38. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/benchmark/benchmark.py +0 -0
  39. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/benchmark/constants.py +0 -0
  40. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/chat_only_agent.py +0 -0
  41. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/cli/cli.py +0 -0
  42. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/cli/cli_config.py +0 -0
  43. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/cli/cli_load.py +0 -0
  44. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/client/__init__.py +0 -0
  45. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/client/client.py +0 -0
  46. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/client/streaming.py +0 -0
  47. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/client/utils.py +0 -0
  48. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/config.py +0 -0
  49. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/data_sources/connectors.py +0 -0
  50. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/data_sources/connectors_helper.py +0 -0
  51. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/embeddings.py +0 -0
  52. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/errors.py +0 -0
  53. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/functions/__init__.py +0 -0
  54. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/functions/function_sets/base.py +0 -0
  55. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/functions/function_sets/extras.py +0 -0
  56. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/functions/function_sets/multi_agent.py +0 -0
  57. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/functions/functions.py +0 -0
  58. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/functions/helpers.py +0 -0
  59. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/functions/interface.py +0 -0
  60. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/helpers/__init__.py +0 -0
  61. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/helpers/converters.py +0 -0
  62. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/helpers/datetime_helpers.py +0 -0
  63. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/helpers/json_helpers.py +0 -0
  64. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/helpers/tool_rule_solver.py +0 -0
  65. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/humans/__init__.py +0 -0
  66. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/humans/examples/basic.txt +0 -0
  67. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/humans/examples/cs_phd.txt +0 -0
  68. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/interface.py +0 -0
  69. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/__init__.py +0 -0
  70. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/aws_bedrock.py +0 -0
  71. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/azure_openai.py +0 -0
  72. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/azure_openai_constants.py +0 -0
  73. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/cohere.py +0 -0
  74. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/deepseek.py +0 -0
  75. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/google_ai.py +0 -0
  76. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/google_constants.py +0 -0
  77. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/google_vertex.py +0 -0
  78. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/helpers.py +0 -0
  79. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/llm_api_tools.py +0 -0
  80. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/mistral.py +0 -0
  81. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/llm_api/openai.py +0 -0
  82. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/README.md +0 -0
  83. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/__init__.py +0 -0
  84. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/chat_completion_proxy.py +0 -0
  85. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/constants.py +0 -0
  86. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/function_parser.py +0 -0
  87. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/grammars/__init__.py +0 -0
  88. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
  89. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/grammars/json.gbnf +0 -0
  90. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
  91. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/json_parser.py +0 -0
  92. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/koboldcpp/api.py +0 -0
  93. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/koboldcpp/settings.py +0 -0
  94. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llamacpp/api.py +0 -0
  95. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llamacpp/settings.py +0 -0
  96. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
  97. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
  98. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
  99. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
  100. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
  101. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
  102. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
  103. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
  104. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
  105. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/lmstudio/api.py +0 -0
  106. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/lmstudio/settings.py +0 -0
  107. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/ollama/api.py +0 -0
  108. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/ollama/settings.py +0 -0
  109. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/settings/__init__.py +0 -0
  110. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
  111. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/settings/settings.py +0 -0
  112. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/settings/simple.py +0 -0
  113. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/utils.py +0 -0
  114. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/vllm/api.py +0 -0
  115. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/webui/api.py +0 -0
  116. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/webui/legacy_api.py +0 -0
  117. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/webui/legacy_settings.py +0 -0
  118. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/local_llm/webui/settings.py +0 -0
  119. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/log.py +0 -0
  120. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/main.py +0 -0
  121. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/memory.py +0 -0
  122. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/offline_memory_agent.py +0 -0
  123. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/openai_backcompat/__init__.py +0 -0
  124. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/openai_backcompat/openai_object.py +0 -0
  125. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/__all__.py +0 -0
  126. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/__init__.py +0 -0
  127. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/agent.py +0 -0
  128. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/agents_tags.py +0 -0
  129. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/base.py +0 -0
  130. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/block.py +0 -0
  131. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/blocks_agents.py +0 -0
  132. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/custom_columns.py +0 -0
  133. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/enums.py +0 -0
  134. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/errors.py +0 -0
  135. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/file.py +0 -0
  136. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/identities_agents.py +0 -0
  137. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/identity.py +0 -0
  138. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/job.py +0 -0
  139. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/job_messages.py +0 -0
  140. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/message.py +0 -0
  141. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/mixins.py +0 -0
  142. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/organization.py +0 -0
  143. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/passage.py +0 -0
  144. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/provider.py +0 -0
  145. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/sandbox_config.py +0 -0
  146. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/sources_agents.py +0 -0
  147. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/sqlalchemy_base.py +0 -0
  148. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/sqlite_functions.py +0 -0
  149. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/step.py +0 -0
  150. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/tool.py +0 -0
  151. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/tools_agents.py +0 -0
  152. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/orm/user.py +0 -0
  153. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/__init__.py +0 -0
  154. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/examples/anna_pa.txt +0 -0
  155. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/examples/google_search_persona.txt +0 -0
  156. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/examples/memgpt_doc.txt +0 -0
  157. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/examples/memgpt_starter.txt +0 -0
  158. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/examples/o1_persona.txt +0 -0
  159. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/examples/offline_memory_persona.txt +0 -0
  160. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/examples/sam.txt +0 -0
  161. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/examples/sam_pov.txt +0 -0
  162. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
  163. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/personas/examples/sqldb/test.db +0 -0
  164. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/__init__.py +0 -0
  165. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/gpt_summarize.py +0 -0
  166. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/gpt_system.py +0 -0
  167. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_base.txt +0 -0
  168. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_chat.txt +0 -0
  169. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
  170. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
  171. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_convo_only.txt +0 -0
  172. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_doc.txt +0 -0
  173. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
  174. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
  175. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
  176. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
  177. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
  178. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
  179. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/pytest.ini +0 -0
  180. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/agent.py +0 -0
  181. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/block.py +0 -0
  182. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/embedding_config.py +0 -0
  183. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/embedding_config_overrides.py +0 -0
  184. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/enums.py +0 -0
  185. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/environment_variables.py +0 -0
  186. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/file.py +0 -0
  187. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/health.py +0 -0
  188. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/identity.py +0 -0
  189. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/job.py +0 -0
  190. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/letta_base.py +0 -0
  191. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/letta_message.py +0 -0
  192. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/letta_request.py +0 -0
  193. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/letta_response.py +0 -0
  194. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/llm_config.py +0 -0
  195. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/llm_config_overrides.py +0 -0
  196. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/memory.py +0 -0
  197. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/message.py +0 -0
  198. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/openai/chat_completion_response.py +0 -0
  199. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/openai/chat_completions.py +0 -0
  200. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/openai/embedding_response.py +0 -0
  201. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/openai/openai.py +0 -0
  202. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/organization.py +0 -0
  203. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/passage.py +0 -0
  204. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/run.py +0 -0
  205. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/sandbox_config.py +0 -0
  206. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/source.py +0 -0
  207. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/step.py +0 -0
  208. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/tool_rule.py +0 -0
  209. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/usage.py +0 -0
  210. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/schemas/user.py +0 -0
  211. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/serialize_schemas/__init__.py +0 -0
  212. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/serialize_schemas/agent.py +0 -0
  213. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/serialize_schemas/base.py +0 -0
  214. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/serialize_schemas/custom_fields.py +0 -0
  215. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/serialize_schemas/message.py +0 -0
  216. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/__init__.py +0 -0
  217. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/constants.py +0 -0
  218. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/db.py +0 -0
  219. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/generate_openapi_schema.sh +0 -0
  220. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/__init__.py +0 -0
  221. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/app.py +0 -0
  222. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/auth/__init__.py +0 -0
  223. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/auth/index.py +0 -0
  224. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/auth_token.py +0 -0
  225. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/chat_completions_interface.py +0 -0
  226. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/interface.py +0 -0
  227. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/optimistic_json_parser.py +0 -0
  228. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/__init__.py +0 -0
  229. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
  230. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/__init__.py +0 -0
  231. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/health.py +0 -0
  232. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/llms.py +0 -0
  233. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/organizations.py +0 -0
  234. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/routers/v1/users.py +0 -0
  235. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/rest_api/static_files.py +0 -0
  236. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/server.py +0 -0
  237. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/startup.sh +0 -0
  238. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/static_files/assets/index-048c9598.js +0 -0
  239. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/static_files/assets/index-0e31b727.css +0 -0
  240. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/static_files/favicon.ico +0 -0
  241. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/static_files/index.html +0 -0
  242. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
  243. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/utils.py +0 -0
  244. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/ws_api/__init__.py +0 -0
  245. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/ws_api/example_client.py +0 -0
  246. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/ws_api/interface.py +0 -0
  247. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/ws_api/protocol.py +0 -0
  248. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/server/ws_api/server.py +0 -0
  249. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/__init__.py +0 -0
  250. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/helpers/agent_manager_helper.py +0 -0
  251. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/helpers/tool_execution_helper.py +0 -0
  252. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/job_manager.py +0 -0
  253. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/organization_manager.py +0 -0
  254. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/passage_manager.py +0 -0
  255. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/per_agent_lock_manager.py +0 -0
  256. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/sandbox_config_manager.py +0 -0
  257. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/source_manager.py +0 -0
  258. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/tool_execution_sandbox.py +0 -0
  259. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/tool_manager.py +0 -0
  260. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/services/user_manager.py +0 -0
  261. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/settings.py +0 -0
  262. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/streaming_interface.py +0 -0
  263. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/streaming_utils.py +0 -0
  264. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/system.py +0 -0
  265. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/tracing.py +0 -0
  266. {letta_nightly-0.6.32.dev20250225104119 → letta_nightly-0.6.33.dev20250226015402}/letta/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-nightly
3
- Version: 0.6.32.dev20250225104119
3
+ Version: 0.6.33.dev20250226015402
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.32"
1
+ __version__ = "0.6.33"
2
2
 
3
3
  # import clients
4
4
  from letta.client.client import LocalClient, RESTClient, create_client
@@ -245,10 +245,13 @@ class Agent(BaseAgent):
245
245
  action_name=action_name, args=function_args, api_key=composio_api_key, entity_id=entity_id
246
246
  )
247
247
  else:
248
- # Parse the source code to extract function annotations
249
- annotations = get_function_annotations_from_source(target_letta_tool.source_code, function_name)
250
- # Coerce the function arguments to the correct types based on the annotations
251
- function_args = coerce_dict_args_by_annotations(function_args, annotations)
248
+ try:
249
+ # Parse the source code to extract function annotations
250
+ annotations = get_function_annotations_from_source(target_letta_tool.source_code, function_name)
251
+ # Coerce the function arguments to the correct types based on the annotations
252
+ function_args = coerce_dict_args_by_annotations(function_args, annotations)
253
+ except ValueError as e:
254
+ self.logger.debug(f"Error coercing function arguments: {e}")
252
255
 
253
256
  # execute tool in a sandbox
254
257
  # TODO: allow agent_state to specify which sandbox to execute tools in
@@ -257,7 +260,9 @@ class Agent(BaseAgent):
257
260
  agent_state_copy.tools = []
258
261
  agent_state_copy.tool_rules = []
259
262
 
260
- sandbox_run_result = ToolExecutionSandbox(function_name, function_args, self.user).run(agent_state=agent_state_copy)
263
+ sandbox_run_result = ToolExecutionSandbox(function_name, function_args, self.user, tool_object=target_letta_tool).run(
264
+ agent_state=agent_state_copy
265
+ )
261
266
  function_response, updated_agent_state = sandbox_run_result.func_return, sandbox_run_result.agent_state
262
267
  assert orig_memory_str == self.agent_state.memory.compile(), "Memory should not be modified in a sandbox tool"
263
268
  if updated_agent_state is not None:
@@ -52,6 +52,8 @@ BASE_TOOLS = ["send_message", "conversation_search", "archival_memory_insert", "
52
52
  BASE_MEMORY_TOOLS = ["core_memory_append", "core_memory_replace"]
53
53
  # Multi agent tools
54
54
  MULTI_AGENT_TOOLS = ["send_message_to_agent_and_wait_for_reply", "send_message_to_agents_matching_all_tags", "send_message_to_agent_async"]
55
+ # Set of all built-in Letta tools
56
+ LETTA_TOOL_SET = set(BASE_TOOLS + BASE_MEMORY_TOOLS + MULTI_AGENT_TOOLS)
55
57
 
56
58
  # The name of the tool used to send message to the user
57
59
  # May not be relevant in cases where the agent has multiple ways to message to user (send_imessage, send_discord_mesasge, ...)
@@ -59,6 +61,11 @@ MULTI_AGENT_TOOLS = ["send_message_to_agent_and_wait_for_reply", "send_message_t
59
61
  DEFAULT_MESSAGE_TOOL = "send_message"
60
62
  DEFAULT_MESSAGE_TOOL_KWARG = "message"
61
63
 
64
+ PRE_EXECUTION_MESSAGE_ARG = "pre_exec_msg"
65
+
66
+ REQUEST_HEARTBEAT_PARAM = "request_heartbeat"
67
+
68
+
62
69
  # Structured output models
63
70
  STRUCTURED_OUTPUT_MODELS = {"gpt-4o", "gpt-4o-mini"}
64
71
 
@@ -32,6 +32,19 @@ def resolve_type(annotation: str):
32
32
  return BUILTIN_TYPES[annotation]
33
33
 
34
34
  try:
35
+ if annotation.startswith("list["):
36
+ inner_type = annotation[len("list[") : -1]
37
+ resolve_type(inner_type)
38
+ return list
39
+ elif annotation.startswith("dict["):
40
+ inner_types = annotation[len("dict[") : -1]
41
+ key_type, value_type = inner_types.split(",")
42
+ return dict
43
+ elif annotation.startswith("tuple["):
44
+ inner_types = annotation[len("tuple[") : -1]
45
+ [resolve_type(t.strip()) for t in inner_types.split(",")]
46
+ return tuple
47
+
35
48
  parsed = ast.literal_eval(annotation)
36
49
  if isinstance(parsed, type):
37
50
  return parsed
@@ -229,12 +229,24 @@ def pydantic_model_to_json_schema(model: Type[BaseModel]) -> dict:
229
229
  """
230
230
  schema = model.model_json_schema()
231
231
 
232
- def clean_property(prop: dict) -> dict:
232
+ def clean_property(prop: dict, full_schema: dict) -> dict:
233
233
  """Clean up a property schema to match desired format"""
234
234
 
235
235
  if "description" not in prop:
236
236
  raise ValueError(f"Property {prop} lacks a 'description' key")
237
237
 
238
+ # Handle the case where the property is a $ref to another model
239
+ if "$ref" in prop:
240
+ # Resolve the reference to the nested model
241
+ ref_schema = resolve_ref(prop["$ref"], full_schema)
242
+ # Recursively clean the nested model
243
+ return {
244
+ "type": "object",
245
+ **clean_schema(ref_schema, full_schema),
246
+ "description": prop["description"],
247
+ }
248
+
249
+ # If it's a regular property with a direct type (e.g., string, number)
238
250
  return {
239
251
  "type": "string" if prop["type"] == "string" else prop["type"],
240
252
  "description": prop["description"],
@@ -283,7 +295,7 @@ def pydantic_model_to_json_schema(model: Type[BaseModel]) -> dict:
283
295
  "description": prop["description"],
284
296
  }
285
297
  else:
286
- properties[name] = clean_property(prop)
298
+ properties[name] = clean_property(prop, full_schema)
287
299
 
288
300
  pydantic_model_schema_dict = {
289
301
  "type": "object",
@@ -6,10 +6,11 @@ from letta.services.sandbox_config_manager import SandboxConfigManager
6
6
  from letta.settings import tool_settings
7
7
 
8
8
 
9
- def get_composio_api_key(actor: User, logger: Logger) -> Optional[str]:
9
+ def get_composio_api_key(actor: User, logger: Optional[Logger] = None) -> Optional[str]:
10
10
  api_keys = SandboxConfigManager().list_sandbox_env_vars_by_key(key="COMPOSIO_API_KEY", actor=actor)
11
11
  if not api_keys:
12
- logger.warning(f"No API keys found for Composio. Defaulting to the environment variable...")
12
+ if logger:
13
+ logger.warning(f"No API keys found for Composio. Defaulting to the environment variable...")
13
14
  if tool_settings.composio_api_key:
14
15
  return tool_settings.composio_api_key
15
16
  else:
@@ -0,0 +1,171 @@
1
+ from collections import OrderedDict
2
+ from typing import Any, Dict, Optional
3
+
4
+ from letta.constants import COMPOSIO_ENTITY_ENV_VAR_KEY, PRE_EXECUTION_MESSAGE_ARG
5
+ from letta.functions.ast_parsers import coerce_dict_args_by_annotations, get_function_annotations_from_source
6
+ from letta.functions.helpers import execute_composio_action, generate_composio_action_from_func_name
7
+ from letta.helpers.composio_helpers import get_composio_api_key
8
+ from letta.orm.enums import ToolType
9
+ from letta.schemas.agent import AgentState
10
+ from letta.schemas.sandbox_config import SandboxRunResult
11
+ from letta.schemas.tool import Tool
12
+ from letta.schemas.user import User
13
+ from letta.services.tool_execution_sandbox import ToolExecutionSandbox
14
+ from letta.utils import get_friendly_error_msg
15
+
16
+
17
+ def enable_strict_mode(tool_schema: Dict[str, Any]) -> Dict[str, Any]:
18
+ """Enables strict mode for a tool schema by setting 'strict' to True and
19
+ disallowing additional properties in the parameters.
20
+
21
+ Args:
22
+ tool_schema (Dict[str, Any]): The original tool schema.
23
+
24
+ Returns:
25
+ Dict[str, Any]: A new tool schema with strict mode enabled.
26
+ """
27
+ schema = tool_schema.copy()
28
+
29
+ # Enable strict mode
30
+ schema["strict"] = True
31
+
32
+ # Ensure parameters is a valid dictionary
33
+ parameters = schema.get("parameters", {})
34
+
35
+ if isinstance(parameters, dict) and parameters.get("type") == "object":
36
+ # Set additionalProperties to False
37
+ parameters["additionalProperties"] = False
38
+ schema["parameters"] = parameters
39
+
40
+ return schema
41
+
42
+
43
+ def add_pre_execution_message(tool_schema: Dict[str, Any]) -> Dict[str, Any]:
44
+ """Adds a `pre_execution_message` parameter to a tool schema to prompt a natural, human-like message before executing the tool.
45
+
46
+ Args:
47
+ tool_schema (Dict[str, Any]): The original tool schema.
48
+
49
+ Returns:
50
+ Dict[str, Any]: A new tool schema with the `pre_execution_message` field added at the beginning.
51
+ """
52
+ schema = tool_schema.copy()
53
+ parameters = schema.get("parameters", {})
54
+
55
+ if not isinstance(parameters, dict) or parameters.get("type") != "object":
56
+ return schema # Do not modify if schema is not valid
57
+
58
+ properties = parameters.get("properties", {})
59
+ required = parameters.get("required", [])
60
+
61
+ # Define the new `pre_execution_message` field with a refined description
62
+ pre_execution_message_field = {
63
+ "type": "string",
64
+ "description": (
65
+ "A concise message to be uttered before executing this tool. "
66
+ "This should sound natural, as if a person is casually announcing their next action."
67
+ "You MUST also include punctuation at the end of this message."
68
+ ),
69
+ }
70
+
71
+ # Ensure the pre-execution message is the first field in properties
72
+ updated_properties = OrderedDict()
73
+ updated_properties[PRE_EXECUTION_MESSAGE_ARG] = pre_execution_message_field
74
+ updated_properties.update(properties) # Retain all existing properties
75
+
76
+ # Ensure pre-execution message is the first required field
77
+ if PRE_EXECUTION_MESSAGE_ARG not in required:
78
+ required = [PRE_EXECUTION_MESSAGE_ARG] + required
79
+
80
+ # Update the schema with ordered properties and required list
81
+ schema["parameters"] = {
82
+ **parameters,
83
+ "properties": dict(updated_properties), # Convert OrderedDict back to dict
84
+ "required": required,
85
+ }
86
+
87
+ return schema
88
+
89
+
90
+ def remove_request_heartbeat(tool_schema: Dict[str, Any]) -> Dict[str, Any]:
91
+ """Removes the `request_heartbeat` parameter from a tool schema if it exists.
92
+
93
+ Args:
94
+ tool_schema (Dict[str, Any]): The original tool schema.
95
+
96
+ Returns:
97
+ Dict[str, Any]: A new tool schema without `request_heartbeat`.
98
+ """
99
+ schema = tool_schema.copy()
100
+ parameters = schema.get("parameters", {})
101
+
102
+ if isinstance(parameters, dict):
103
+ properties = parameters.get("properties", {})
104
+ required = parameters.get("required", [])
105
+
106
+ # Remove the `request_heartbeat` property if it exists
107
+ if "request_heartbeat" in properties:
108
+ properties.pop("request_heartbeat")
109
+
110
+ # Remove `request_heartbeat` from required fields if present
111
+ if "request_heartbeat" in required:
112
+ required = [r for r in required if r != "request_heartbeat"]
113
+
114
+ # Update parameters with modified properties and required list
115
+ schema["parameters"] = {**parameters, "properties": properties, "required": required}
116
+
117
+ return schema
118
+
119
+
120
+ # TODO: Deprecate the `execute_external_tool` function on the agent body
121
+ def execute_external_tool(
122
+ agent_state: AgentState,
123
+ function_name: str,
124
+ function_args: dict,
125
+ target_letta_tool: Tool,
126
+ actor: User,
127
+ allow_agent_state_modifications: bool = False,
128
+ ) -> tuple[Any, Optional[SandboxRunResult]]:
129
+ # TODO: need to have an AgentState object that actually has full access to the block data
130
+ # this is because the sandbox tools need to be able to access block.value to edit this data
131
+ try:
132
+ if target_letta_tool.tool_type == ToolType.EXTERNAL_COMPOSIO:
133
+ action_name = generate_composio_action_from_func_name(target_letta_tool.name)
134
+ # Get entity ID from the agent_state
135
+ entity_id = None
136
+ for env_var in agent_state.tool_exec_environment_variables:
137
+ if env_var.key == COMPOSIO_ENTITY_ENV_VAR_KEY:
138
+ entity_id = env_var.value
139
+ # Get composio_api_key
140
+ composio_api_key = get_composio_api_key(actor=actor)
141
+ function_response = execute_composio_action(
142
+ action_name=action_name, args=function_args, api_key=composio_api_key, entity_id=entity_id
143
+ )
144
+ return function_response, None
145
+ elif target_letta_tool.tool_type == ToolType.CUSTOM:
146
+ # Parse the source code to extract function annotations
147
+ annotations = get_function_annotations_from_source(target_letta_tool.source_code, function_name)
148
+ # Coerce the function arguments to the correct types based on the annotations
149
+ function_args = coerce_dict_args_by_annotations(function_args, annotations)
150
+
151
+ # execute tool in a sandbox
152
+ # TODO: allow agent_state to specify which sandbox to execute tools in
153
+ # TODO: This is only temporary, can remove after we publish a pip package with this object
154
+ if allow_agent_state_modifications:
155
+ agent_state_copy = agent_state.__deepcopy__()
156
+ agent_state_copy.tools = []
157
+ agent_state_copy.tool_rules = []
158
+ else:
159
+ agent_state_copy = None
160
+
161
+ sandbox_run_result = ToolExecutionSandbox(function_name, function_args, actor).run(agent_state=agent_state_copy)
162
+ function_response, updated_agent_state = sandbox_run_result.func_return, sandbox_run_result.agent_state
163
+ # TODO: Bring this back
164
+ # if allow_agent_state_modifications and updated_agent_state is not None:
165
+ # self.update_memory_if_changed(updated_agent_state.memory)
166
+ return function_response, sandbox_run_result
167
+ except Exception as e:
168
+ # Need to catch error here, or else trunction wont happen
169
+ # TODO: modify to function execution error
170
+ function_response = get_friendly_error_msg(function_name=function_name, exception_name=type(e).__name__, exception_message=str(e))
171
+ return function_response, None
@@ -47,14 +47,39 @@ BASE_URL = "https://api.anthropic.com/v1"
47
47
  # https://docs.anthropic.com/claude/docs/models-overview
48
48
  # Sadly hardcoded
49
49
  MODEL_LIST = [
50
+ ## Opus
50
51
  {
51
52
  "name": "claude-3-opus-20240229",
52
53
  "context_window": 200000,
53
54
  },
55
+ ## Sonnet
56
+ # 3.0
57
+ {
58
+ "name": "claude-3-sonnet-20240229",
59
+ "context_window": 200000,
60
+ },
61
+ # 3.5
62
+ {
63
+ "name": "claude-3-5-sonnet-20240620",
64
+ "context_window": 200000,
65
+ },
66
+ # 3.5 new
54
67
  {
55
68
  "name": "claude-3-5-sonnet-20241022",
56
69
  "context_window": 200000,
57
70
  },
71
+ # 3.7
72
+ {
73
+ "name": "claude-3-7-sonnet-20250219",
74
+ "context_window": 200000,
75
+ },
76
+ ## Haiku
77
+ # 3.0
78
+ {
79
+ "name": "claude-3-haiku-20240307",
80
+ "context_window": 200000,
81
+ },
82
+ # 3.5
58
83
  {
59
84
  "name": "claude-3-5-haiku-20241022",
60
85
  "context_window": 200000,
@@ -75,7 +100,18 @@ def anthropic_get_model_list(url: str, api_key: Union[str, None]) -> dict:
75
100
  """https://docs.anthropic.com/claude/docs/models-overview"""
76
101
 
77
102
  # NOTE: currently there is no GET /models, so we need to hardcode
78
- return MODEL_LIST
103
+ # return MODEL_LIST
104
+
105
+ anthropic_override_key = ProviderManager().get_anthropic_override_key()
106
+ if anthropic_override_key:
107
+ anthropic_client = anthropic.Anthropic(api_key=anthropic_override_key)
108
+ elif model_settings.anthropic_api_key:
109
+ anthropic_client = anthropic.Anthropic()
110
+
111
+ models = anthropic_client.models.list()
112
+ models_json = models.model_dump()
113
+ assert "data" in models_json, f"Anthropic model query response missing 'data' field: {models_json}"
114
+ return models_json["data"]
79
115
 
80
116
 
81
117
  def convert_tools_to_anthropic_format(tools: List[Tool]) -> List[dict]:
@@ -42,6 +42,6 @@ class Source(SqlalchemyBase, OrganizationMixin):
42
42
  secondary="sources_agents",
43
43
  back_populates="sources",
44
44
  lazy="selectin",
45
- cascade="all, delete", # Ensures rows in sources_agents are deleted when the source is deleted
46
- passive_deletes=True, # Allows the database to handle deletion of orphaned rows
45
+ cascade="save-update", # Only propagate save and update operations
46
+ passive_deletes=True, # Let the database handle deletions
47
47
  )
@@ -99,7 +99,7 @@ class ChatCompletionRequest(BaseModel):
99
99
  """https://platform.openai.com/docs/api-reference/chat/create"""
100
100
 
101
101
  model: str
102
- messages: List[ChatMessage]
102
+ messages: List[Union[ChatMessage, Dict]]
103
103
  frequency_penalty: Optional[float] = 0
104
104
  logit_bias: Optional[Dict[str, int]] = None
105
105
  logprobs: Optional[bool] = False
@@ -410,28 +410,67 @@ class AnthropicProvider(Provider):
410
410
  base_url: str = "https://api.anthropic.com/v1"
411
411
 
412
412
  def list_llm_models(self) -> List[LLMConfig]:
413
- from letta.llm_api.anthropic import anthropic_get_model_list
413
+ from letta.llm_api.anthropic import MODEL_LIST, anthropic_get_model_list
414
414
 
415
415
  models = anthropic_get_model_list(self.base_url, api_key=self.api_key)
416
416
 
417
+ """
418
+ Example response:
419
+ {
420
+ "data": [
421
+ {
422
+ "type": "model",
423
+ "id": "claude-3-5-sonnet-20241022",
424
+ "display_name": "Claude 3.5 Sonnet (New)",
425
+ "created_at": "2024-10-22T00:00:00Z"
426
+ }
427
+ ],
428
+ "has_more": true,
429
+ "first_id": "<string>",
430
+ "last_id": "<string>"
431
+ }
432
+ """
433
+
417
434
  configs = []
418
435
  for model in models:
419
436
 
437
+ if model["type"] != "model":
438
+ continue
439
+
440
+ if "id" not in model:
441
+ continue
442
+
443
+ # Don't support 2.0 and 2.1
444
+ if model["id"].startswith("claude-2"):
445
+ continue
446
+
447
+ # Anthropic doesn't return the context window in their API
448
+ if "context_window" not in model:
449
+ # Remap list to name: context_window
450
+ model_library = {m["name"]: m["context_window"] for m in MODEL_LIST}
451
+ # Attempt to look it up in a hardcoded list
452
+ if model["id"] in model_library:
453
+ model["context_window"] = model_library[model["id"]]
454
+ else:
455
+ # On fallback, we can set 200k (generally safe), but we should warn the user
456
+ warnings.warn(f"Couldn't find context window size for model {model['id']}, defaulting to 200,000")
457
+ model["context_window"] = 200000
458
+
420
459
  # We set this to false by default, because Anthropic can
421
460
  # natively support <thinking> tags inside of content fields
422
461
  # However, putting COT inside of tool calls can make it more
423
462
  # reliable for tool calling (no chance of a non-tool call step)
424
463
  # Since tool_choice_type 'any' doesn't work with in-content COT
425
464
  # NOTE For Haiku, it can be flaky if we don't enable this by default
426
- inner_thoughts_in_kwargs = True if "haiku" in model["name"] else False
465
+ inner_thoughts_in_kwargs = True if "haiku" in model["id"] else False
427
466
 
428
467
  configs.append(
429
468
  LLMConfig(
430
- model=model["name"],
469
+ model=model["id"],
431
470
  model_endpoint_type="anthropic",
432
471
  model_endpoint=self.base_url,
433
472
  context_window=model["context_window"],
434
- handle=self.get_handle(model["name"]),
473
+ handle=self.get_handle(model["id"]),
435
474
  put_inner_thoughts_in_kwargs=inner_thoughts_in_kwargs,
436
475
  )
437
476
  )
@@ -9,7 +9,7 @@ from letta.constants import (
9
9
  LETTA_MULTI_AGENT_TOOL_MODULE_NAME,
10
10
  )
11
11
  from letta.functions.functions import derive_openai_json_schema, get_json_schema_from_module
12
- from letta.functions.helpers import generate_composio_action_from_func_name, generate_composio_tool_wrapper, generate_langchain_tool_wrapper
12
+ from letta.functions.helpers import generate_composio_tool_wrapper, generate_langchain_tool_wrapper
13
13
  from letta.functions.schema_generator import generate_schema_from_args_schema_v2, generate_tool_schema_for_composio
14
14
  from letta.log import get_logger
15
15
  from letta.orm.enums import ToolType
@@ -77,18 +77,6 @@ class Tool(BaseTool):
77
77
  elif self.tool_type in {ToolType.LETTA_MULTI_AGENT_CORE}:
78
78
  # If it's letta multi-agent tool, we also generate the json_schema on the fly here
79
79
  self.json_schema = get_json_schema_from_module(module_name=LETTA_MULTI_AGENT_TOOL_MODULE_NAME, function_name=self.name)
80
- elif self.tool_type == ToolType.EXTERNAL_COMPOSIO:
81
- # If it is a composio tool, we generate both the source code and json schema on the fly here
82
- # TODO: Deriving the composio action name is brittle, need to think long term about how to improve this
83
- try:
84
- composio_action = generate_composio_action_from_func_name(self.name)
85
- tool_create = ToolCreate.from_composio(composio_action)
86
- self.source_code = tool_create.source_code
87
- self.json_schema = tool_create.json_schema
88
- self.description = tool_create.description
89
- self.tags = tool_create.tags
90
- except Exception as e:
91
- logger.error(f"Encountered exception while attempting to refresh source_code and json_schema for composio_tool: {e}")
92
80
 
93
81
  # At this point, we need to validate that at least json_schema is populated
94
82
  if not self.json_schema: