letta-nightly 0.4.1.dev20241009104130__tar.gz → 0.4.1.dev20241010104112__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 (193) hide show
  1. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/PKG-INFO +1 -1
  2. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/agent_store/db.py +23 -7
  3. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/cli/cli.py +2 -1
  4. letta_nightly-0.4.1.dev20241010104112/letta/cli/cli_config.py +228 -0
  5. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/client/utils.py +7 -2
  6. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/embeddings.py +3 -0
  7. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/interface.py +6 -2
  8. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/llm_api/google_ai.py +1 -1
  9. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/llm_api/helpers.py +11 -4
  10. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/llm_api/llm_api_tools.py +2 -12
  11. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/llm_api/openai.py +1 -0
  12. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/constants.py +3 -0
  13. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/providers.py +26 -1
  14. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/server.py +8 -2
  15. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/streaming_interface.py +8 -4
  16. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/pyproject.toml +1 -1
  17. letta_nightly-0.4.1.dev20241009104130/letta/cli/cli_config.py +0 -1325
  18. letta_nightly-0.4.1.dev20241009104130/letta/configs/anthropic.json +0 -13
  19. letta_nightly-0.4.1.dev20241009104130/letta/configs/letta_hosted.json +0 -11
  20. letta_nightly-0.4.1.dev20241009104130/letta/configs/openai.json +0 -12
  21. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/LICENSE +0 -0
  22. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/README.md +0 -0
  23. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/__init__.py +0 -0
  24. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/__main__.py +0 -0
  25. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/agent.py +0 -0
  26. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/agent_store/chroma.py +0 -0
  27. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/agent_store/lancedb.py +0 -0
  28. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/agent_store/milvus.py +0 -0
  29. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/agent_store/qdrant.py +0 -0
  30. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/agent_store/storage.py +0 -0
  31. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/benchmark/benchmark.py +0 -0
  32. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/benchmark/constants.py +0 -0
  33. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/cli/cli_load.py +0 -0
  34. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/client/__init__.py +0 -0
  35. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/client/admin.py +0 -0
  36. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/client/client.py +0 -0
  37. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/client/streaming.py +0 -0
  38. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/config.py +0 -0
  39. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/constants.py +0 -0
  40. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/credentials.py +0 -0
  41. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/data_sources/connectors.py +0 -0
  42. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/errors.py +0 -0
  43. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/functions/__init__.py +0 -0
  44. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/functions/function_sets/base.py +0 -0
  45. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/functions/function_sets/extras.py +0 -0
  46. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/functions/functions.py +0 -0
  47. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/functions/helpers.py +0 -0
  48. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/functions/schema_generator.py +0 -0
  49. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/humans/__init__.py +0 -0
  50. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/humans/examples/basic.txt +0 -0
  51. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/humans/examples/cs_phd.txt +0 -0
  52. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/llm_api/__init__.py +0 -0
  53. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/llm_api/anthropic.py +0 -0
  54. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/llm_api/azure_openai.py +0 -0
  55. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/llm_api/azure_openai_constants.py +0 -0
  56. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/llm_api/cohere.py +0 -0
  57. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/README.md +0 -0
  58. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/__init__.py +0 -0
  59. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/chat_completion_proxy.py +0 -0
  60. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/function_parser.py +0 -0
  61. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/grammars/__init__.py +0 -0
  62. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
  63. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/grammars/json.gbnf +0 -0
  64. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
  65. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/json_parser.py +0 -0
  66. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/koboldcpp/api.py +0 -0
  67. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/koboldcpp/settings.py +0 -0
  68. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llamacpp/api.py +0 -0
  69. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llamacpp/settings.py +0 -0
  70. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
  71. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
  72. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
  73. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
  74. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
  75. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
  76. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
  77. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
  78. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
  79. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/lmstudio/api.py +0 -0
  80. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/lmstudio/settings.py +0 -0
  81. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/ollama/api.py +0 -0
  82. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/ollama/settings.py +0 -0
  83. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/settings/__init__.py +0 -0
  84. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
  85. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/settings/settings.py +0 -0
  86. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/settings/simple.py +0 -0
  87. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/utils.py +0 -0
  88. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/vllm/api.py +0 -0
  89. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/webui/api.py +0 -0
  90. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/webui/legacy_api.py +0 -0
  91. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/webui/legacy_settings.py +0 -0
  92. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/local_llm/webui/settings.py +0 -0
  93. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/log.py +0 -0
  94. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/main.py +0 -0
  95. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/memory.py +0 -0
  96. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/metadata.py +0 -0
  97. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/openai_backcompat/__init__.py +0 -0
  98. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/openai_backcompat/openai_object.py +0 -0
  99. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/persistence_manager.py +0 -0
  100. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/personas/__init__.py +0 -0
  101. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/personas/examples/anna_pa.txt +0 -0
  102. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/personas/examples/google_search_persona.txt +0 -0
  103. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/personas/examples/memgpt_doc.txt +0 -0
  104. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/personas/examples/memgpt_starter.txt +0 -0
  105. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/personas/examples/sam.txt +0 -0
  106. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/personas/examples/sam_pov.txt +0 -0
  107. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
  108. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/personas/examples/sqldb/test.db +0 -0
  109. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/__init__.py +0 -0
  110. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/gpt_summarize.py +0 -0
  111. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/gpt_system.py +0 -0
  112. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/system/memgpt_base.txt +0 -0
  113. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/system/memgpt_chat.txt +0 -0
  114. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
  115. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
  116. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/system/memgpt_doc.txt +0 -0
  117. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
  118. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
  119. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
  120. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/pytest.ini +0 -0
  121. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/agent.py +0 -0
  122. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/api_key.py +0 -0
  123. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/block.py +0 -0
  124. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/document.py +0 -0
  125. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/embedding_config.py +0 -0
  126. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/enums.py +0 -0
  127. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/health.py +0 -0
  128. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/job.py +0 -0
  129. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/letta_base.py +0 -0
  130. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/letta_message.py +0 -0
  131. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/letta_request.py +0 -0
  132. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/letta_response.py +0 -0
  133. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/llm_config.py +0 -0
  134. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/memory.py +0 -0
  135. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/message.py +0 -0
  136. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/openai/chat_completion_request.py +0 -0
  137. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/openai/chat_completion_response.py +0 -0
  138. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/openai/chat_completions.py +0 -0
  139. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/openai/embedding_response.py +0 -0
  140. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/openai/openai.py +0 -0
  141. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/organization.py +0 -0
  142. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/passage.py +0 -0
  143. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/source.py +0 -0
  144. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/tool.py +0 -0
  145. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/usage.py +0 -0
  146. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/schemas/user.py +0 -0
  147. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/__init__.py +0 -0
  148. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/constants.py +0 -0
  149. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/__init__.py +0 -0
  150. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/admin/__init__.py +0 -0
  151. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/admin/agents.py +0 -0
  152. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/admin/tools.py +0 -0
  153. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/admin/users.py +0 -0
  154. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/app.py +0 -0
  155. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/auth/__init__.py +0 -0
  156. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/auth/index.py +0 -0
  157. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/auth_token.py +0 -0
  158. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/interface.py +0 -0
  159. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/__init__.py +0 -0
  160. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/openai/__init__.py +0 -0
  161. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
  162. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
  163. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
  164. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/openai/assistants/threads.py +0 -0
  165. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
  166. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
  167. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/v1/__init__.py +0 -0
  168. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/v1/agents.py +0 -0
  169. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/v1/blocks.py +0 -0
  170. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/v1/health.py +0 -0
  171. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/v1/jobs.py +0 -0
  172. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/v1/llms.py +0 -0
  173. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/v1/organizations.py +0 -0
  174. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/v1/sources.py +0 -0
  175. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/v1/tools.py +0 -0
  176. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/routers/v1/users.py +0 -0
  177. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/static_files.py +0 -0
  178. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/rest_api/utils.py +0 -0
  179. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/startup.sh +0 -0
  180. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/static_files/assets/index-3ab03d5b.css +0 -0
  181. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/static_files/assets/index-9a9c449b.js +0 -0
  182. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/static_files/favicon.ico +0 -0
  183. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/static_files/index.html +0 -0
  184. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
  185. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/utils.py +0 -0
  186. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/ws_api/__init__.py +0 -0
  187. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/ws_api/example_client.py +0 -0
  188. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/ws_api/interface.py +0 -0
  189. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/ws_api/protocol.py +0 -0
  190. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/server/ws_api/server.py +0 -0
  191. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/settings.py +0 -0
  192. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/system.py +0 -0
  193. {letta_nightly-0.4.1.dev20241009104130 → letta_nightly-0.4.1.dev20241010104112}/letta/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-nightly
3
- Version: 0.4.1.dev20241009104130
3
+ Version: 0.4.1.dev20241010104112
4
4
  Summary: Create LLM agents with long-term memory and custom tools
5
5
  License: Apache License
6
6
  Author: Letta Team
@@ -398,8 +398,6 @@ class PostgresStorageConnector(SQLStorageConnector):
398
398
  return records
399
399
 
400
400
  def insert_many(self, records, exists_ok=True, show_progress=False):
401
- pass
402
-
403
401
  # TODO: this is terrible, should eventually be done the same way for all types (migrate to SQLModel)
404
402
  if len(records) == 0:
405
403
  return
@@ -506,18 +504,36 @@ class SQLLiteStorageConnector(SQLStorageConnector):
506
504
  # sqlite3.register_converter("UUID", lambda b: uuid.UUID(bytes_le=b))
507
505
 
508
506
  def insert_many(self, records, exists_ok=True, show_progress=False):
509
- pass
510
-
511
507
  # TODO: this is terrible, should eventually be done the same way for all types (migrate to SQLModel)
512
508
  if len(records) == 0:
513
509
  return
510
+
511
+ added_ids = [] # avoid adding duplicates
512
+ # NOTE: this has not great performance due to the excessive commits
514
513
  with self.session_maker() as session:
515
514
  iterable = tqdm(records) if show_progress else records
516
515
  for record in iterable:
517
516
  # db_record = self.db_model(**vars(record))
518
- db_record = self.db_model(**record.dict())
519
- session.add(db_record)
520
- session.commit()
517
+
518
+ if record.id in added_ids:
519
+ continue
520
+
521
+ existing_record = session.query(self.db_model).filter_by(id=record.id).first()
522
+ if existing_record:
523
+ if exists_ok:
524
+ fields = record.model_dump()
525
+ fields.pop("id")
526
+ session.query(self.db_model).filter(self.db_model.id == record.id).update(fields)
527
+ session.commit()
528
+ else:
529
+ raise ValueError(f"Record with id {record.id} already exists.")
530
+
531
+ else:
532
+ db_record = self.db_model(**record.dict())
533
+ session.add(db_record)
534
+ session.commit()
535
+
536
+ added_ids.append(record.id)
521
537
 
522
538
  def insert(self, record, exists_ok=True):
523
539
  self.insert_many([record], exists_ok=exists_ok)
@@ -11,6 +11,7 @@ from letta import create_client
11
11
  from letta.agent import Agent, save_agent
12
12
  from letta.config import LettaConfig
13
13
  from letta.constants import CLI_WARNING_PREFIX, LETTA_DIR
14
+ from letta.local_llm.constants import ASSISTANT_MESSAGE_CLI_SYMBOL
14
15
  from letta.log import get_logger
15
16
  from letta.metadata import MetadataStore
16
17
  from letta.schemas.enums import OptionState
@@ -276,7 +277,7 @@ def run(
276
277
  memory = ChatMemory(human=human_obj.value, persona=persona_obj.value, limit=core_memory_limit)
277
278
  metadata = {"human": human_obj.name, "persona": persona_obj.name}
278
279
 
279
- typer.secho(f"-> 🤖 Using persona profile: '{persona_obj.name}'", fg=typer.colors.WHITE)
280
+ typer.secho(f"-> {ASSISTANT_MESSAGE_CLI_SYMBOL} Using persona profile: '{persona_obj.name}'", fg=typer.colors.WHITE)
280
281
  typer.secho(f"-> 🧑 Using human profile: '{human_obj.name}'", fg=typer.colors.WHITE)
281
282
 
282
283
  # add tools
@@ -0,0 +1,228 @@
1
+ import ast
2
+ import os
3
+ from enum import Enum
4
+ from typing import Annotated, List, Optional
5
+
6
+ import questionary
7
+ import typer
8
+ from prettytable.colortable import ColorTable, Themes
9
+ from tqdm import tqdm
10
+
11
+ from letta import utils
12
+
13
+ app = typer.Typer()
14
+
15
+
16
+ @app.command()
17
+ def configure():
18
+ """Updates default Letta configurations
19
+
20
+ This function and quickstart should be the ONLY place where LettaConfig.save() is called
21
+ """
22
+ print("`letta configure` has been deprecated. Please see documentation on configuration, and run `letta run` instead.")
23
+
24
+
25
+ class ListChoice(str, Enum):
26
+ agents = "agents"
27
+ humans = "humans"
28
+ personas = "personas"
29
+ sources = "sources"
30
+
31
+
32
+ @app.command()
33
+ def list(arg: Annotated[ListChoice, typer.Argument]):
34
+ from letta.client.client import create_client
35
+
36
+ client = create_client()
37
+ table = ColorTable(theme=Themes.OCEAN)
38
+ if arg == ListChoice.agents:
39
+ """List all agents"""
40
+ table.field_names = ["Name", "LLM Model", "Embedding Model", "Embedding Dim", "Persona", "Human", "Data Source", "Create Time"]
41
+ for agent in tqdm(client.list_agents()):
42
+ # TODO: add this function
43
+ sources = client.list_attached_sources(agent_id=agent.id)
44
+ source_names = [source.name for source in sources if source is not None]
45
+ table.add_row(
46
+ [
47
+ agent.name,
48
+ agent.llm_config.model,
49
+ agent.embedding_config.embedding_model,
50
+ agent.embedding_config.embedding_dim,
51
+ agent.memory.get_block("persona").value[:100] + "...",
52
+ agent.memory.get_block("human").value[:100] + "...",
53
+ ",".join(source_names),
54
+ utils.format_datetime(agent.created_at),
55
+ ]
56
+ )
57
+ print(table)
58
+ elif arg == ListChoice.humans:
59
+ """List all humans"""
60
+ table.field_names = ["Name", "Text"]
61
+ for human in client.list_humans():
62
+ table.add_row([human.name, human.value.replace("\n", "")[:100]])
63
+ print(table)
64
+ elif arg == ListChoice.personas:
65
+ """List all personas"""
66
+ table.field_names = ["Name", "Text"]
67
+ for persona in client.list_personas():
68
+ table.add_row([persona.name, persona.value.replace("\n", "")[:100]])
69
+ print(table)
70
+ elif arg == ListChoice.sources:
71
+ """List all data sources"""
72
+
73
+ # create table
74
+ table.field_names = ["Name", "Description", "Embedding Model", "Embedding Dim", "Created At"]
75
+ # TODO: eventually look accross all storage connections
76
+ # TODO: add data source stats
77
+ # TODO: connect to agents
78
+
79
+ # get all sources
80
+ for source in client.list_sources():
81
+ # get attached agents
82
+ table.add_row(
83
+ [
84
+ source.name,
85
+ source.description,
86
+ source.embedding_config.embedding_model,
87
+ source.embedding_config.embedding_dim,
88
+ utils.format_datetime(source.created_at),
89
+ ]
90
+ )
91
+
92
+ print(table)
93
+ else:
94
+ raise ValueError(f"Unknown argument {arg}")
95
+ return table
96
+
97
+
98
+ @app.command()
99
+ def add_tool(
100
+ filename: str = typer.Option(..., help="Path to the Python file containing the function"),
101
+ name: Optional[str] = typer.Option(None, help="Name of the tool"),
102
+ update: bool = typer.Option(True, help="Update the tool if it already exists"),
103
+ tags: Optional[List[str]] = typer.Option(None, help="Tags for the tool"),
104
+ ):
105
+ """Add or update a tool from a Python file."""
106
+ from letta.client.client import create_client
107
+
108
+ client = create_client(base_url=os.getenv("MEMGPT_BASE_URL"), token=os.getenv("MEMGPT_SERVER_PASS"))
109
+
110
+ # 1. Parse the Python file
111
+ with open(filename, "r", encoding="utf-8") as file:
112
+ source_code = file.read()
113
+
114
+ # 2. Parse the source code to extract the function
115
+ # Note: here we assume it is one function only in the file.
116
+ module = ast.parse(source_code)
117
+ func_def = None
118
+ for node in module.body:
119
+ if isinstance(node, ast.FunctionDef):
120
+ func_def = node
121
+ break
122
+
123
+ if not func_def:
124
+ raise ValueError("No function found in the provided file")
125
+
126
+ # 3. Compile the function to make it callable
127
+ # Explanation courtesy of GPT-4:
128
+ # Compile the AST (Abstract Syntax Tree) node representing the function definition into a code object
129
+ # ast.Module creates a module node containing the function definition (func_def)
130
+ # compile converts the AST into a code object that can be executed by the Python interpreter
131
+ # The exec function executes the compiled code object in the current context,
132
+ # effectively defining the function within the current namespace
133
+ exec(compile(ast.Module([func_def], []), filename, "exec"))
134
+ # Retrieve the function object by evaluating its name in the current namespace
135
+ # eval looks up the function name in the current scope and returns the function object
136
+ func = eval(func_def.name)
137
+
138
+ # 4. Add or update the tool
139
+ tool = client.create_tool(func=func, name=name, tags=tags, update=update)
140
+ print(f"Tool {tool.name} added successfully")
141
+
142
+
143
+ @app.command()
144
+ def list_tools():
145
+ """List all available tools."""
146
+ from letta.client.client import create_client
147
+
148
+ client = create_client(base_url=os.getenv("MEMGPT_BASE_URL"), token=os.getenv("MEMGPT_SERVER_PASS"))
149
+
150
+ tools = client.list_tools()
151
+ for tool in tools:
152
+ print(f"Tool: {tool.name}")
153
+
154
+
155
+ @app.command()
156
+ def add(
157
+ option: str, # [human, persona]
158
+ name: Annotated[str, typer.Option(help="Name of human/persona")],
159
+ text: Annotated[Optional[str], typer.Option(help="Text of human/persona")] = None,
160
+ filename: Annotated[Optional[str], typer.Option("-f", help="Specify filename")] = None,
161
+ ):
162
+ """Add a person/human"""
163
+ from letta.client.client import create_client
164
+
165
+ client = create_client(base_url=os.getenv("MEMGPT_BASE_URL"), token=os.getenv("MEMGPT_SERVER_PASS"))
166
+ if filename: # read from file
167
+ assert text is None, "Cannot specify both text and filename"
168
+ with open(filename, "r", encoding="utf-8") as f:
169
+ text = f.read()
170
+ else:
171
+ assert text is not None, "Must specify either text or filename"
172
+ if option == "persona":
173
+ persona_id = client.get_persona_id(name)
174
+ if persona_id:
175
+ client.get_persona(persona_id)
176
+ # config if user wants to overwrite
177
+ if not questionary.confirm(f"Persona {name} already exists. Overwrite?").ask():
178
+ return
179
+ client.update_persona(persona_id, text=text)
180
+ else:
181
+ client.create_persona(name=name, text=text)
182
+
183
+ elif option == "human":
184
+ human_id = client.get_human_id(name)
185
+ if human_id:
186
+ human = client.get_human(human_id)
187
+ # config if user wants to overwrite
188
+ if not questionary.confirm(f"Human {name} already exists. Overwrite?").ask():
189
+ return
190
+ client.update_human(human_id, text=text)
191
+ else:
192
+ human = client.create_human(name=name, text=text)
193
+ else:
194
+ raise ValueError(f"Unknown kind {option}")
195
+
196
+
197
+ @app.command()
198
+ def delete(option: str, name: str):
199
+ """Delete a source from the archival memory."""
200
+ from letta.client.client import create_client
201
+
202
+ client = create_client(base_url=os.getenv("MEMGPT_BASE_URL"), token=os.getenv("MEMGPT_API_KEY"))
203
+ try:
204
+ # delete from metadata
205
+ if option == "source":
206
+ # delete metadata
207
+ source_id = client.get_source_id(name)
208
+ assert source_id is not None, f"Source {name} does not exist"
209
+ client.delete_source(source_id)
210
+ elif option == "agent":
211
+ agent_id = client.get_agent_id(name)
212
+ assert agent_id is not None, f"Agent {name} does not exist"
213
+ client.delete_agent(agent_id=agent_id)
214
+ elif option == "human":
215
+ human_id = client.get_human_id(name)
216
+ assert human_id is not None, f"Human {name} does not exist"
217
+ client.delete_human(human_id)
218
+ elif option == "persona":
219
+ persona_id = client.get_persona_id(name)
220
+ assert persona_id is not None, f"Persona {name} does not exist"
221
+ client.delete_persona(persona_id)
222
+ else:
223
+ raise ValueError(f"Option {option} not implemented")
224
+
225
+ typer.secho(f"Deleted {option} '{name}'", fg=typer.colors.GREEN)
226
+
227
+ except Exception as e:
228
+ typer.secho(f"Failed to delete {option}'{name}'\n{e}", fg=typer.colors.RED)
@@ -2,6 +2,11 @@ from datetime import datetime
2
2
 
3
3
  from IPython.display import HTML, display
4
4
 
5
+ from letta.local_llm.constants import (
6
+ ASSISTANT_MESSAGE_CLI_SYMBOL,
7
+ INNER_THOUGHTS_CLI_SYMBOL,
8
+ )
9
+
5
10
 
6
11
  def pprint(messages):
7
12
  """Utility function for pretty-printing the output of client.send_message in notebooks"""
@@ -47,13 +52,13 @@ def pprint(messages):
47
52
  html_content += f"<p><strong>🛠️ [{date_formatted}] Function Return ({return_status}):</strong></p>"
48
53
  html_content += f"<p class='function-return'>{return_string}</p>"
49
54
  elif "internal_monologue" in message:
50
- html_content += f"<p><strong>💭 [{date_formatted}] Internal Monologue:</strong></p>"
55
+ html_content += f"<p><strong>{INNER_THOUGHTS_CLI_SYMBOL} [{date_formatted}] Internal Monologue:</strong></p>"
51
56
  html_content += f"<p class='internal-monologue'>{message['internal_monologue']}</p>"
52
57
  elif "function_call" in message:
53
58
  html_content += f"<p><strong>🛠️ [[{date_formatted}] Function Call:</strong></p>"
54
59
  html_content += f"<p class='function-call'>{message['function_call']}</p>"
55
60
  elif "assistant_message" in message:
56
- html_content += f"<p><strong>🤖 [{date_formatted}] Assistant Message:</strong></p>"
61
+ html_content += f"<p><strong>{ASSISTANT_MESSAGE_CLI_SYMBOL} [{date_formatted}] Assistant Message:</strong></p>"
57
62
  html_content += f"<p class='assistant-message'>{message['assistant_message']}</p>"
58
63
  html_content += "<br>"
59
64
  html_content += "</div>"
@@ -91,6 +91,9 @@ class EmbeddingEndpoint:
91
91
  raise ValueError(
92
92
  f"Embeddings endpoint was provided an invalid URL (set to: '{base_url}'). Make sure embedding_endpoint is set correctly in your Letta config."
93
93
  )
94
+ # TODO: find a neater solution - re-mapping for letta endpoint
95
+ if model == "letta-free":
96
+ model = "BAAI/bge-large-en-v1.5"
94
97
  self.model_name = model
95
98
  self._user = user
96
99
  self._base_url = base_url
@@ -5,6 +5,10 @@ from typing import List, Optional
5
5
  from colorama import Fore, Style, init
6
6
 
7
7
  from letta.constants import CLI_WARNING_PREFIX
8
+ from letta.local_llm.constants import (
9
+ ASSISTANT_MESSAGE_CLI_SYMBOL,
10
+ INNER_THOUGHTS_CLI_SYMBOL,
11
+ )
8
12
  from letta.schemas.message import Message
9
13
  from letta.utils import json_loads, printd
10
14
 
@@ -79,14 +83,14 @@ class CLIInterface(AgentInterface):
79
83
  @staticmethod
80
84
  def internal_monologue(msg: str, msg_obj: Optional[Message] = None):
81
85
  # ANSI escape code for italic is '\x1B[3m'
82
- fstr = f"\x1B[3m{Fore.LIGHTBLACK_EX}💭 {{msg}}{Style.RESET_ALL}"
86
+ fstr = f"\x1B[3m{Fore.LIGHTBLACK_EX}{INNER_THOUGHTS_CLI_SYMBOL} {{msg}}{Style.RESET_ALL}"
83
87
  if STRIP_UI:
84
88
  fstr = "{msg}"
85
89
  print(fstr.format(msg=msg))
86
90
 
87
91
  @staticmethod
88
92
  def assistant_message(msg: str, msg_obj: Optional[Message] = None):
89
- fstr = f"{Fore.YELLOW}{Style.BRIGHT}🤖 {Fore.YELLOW}{{msg}}{Style.RESET_ALL}"
93
+ fstr = f"{Fore.YELLOW}{Style.BRIGHT}{ASSISTANT_MESSAGE_CLI_SYMBOL} {Fore.YELLOW}{{msg}}{Style.RESET_ALL}"
90
94
  if STRIP_UI:
91
95
  fstr = "{msg}"
92
96
  print(fstr.format(msg=msg))
@@ -436,7 +436,7 @@ def google_ai_chat_completions_request(
436
436
  response_json=response_json,
437
437
  model=data.get("model"),
438
438
  input_messages=data["contents"],
439
- pull_inner_thoughts_from_args=data.get("inner_thoughts_in_kwargs", False),
439
+ pull_inner_thoughts_from_args=inner_thoughts_in_kwargs,
440
440
  )
441
441
  except Exception as conversion_error:
442
442
  print(f"Error during response conversion: {conversion_error}")
@@ -21,10 +21,17 @@ def make_post_request(url: str, headers: dict[str, str], data: dict[str, Any]) -
21
21
  # Raise for 4XX/5XX HTTP errors
22
22
  response.raise_for_status()
23
23
 
24
- # Ensure the content is JSON before parsing
25
- if response.headers.get("Content-Type") == "application/json":
26
- response_data = response.json() # Convert to dict from JSON
27
- printd(f"Response JSON: {response_data}")
24
+ # Check if the response content type indicates JSON and attempt to parse it
25
+ content_type = response.headers.get("Content-Type", "")
26
+ if "application/json" in content_type.lower():
27
+ try:
28
+ response_data = response.json() # Attempt to parse the response as JSON
29
+ printd(f"Response JSON: {response_data}")
30
+ except ValueError as json_err:
31
+ # Handle the case where the content type says JSON but the body is invalid
32
+ error_message = f"Failed to parse JSON despite Content-Type being {content_type}: {json_err}"
33
+ printd(error_message)
34
+ raise ValueError(error_message) from json_err
28
35
  else:
29
36
  error_message = f"Unexpected content type returned: {response.headers.get('Content-Type')}"
30
37
  printd(error_message)
@@ -217,19 +217,14 @@ def create(
217
217
  if not use_tool_naming:
218
218
  raise NotImplementedError("Only tool calling supported on Google AI API requests")
219
219
 
220
- # NOTE: until Google AI supports CoT / text alongside function calls,
221
- # we need to put it in a kwarg (unless we want to split the message into two)
222
- google_ai_inner_thoughts_in_kwarg = True
223
-
224
220
  if functions is not None:
225
221
  tools = [{"type": "function", "function": f} for f in functions]
226
222
  tools = [Tool(**t) for t in tools]
227
- tools = convert_tools_to_google_ai_format(tools, inner_thoughts_in_kwargs=google_ai_inner_thoughts_in_kwarg)
223
+ tools = convert_tools_to_google_ai_format(tools, inner_thoughts_in_kwargs=True)
228
224
  else:
229
225
  tools = None
230
226
 
231
227
  return google_ai_chat_completions_request(
232
- inner_thoughts_in_kwargs=google_ai_inner_thoughts_in_kwarg,
233
228
  base_url=llm_config.model_endpoint,
234
229
  model=llm_config.model,
235
230
  api_key=model_settings.gemini_api_key,
@@ -238,6 +233,7 @@ def create(
238
233
  contents=[m.to_google_ai_dict() for m in messages],
239
234
  tools=tools,
240
235
  ),
236
+ inner_thoughts_in_kwargs=True,
241
237
  )
242
238
 
243
239
  elif llm_config.model_endpoint_type == "anthropic":
@@ -246,12 +242,6 @@ def create(
246
242
  if not use_tool_naming:
247
243
  raise NotImplementedError("Only tool calling supported on Anthropic API requests")
248
244
 
249
- if functions is not None:
250
- tools = [{"type": "function", "function": f} for f in functions]
251
- tools = [Tool(**t) for t in tools]
252
- else:
253
- tools = None
254
-
255
245
  return anthropic_chat_completions_request(
256
246
  url=llm_config.model_endpoint,
257
247
  api_key=model_settings.anthropic_api_key,
@@ -145,6 +145,7 @@ def build_openai_chat_completions_request(
145
145
  import uuid
146
146
 
147
147
  data.user = str(uuid.UUID(int=0))
148
+ data.model = "memgpt-openai"
148
149
 
149
150
  return data
150
151
 
@@ -29,3 +29,6 @@ DEFAULT_WRAPPER_NAME = "chatml"
29
29
 
30
30
  INNER_THOUGHTS_KWARG = "inner_thoughts"
31
31
  INNER_THOUGHTS_KWARG_DESCRIPTION = "Deep inner monologue private to you only."
32
+ INNER_THOUGHTS_CLI_SYMBOL = "💭"
33
+
34
+ ASSISTANT_MESSAGE_CLI_SYMBOL = "🤖"
@@ -13,7 +13,6 @@ from letta.schemas.llm_config import LLMConfig
13
13
 
14
14
 
15
15
  class Provider(BaseModel):
16
- base_url: str
17
16
 
18
17
  def list_llm_models(self):
19
18
  return []
@@ -25,6 +24,32 @@ class Provider(BaseModel):
25
24
  pass
26
25
 
27
26
 
27
+ class LettaProvider(Provider):
28
+
29
+ name: str = "letta"
30
+
31
+ def list_llm_models(self) -> List[LLMConfig]:
32
+ return [
33
+ LLMConfig(
34
+ model="letta-free", # NOTE: renamed
35
+ model_endpoint_type="openai",
36
+ model_endpoint="https://inference.memgpt.ai",
37
+ context_window=16384,
38
+ )
39
+ ]
40
+
41
+ def list_embedding_models(self):
42
+ return [
43
+ EmbeddingConfig(
44
+ embedding_model="letta-free", # NOTE: renamed
45
+ embedding_endpoint_type="hugging-face",
46
+ embedding_endpoint="https://embeddings.memgpt.ai",
47
+ embedding_dim=1024,
48
+ embedding_chunk_size=300,
49
+ )
50
+ ]
51
+
52
+
28
53
  class OpenAIProvider(Provider):
29
54
  name: str = "openai"
30
55
  api_key: str = Field(..., description="API key for the OpenAI API.")
@@ -47,6 +47,7 @@ from letta.providers import (
47
47
  AnthropicProvider,
48
48
  AzureProvider,
49
49
  GoogleAIProvider,
50
+ LettaProvider,
50
51
  OllamaProvider,
51
52
  OpenAIProvider,
52
53
  VLLMProvider,
@@ -259,8 +260,8 @@ class SyncServer(Server):
259
260
  # add global default tools (for admin)
260
261
  self.add_default_tools(module_name="base")
261
262
 
262
- # collect providers
263
- self._enabled_providers = []
263
+ # collect providers (always has Letta as a default)
264
+ self._enabled_providers = [LettaProvider()]
264
265
  if model_settings.openai_api_key:
265
266
  self._enabled_providers.append(OpenAIProvider(api_key=model_settings.openai_api_key))
266
267
  if model_settings.anthropic_api_key:
@@ -1622,6 +1623,11 @@ class SyncServer(Server):
1622
1623
  agent = self._get_or_load_agent(agent_id=agent_id)
1623
1624
  archival_memory = agent.persistence_manager.archival_memory
1624
1625
  archival_memory.storage.delete({"source_id": source_id})
1626
+
1627
+ # delete agent-source mapping
1628
+ self.ms.detach_source(agent_id=agent_id, source_id=source_id)
1629
+
1630
+ # return back source data
1625
1631
  return source
1626
1632
 
1627
1633
  def list_attached_sources(self, agent_id: str) -> List[Source]:
@@ -9,6 +9,10 @@ from rich.live import Live
9
9
  from rich.markup import escape
10
10
 
11
11
  from letta.interface import CLIInterface
12
+ from letta.local_llm.constants import (
13
+ ASSISTANT_MESSAGE_CLI_SYMBOL,
14
+ INNER_THOUGHTS_CLI_SYMBOL,
15
+ )
12
16
  from letta.schemas.message import Message
13
17
  from letta.schemas.openai.chat_completion_response import (
14
18
  ChatCompletionChunkResponse,
@@ -296,7 +300,7 @@ class StreamingRefreshCLIInterface(AgentRefreshStreamingInterface):
296
300
  def process_refresh(self, response: ChatCompletionResponse):
297
301
  """Process the response to rewrite the current output buffer."""
298
302
  if not response.choices:
299
- self.update_output("💭 [italic]...[/italic]")
303
+ self.update_output(f"{INNER_THOUGHTS_CLI_SYMBOL} [italic]...[/italic]")
300
304
  return # Early exit if there are no choices
301
305
 
302
306
  choice = response.choices[0]
@@ -304,7 +308,7 @@ class StreamingRefreshCLIInterface(AgentRefreshStreamingInterface):
304
308
  tool_calls = choice.message.tool_calls if choice.message.tool_calls else []
305
309
 
306
310
  if self.fancy:
307
- message_string = f"💭 [italic]{inner_thoughts}[/italic]" if inner_thoughts else ""
311
+ message_string = f"{INNER_THOUGHTS_CLI_SYMBOL} [italic]{inner_thoughts}[/italic]" if inner_thoughts else ""
308
312
  else:
309
313
  message_string = "[inner thoughts] " + inner_thoughts if inner_thoughts else ""
310
314
 
@@ -326,7 +330,7 @@ class StreamingRefreshCLIInterface(AgentRefreshStreamingInterface):
326
330
  message = function_args[len(prefix) :]
327
331
  else:
328
332
  message = function_args
329
- message_string += f"🤖 [bold yellow]{message}[/bold yellow]"
333
+ message_string += f"{ASSISTANT_MESSAGE_CLI_SYMBOL} [bold yellow]{message}[/bold yellow]"
330
334
  else:
331
335
  message_string += f"{function_name}({function_args})"
332
336
 
@@ -336,7 +340,7 @@ class StreamingRefreshCLIInterface(AgentRefreshStreamingInterface):
336
340
  if self.streaming:
337
341
  print()
338
342
  self.live.start() # Start the Live display context and keep it running
339
- self.update_output("💭 [italic]...[/italic]")
343
+ self.update_output(f"{INNER_THOUGHTS_CLI_SYMBOL} [italic]...[/italic]")
340
344
 
341
345
  def stream_end(self):
342
346
  if self.streaming:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "letta-nightly"
3
- version = "0.4.1.dev20241009104130"
3
+ version = "0.4.1.dev20241010104112"
4
4
  packages = [
5
5
  {include = "letta"}
6
6
  ]