letta-nightly 0.1.7.dev20240929104004__tar.gz → 0.1.7.dev20241001104147__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 (189) hide show
  1. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/PKG-INFO +3 -1
  2. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/agent.py +4 -1
  3. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/cli/cli.py +0 -1
  4. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/cli/cli_load.py +0 -50
  5. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/config.py +3 -10
  6. letta_nightly-0.1.7.dev20241001104147/letta/functions/helpers.py +175 -0
  7. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/functions/schema_generator.py +2 -42
  8. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/tool.py +8 -8
  9. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/server.py +1 -18
  10. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/pyproject.toml +3 -1
  11. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/LICENSE +0 -0
  12. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/README.md +0 -0
  13. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/__init__.py +0 -0
  14. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/__main__.py +0 -0
  15. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/agent_store/chroma.py +0 -0
  16. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/agent_store/db.py +0 -0
  17. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/agent_store/lancedb.py +0 -0
  18. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/agent_store/milvus.py +0 -0
  19. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/agent_store/qdrant.py +0 -0
  20. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/agent_store/storage.py +0 -0
  21. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/benchmark/benchmark.py +0 -0
  22. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/benchmark/constants.py +0 -0
  23. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/cli/cli_config.py +0 -0
  24. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/client/__init__.py +0 -0
  25. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/client/admin.py +0 -0
  26. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/client/client.py +0 -0
  27. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/client/streaming.py +0 -0
  28. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/client/utils.py +0 -0
  29. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/configs/anthropic.json +0 -0
  30. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/configs/letta_hosted.json +0 -0
  31. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/configs/openai.json +0 -0
  32. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/constants.py +0 -0
  33. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/credentials.py +0 -0
  34. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/data_sources/connectors.py +0 -0
  35. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/embeddings.py +0 -0
  36. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/errors.py +0 -0
  37. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/functions/__init__.py +0 -0
  38. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/functions/function_sets/base.py +0 -0
  39. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/functions/function_sets/extras.py +0 -0
  40. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/functions/functions.py +0 -0
  41. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/humans/__init__.py +0 -0
  42. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/humans/examples/basic.txt +0 -0
  43. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/humans/examples/cs_phd.txt +0 -0
  44. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/interface.py +0 -0
  45. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/llm_api/__init__.py +0 -0
  46. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/llm_api/anthropic.py +0 -0
  47. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/llm_api/azure_openai.py +0 -0
  48. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/llm_api/cohere.py +0 -0
  49. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/llm_api/google_ai.py +0 -0
  50. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/llm_api/llm_api_tools.py +0 -0
  51. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/llm_api/openai.py +0 -0
  52. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/README.md +0 -0
  53. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/__init__.py +0 -0
  54. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/chat_completion_proxy.py +0 -0
  55. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/constants.py +0 -0
  56. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/function_parser.py +0 -0
  57. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/grammars/__init__.py +0 -0
  58. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
  59. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/grammars/json.gbnf +0 -0
  60. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
  61. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/groq/api.py +0 -0
  62. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/json_parser.py +0 -0
  63. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/koboldcpp/api.py +0 -0
  64. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/koboldcpp/settings.py +0 -0
  65. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llamacpp/api.py +0 -0
  66. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llamacpp/settings.py +0 -0
  67. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
  68. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
  69. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
  70. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
  71. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
  72. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
  73. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
  74. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
  75. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
  76. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/lmstudio/api.py +0 -0
  77. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/lmstudio/settings.py +0 -0
  78. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/ollama/api.py +0 -0
  79. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/ollama/settings.py +0 -0
  80. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/settings/__init__.py +0 -0
  81. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
  82. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/settings/settings.py +0 -0
  83. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/settings/simple.py +0 -0
  84. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/utils.py +0 -0
  85. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/vllm/api.py +0 -0
  86. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/webui/api.py +0 -0
  87. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/webui/legacy_api.py +0 -0
  88. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/webui/legacy_settings.py +0 -0
  89. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/local_llm/webui/settings.py +0 -0
  90. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/log.py +0 -0
  91. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/main.py +0 -0
  92. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/memory.py +0 -0
  93. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/metadata.py +0 -0
  94. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/openai_backcompat/__init__.py +0 -0
  95. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/openai_backcompat/openai_object.py +0 -0
  96. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/persistence_manager.py +0 -0
  97. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/personas/__init__.py +0 -0
  98. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/personas/examples/anna_pa.txt +0 -0
  99. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/personas/examples/google_search_persona.txt +0 -0
  100. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/personas/examples/memgpt_doc.txt +0 -0
  101. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/personas/examples/memgpt_starter.txt +0 -0
  102. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/personas/examples/sam.txt +0 -0
  103. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/personas/examples/sam_pov.txt +0 -0
  104. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
  105. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/personas/examples/sqldb/test.db +0 -0
  106. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/__init__.py +0 -0
  107. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/gpt_summarize.py +0 -0
  108. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/gpt_system.py +0 -0
  109. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/system/memgpt_base.txt +0 -0
  110. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/system/memgpt_chat.txt +0 -0
  111. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
  112. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
  113. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/system/memgpt_doc.txt +0 -0
  114. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
  115. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
  116. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
  117. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/pytest.ini +0 -0
  118. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/agent.py +0 -0
  119. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/api_key.py +0 -0
  120. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/block.py +0 -0
  121. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/document.py +0 -0
  122. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/embedding_config.py +0 -0
  123. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/enums.py +0 -0
  124. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/job.py +0 -0
  125. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/letta_base.py +0 -0
  126. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/letta_message.py +0 -0
  127. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/letta_request.py +0 -0
  128. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/letta_response.py +0 -0
  129. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/llm_config.py +0 -0
  130. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/memory.py +0 -0
  131. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/message.py +0 -0
  132. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/openai/chat_completion_request.py +0 -0
  133. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/openai/chat_completion_response.py +0 -0
  134. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/openai/chat_completions.py +0 -0
  135. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/openai/embedding_response.py +0 -0
  136. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/openai/openai.py +0 -0
  137. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/organization.py +0 -0
  138. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/passage.py +0 -0
  139. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/source.py +0 -0
  140. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/usage.py +0 -0
  141. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/schemas/user.py +0 -0
  142. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/__init__.py +0 -0
  143. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/constants.py +0 -0
  144. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/__init__.py +0 -0
  145. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/admin/__init__.py +0 -0
  146. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/admin/agents.py +0 -0
  147. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/admin/tools.py +0 -0
  148. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/admin/users.py +0 -0
  149. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/app.py +0 -0
  150. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/auth/__init__.py +0 -0
  151. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/auth/index.py +0 -0
  152. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/auth_token.py +0 -0
  153. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/interface.py +0 -0
  154. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/__init__.py +0 -0
  155. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/openai/__init__.py +0 -0
  156. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
  157. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
  158. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
  159. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/openai/assistants/threads.py +0 -0
  160. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
  161. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
  162. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/v1/__init__.py +0 -0
  163. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/v1/agents.py +0 -0
  164. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/v1/blocks.py +0 -0
  165. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/v1/jobs.py +0 -0
  166. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/v1/llms.py +0 -0
  167. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/v1/organizations.py +0 -0
  168. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/v1/sources.py +0 -0
  169. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/v1/tools.py +0 -0
  170. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/routers/v1/users.py +0 -0
  171. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/static_files.py +0 -0
  172. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/rest_api/utils.py +0 -0
  173. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/startup.sh +0 -0
  174. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/static_files/assets/index-0cbf7ad5.js +0 -0
  175. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/static_files/assets/index-156816da.css +0 -0
  176. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/static_files/assets/index-486e3228.js +0 -0
  177. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/static_files/favicon.ico +0 -0
  178. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/static_files/index.html +0 -0
  179. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
  180. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/utils.py +0 -0
  181. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/ws_api/__init__.py +0 -0
  182. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/ws_api/example_client.py +0 -0
  183. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/ws_api/interface.py +0 -0
  184. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/ws_api/protocol.py +0 -0
  185. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/server/ws_api/server.py +0 -0
  186. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/settings.py +0 -0
  187. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/streaming_interface.py +0 -0
  188. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/system.py +0 -0
  189. {letta_nightly-0.1.7.dev20240929104004 → letta_nightly-0.1.7.dev20241001104147}/letta/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-nightly
3
- Version: 0.1.7.dev20240929104004
3
+ Version: 0.1.7.dev20241001104147
4
4
  Summary: Create LLM agents with long-term memory and custom tools
5
5
  License: Apache License
6
6
  Author: Letta Team
@@ -19,6 +19,7 @@ Provides-Extra: ollama
19
19
  Provides-Extra: postgres
20
20
  Provides-Extra: qdrant
21
21
  Provides-Extra: server
22
+ Provides-Extra: tests
22
23
  Requires-Dist: autoflake (>=2.3.0,<3.0.0) ; extra == "dev"
23
24
  Requires-Dist: black[jupyter] (>=24.2.0,<25.0.0) ; extra == "dev"
24
25
  Requires-Dist: chromadb (>=0.4.24,<0.5.0)
@@ -69,6 +70,7 @@ Requires-Dist: tqdm (>=4.66.1,<5.0.0)
69
70
  Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
70
71
  Requires-Dist: uvicorn (>=0.24.0.post1,<0.25.0) ; extra == "server"
71
72
  Requires-Dist: websockets (>=12.0,<13.0) ; extra == "server"
73
+ Requires-Dist: wikipedia (>=1.4.0,<2.0.0) ; extra == "tests"
72
74
  Description-Content-Type: text/markdown
73
75
 
74
76
  # Letta (previously MemGPT)
@@ -350,7 +350,10 @@ class Agent(BaseAgent):
350
350
  exec(tool.module, env)
351
351
  else:
352
352
  exec(tool.source_code, env)
353
- self.functions_python[tool.name] = env[tool.name]
353
+ from pprint import pprint
354
+
355
+ pprint(tool.json_schema)
356
+ self.functions_python[tool.name] = env[tool.json_schema["name"]]
354
357
  self.functions.append(tool.json_schema)
355
358
  assert all([callable(f) for k, f in self.functions_python.items()]), self.functions_python
356
359
 
@@ -464,7 +464,6 @@ def run(
464
464
  # read user id from config
465
465
  ms = MetadataStore(config)
466
466
  client = create_client()
467
- client.user_id
468
467
 
469
468
  # determine agent to use, if not provided
470
469
  if not yes and not agent:
@@ -18,56 +18,6 @@ from letta.data_sources.connectors import DirectoryConnector
18
18
 
19
19
  app = typer.Typer()
20
20
 
21
- # NOTE: not supported due to llama-index breaking things (please reach out if you still need it)
22
- # @app.command("index")
23
- # def load_index(
24
- # name: Annotated[str, typer.Option(help="Name of dataset to load.")],
25
- # dir: Annotated[Optional[str], typer.Option(help="Path to directory containing index.")] = None,
26
- # user_id: Annotated[Optional[uuid.UUID], typer.Option(help="User ID to associate with dataset.")] = None,
27
- # ):
28
- # """Load a LlamaIndex saved VectorIndex into Letta"""
29
- # if user_id is None:
30
- # config = LettaConfig.load()
31
- # user_id = uuid.UUID(config.anon_clientid)
32
- #
33
- # try:
34
- # # load index data
35
- # storage_context = StorageContext.from_defaults(persist_dir=dir)
36
- # loaded_index = load_index_from_storage(storage_context)
37
- #
38
- # # hacky code to extract out passages/embeddings (thanks a lot, llama index)
39
- # embed_dict = loaded_index._vector_store._data.embedding_dict
40
- # node_dict = loaded_index._docstore.docs
41
- #
42
- # # create storage connector
43
- # config = LettaConfig.load()
44
- # if user_id is None:
45
- # user_id = uuid.UUID(config.anon_clientid)
46
- #
47
- # passages = []
48
- # for node_id, node in node_dict.items():
49
- # vector = embed_dict[node_id]
50
- # node.embedding = vector
51
- # # assume embedding are the same as config
52
- # passages.append(
53
- # Passage(
54
- # text=node.text,
55
- # embedding=np.array(vector),
56
- # embedding_dim=config.default_embedding_config.embedding_dim,
57
- # embedding_model=config.default_embedding_config.embedding_model,
58
- # )
59
- # )
60
- # assert config.default_embedding_config.embedding_dim == len(
61
- # vector
62
- # ), f"Expected embedding dimension {config.default_embedding_config.embedding_dim}, got {len(vector)}"
63
- #
64
- # if len(passages) == 0:
65
- # raise ValueError(f"No passages found in index {dir}")
66
- #
67
- # insert_passages_into_source(passages, name, user_id, config)
68
- # except ValueError as e:
69
- # typer.secho(f"Failed to load index from provided information.\n{e}", fg=typer.colors.RED)
70
-
71
21
 
72
22
  default_extensions = ".txt,.md,.pdf"
73
23
 
@@ -2,7 +2,6 @@ import configparser
2
2
  import inspect
3
3
  import json
4
4
  import os
5
- import uuid
6
5
  from dataclasses import dataclass
7
6
  from typing import Optional
8
7
 
@@ -14,6 +13,7 @@ from letta.constants import (
14
13
  DEFAULT_HUMAN,
15
14
  DEFAULT_PERSONA,
16
15
  DEFAULT_PRESET,
16
+ DEFAULT_USER_ID,
17
17
  LETTA_DIR,
18
18
  )
19
19
  from letta.log import get_logger
@@ -45,7 +45,7 @@ def set_field(config, section, field, value):
45
45
  @dataclass
46
46
  class LettaConfig:
47
47
  config_path: str = os.getenv("MEMGPT_CONFIG_PATH") or os.path.join(LETTA_DIR, "config")
48
- anon_clientid: str = str(uuid.UUID(int=0))
48
+ anon_clientid: str = DEFAULT_USER_ID
49
49
 
50
50
  # preset
51
51
  preset: str = DEFAULT_PRESET # TODO: rename to system prompt
@@ -100,10 +100,6 @@ class LettaConfig:
100
100
  # self.context_window = int(self.context_window)
101
101
  pass
102
102
 
103
- @staticmethod
104
- def generate_uuid() -> str:
105
- return uuid.UUID(int=uuid.getnode()).hex
106
-
107
103
  @classmethod
108
104
  def load(cls, llm_config: Optional[LLMConfig] = None, embedding_config: Optional[EmbeddingConfig] = None) -> "LettaConfig":
109
105
  # avoid circular import
@@ -199,8 +195,7 @@ class LettaConfig:
199
195
  # assert llm_config is not None, "LLM config must be provided if config does not exist"
200
196
 
201
197
  # create new config
202
- anon_clientid = LettaConfig.generate_uuid()
203
- config = cls(anon_clientid=anon_clientid, config_path=config_path)
198
+ config = cls(config_path=config_path)
204
199
 
205
200
  config.create_config_dir() # create dirs
206
201
 
@@ -284,8 +279,6 @@ class LettaConfig:
284
279
  set_field(config, "version", "letta_version", letta.__version__)
285
280
 
286
281
  # client
287
- if not self.anon_clientid:
288
- self.anon_clientid = self.generate_uuid()
289
282
  set_field(config, "client", "anon_clientid", self.anon_clientid)
290
283
 
291
284
  # always make sure all directories are present
@@ -0,0 +1,175 @@
1
+ from typing import Any, Optional, Union
2
+
3
+ from pydantic import BaseModel
4
+
5
+
6
+ def generate_langchain_tool_wrapper(tool: "LangChainBaseTool", additional_imports_module_attr_map: dict = None) -> tuple[str, str]:
7
+ tool_name = tool.__class__.__name__
8
+ import_statement = f"from langchain_community.tools import {tool_name}"
9
+ extra_module_imports = generate_import_code(additional_imports_module_attr_map)
10
+
11
+ # Safety check that user has passed in all required imports:
12
+ current_class_imports = {tool_name}
13
+ if additional_imports_module_attr_map:
14
+ current_class_imports.update(set(additional_imports_module_attr_map.values()))
15
+ required_class_imports = set(find_required_class_names_for_import(tool))
16
+
17
+ if not current_class_imports.issuperset(required_class_imports):
18
+ err_msg = f"[ERROR] You are missing module_attr pairs in `additional_imports_module_attr_map`. Currently, you have imports for {current_class_imports}, but the required classes for import are {required_class_imports}"
19
+ print(err_msg)
20
+ raise RuntimeError(err_msg)
21
+
22
+ tool_instantiation = f"tool = {generate_imported_tool_instantiation_call_str(tool)}"
23
+ run_call = f"return tool._run(**kwargs)"
24
+ func_name = f"run_{tool_name.lower()}"
25
+
26
+ # Combine all parts into the wrapper function
27
+ wrapper_function_str = f"""
28
+ def {func_name}(**kwargs):
29
+ if 'self' in kwargs:
30
+ del kwargs['self']
31
+ import importlib
32
+ {import_statement}
33
+ {extra_module_imports}
34
+ {tool_instantiation}
35
+ {run_call}
36
+ """
37
+ return func_name, wrapper_function_str
38
+
39
+
40
+ def generate_crewai_tool_wrapper(tool: "CrewAIBaseTool") -> tuple[str, str]:
41
+ tool_name = tool.__class__.__name__
42
+ import_statement = f"from crewai_tools import {tool_name}"
43
+ tool_instantiation = f"tool = {generate_imported_tool_instantiation_call_str(tool)}"
44
+ run_call = f"return tool._run(**kwargs)"
45
+ func_name = f"run_{tool_name.lower()}"
46
+
47
+ # Combine all parts into the wrapper function
48
+ wrapper_function_str = f"""
49
+ def {func_name}(**kwargs):
50
+ if 'self' in kwargs:
51
+ del kwargs['self']
52
+ {import_statement}
53
+ {tool_instantiation}
54
+ {run_call}
55
+ """
56
+ return func_name, wrapper_function_str
57
+
58
+
59
+ def find_required_class_names_for_import(obj: Union["LangChainBaseTool", "CrewAIBaseTool", BaseModel]) -> list[str]:
60
+ """
61
+ Finds all the class names for required imports when instantiating the `obj`.
62
+ NOTE: This does not return the full import path, only the class name.
63
+
64
+ We accomplish this by running BFS and deep searching all the BaseModel objects in the obj parameters.
65
+ """
66
+ class_names = {obj.__class__.__name__}
67
+ queue = [obj]
68
+
69
+ while queue:
70
+ # Get the current object we are inspecting
71
+ curr_obj = queue.pop()
72
+
73
+ # Collect all possible candidates for BaseModel objects
74
+ candidates = []
75
+ if is_base_model(curr_obj):
76
+ # If it is a base model, we get all the values of the object parameters
77
+ # i.e., if obj('b' = <class A>), we would want to inspect <class A>
78
+ fields = dict(curr_obj)
79
+ # Generate code for each field, skipping empty or None values
80
+ candidates = list(fields.values())
81
+ elif isinstance(curr_obj, dict):
82
+ # If it is a dictionary, we get all the values
83
+ # i.e., if obj = {'a': 3, 'b': <class A>}, we would want to inspect <class A>
84
+ candidates = list(curr_obj.values())
85
+ elif isinstance(curr_obj, list):
86
+ # If it is a list, we inspect all the items in the list
87
+ # i.e., if obj = ['a', 3, None, <class A>], we would want to inspect <class A>
88
+ candidates = curr_obj
89
+
90
+ # Filter out all candidates that are not BaseModels
91
+ # In the list example above, ['a', 3, None, <class A>], we want to filter out 'a', 3, and None
92
+ candidates = filter(lambda x: is_base_model(x), candidates)
93
+
94
+ # Classic BFS here
95
+ for c in candidates:
96
+ c_name = c.__class__.__name__
97
+ if c_name not in class_names:
98
+ class_names.add(c_name)
99
+ queue.append(c)
100
+
101
+ return list(class_names)
102
+
103
+
104
+ def generate_imported_tool_instantiation_call_str(obj: Any) -> Optional[str]:
105
+ if isinstance(obj, (int, float, str, bool, type(None))):
106
+ # This is the base case
107
+ # If it is a basic Python type, we trivially return the string version of that value
108
+ # Handle basic types
109
+ return repr(obj)
110
+ elif is_base_model(obj):
111
+ # Otherwise, if it is a BaseModel
112
+ # We want to pull out all the parameters, and reformat them into strings
113
+ # e.g. {arg}={value}
114
+ # The reason why this is recursive, is because the value can be another BaseModel that we need to stringify
115
+ model_name = obj.__class__.__name__
116
+ fields = dict(obj)
117
+ # Generate code for each field, skipping empty or None values
118
+ field_assignments = []
119
+ for arg, value in fields.items():
120
+ python_string = generate_imported_tool_instantiation_call_str(value)
121
+ if python_string:
122
+ field_assignments.append(f"{arg}={python_string}")
123
+
124
+ assignments = ", ".join(field_assignments)
125
+ return f"{model_name}({assignments})"
126
+ elif isinstance(obj, dict):
127
+ # Inspect each of the items in the dict and stringify them
128
+ # This is important because the dictionary may contain other BaseModels
129
+ dict_items = []
130
+ for k, v in obj.items():
131
+ python_string = generate_imported_tool_instantiation_call_str(v)
132
+ if python_string:
133
+ dict_items.append(f"{repr(k)}: {python_string}")
134
+
135
+ joined_items = ", ".join(dict_items)
136
+ return f"{{{joined_items}}}"
137
+ elif isinstance(obj, list):
138
+ # Inspect each of the items in the list and stringify them
139
+ # This is important because the list may contain other BaseModels
140
+ list_items = [generate_imported_tool_instantiation_call_str(v) for v in obj]
141
+ filtered_list_items = list(filter(None, list_items))
142
+ list_items = ", ".join(filtered_list_items)
143
+ return f"[{list_items}]"
144
+ else:
145
+ # Otherwise, if it is none of the above, that usually means it is a custom Python class that is NOT a BaseModel
146
+ # Thus, we cannot get enough information about it to stringify it
147
+ # This may cause issues, but we are making the assumption that any of these custom Python types are handled correctly by the parent library, such as LangChain or CrewAI
148
+ # An example would be that WikipediaAPIWrapper has an argument that is a wikipedia (pip install wikipedia) object
149
+ # We cannot stringify this easily, but WikipediaAPIWrapper handles the setting of this parameter internally
150
+ # This assumption seems fair to me, since usually they are external imports, and LangChain and CrewAI should be bundling those as module-level imports within the tool
151
+ # We throw a warning here anyway and provide the class name
152
+ print(
153
+ f"[WARNING] Skipping parsing unknown class {obj.__class__.__name__} (does not inherit from the Pydantic BaseModel and is not a basic Python type)"
154
+ )
155
+ return None
156
+
157
+
158
+ def is_base_model(obj: Any):
159
+ from crewai_tools.tools.base_tool import BaseModel as CrewAiBaseModel
160
+ from langchain_core.pydantic_v1 import BaseModel as LangChainBaseModel
161
+
162
+ return isinstance(obj, BaseModel) or isinstance(obj, LangChainBaseModel) or isinstance(obj, CrewAiBaseModel)
163
+
164
+
165
+ def generate_import_code(module_attr_map: Optional[dict]):
166
+ if not module_attr_map:
167
+ return ""
168
+
169
+ code_lines = []
170
+ for module, attr in module_attr_map.items():
171
+ module_name = module.split(".")[-1]
172
+ code_lines.append(f"# Load the module\n {module_name} = importlib.import_module('{module}')")
173
+ code_lines.append(f" # Access the {attr} from the module")
174
+ code_lines.append(f" {attr} = getattr({module_name}, '{attr}')")
175
+ return "\n".join(code_lines)
@@ -1,6 +1,5 @@
1
1
  import inspect
2
- import typing
3
- from typing import Any, Dict, Optional, Type, get_args, get_origin
2
+ from typing import Any, Dict, Optional, Type, Union, get_args, get_origin
4
3
 
5
4
  from docstring_parser import parse
6
5
  from pydantic import BaseModel
@@ -8,7 +7,7 @@ from pydantic import BaseModel
8
7
 
9
8
  def is_optional(annotation):
10
9
  # Check if the annotation is a Union
11
- if getattr(annotation, "__origin__", None) is typing.Union:
10
+ if getattr(annotation, "__origin__", None) is Union:
12
11
  # Check if None is one of the options in the Union
13
12
  return type(None) in annotation.__args__
14
13
  return False
@@ -164,42 +163,3 @@ def generate_schema_from_args_schema(
164
163
  }
165
164
 
166
165
  return function_call_json
167
-
168
-
169
- def generate_langchain_tool_wrapper(tool_name: str) -> str:
170
- import_statement = f"from langchain_community.tools import {tool_name}"
171
-
172
- # NOTE: this will fail for tools like 'wikipedia = WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper())' since it needs to pass an argument to the tool instantiation
173
- # https://python.langchain.com/v0.1/docs/integrations/tools/wikipedia/
174
- tool_instantiation = f"tool = {tool_name}()"
175
- run_call = f"return tool._run(**kwargs)"
176
- func_name = f"run_{tool_name.lower()}"
177
-
178
- # Combine all parts into the wrapper function
179
- wrapper_function_str = f"""
180
- def {func_name}(**kwargs):
181
- if 'self' in kwargs:
182
- del kwargs['self']
183
- {import_statement}
184
- {tool_instantiation}
185
- {run_call}
186
- """
187
- return func_name, wrapper_function_str
188
-
189
-
190
- def generate_crewai_tool_wrapper(tool_name: str) -> str:
191
- import_statement = f"from crewai_tools import {tool_name}"
192
- tool_instantiation = f"tool = {tool_name}()"
193
- run_call = f"return tool._run(**kwargs)"
194
- func_name = f"run_{tool_name.lower()}"
195
-
196
- # Combine all parts into the wrapper function
197
- wrapper_function_str = f"""
198
- def {func_name}(**kwargs):
199
- if 'self' in kwargs:
200
- del kwargs['self']
201
- {import_statement}
202
- {tool_instantiation}
203
- {run_call}
204
- """
205
- return func_name, wrapper_function_str
@@ -2,11 +2,11 @@ from typing import Dict, List, Optional
2
2
 
3
3
  from pydantic import Field
4
4
 
5
- from letta.functions.schema_generator import (
5
+ from letta.functions.helpers import (
6
6
  generate_crewai_tool_wrapper,
7
7
  generate_langchain_tool_wrapper,
8
- generate_schema_from_args_schema,
9
8
  )
9
+ from letta.functions.schema_generator import generate_schema_from_args_schema
10
10
  from letta.schemas.letta_base import LettaBase
11
11
  from letta.schemas.openai.chat_completions import ToolCall
12
12
 
@@ -58,12 +58,13 @@ class Tool(BaseTool):
58
58
  )
59
59
 
60
60
  @classmethod
61
- def from_langchain(cls, langchain_tool) -> "Tool":
61
+ def from_langchain(cls, langchain_tool: "LangChainBaseTool", additional_imports_module_attr_map: dict[str, str] = None) -> "Tool":
62
62
  """
63
63
  Class method to create an instance of Tool from a Langchain tool (must be from langchain_community.tools).
64
64
 
65
65
  Args:
66
- langchain_tool (LangchainTool): An instance of a crewAI BaseTool (BaseTool from crewai)
66
+ langchain_tool (LangChainBaseTool): An instance of a crewAI BaseTool (BaseTool from crewai)
67
+ additional_imports_module_attr_map (dict[str, str]): A mapping of module names to attribute name. This is used internally to import all the required classes for the langchain tool. For example, you would pass in `{"langchain_community.utilities": "WikipediaAPIWrapper"}` for `from langchain_community.tools import WikipediaQueryRun`. NOTE: You do NOT need to specify the tool import here, that is done automatically for you.
67
68
 
68
69
  Returns:
69
70
  Tool: A Letta Tool initialized with attributes derived from the provided crewAI BaseTool object.
@@ -72,7 +73,7 @@ class Tool(BaseTool):
72
73
  source_type = "python"
73
74
  tags = ["langchain"]
74
75
  # NOTE: langchain tools may come from different packages
75
- wrapper_func_name, wrapper_function_str = generate_langchain_tool_wrapper(langchain_tool.__class__.__name__)
76
+ wrapper_func_name, wrapper_function_str = generate_langchain_tool_wrapper(langchain_tool, additional_imports_module_attr_map)
76
77
  json_schema = generate_schema_from_args_schema(langchain_tool.args_schema, name=wrapper_func_name, description=description)
77
78
 
78
79
  # append heartbeat (necessary for triggering another reasoning step after this tool call)
@@ -92,7 +93,7 @@ class Tool(BaseTool):
92
93
  )
93
94
 
94
95
  @classmethod
95
- def from_crewai(cls, crewai_tool) -> "Tool":
96
+ def from_crewai(cls, crewai_tool: "CrewAIBaseTool") -> "Tool":
96
97
  """
97
98
  Class method to create an instance of Tool from a crewAI BaseTool object.
98
99
 
@@ -102,11 +103,10 @@ class Tool(BaseTool):
102
103
  Returns:
103
104
  Tool: A Letta Tool initialized with attributes derived from the provided crewAI BaseTool object.
104
105
  """
105
- crewai_tool.name
106
106
  description = crewai_tool.description
107
107
  source_type = "python"
108
108
  tags = ["crew-ai"]
109
- wrapper_func_name, wrapper_function_str = generate_crewai_tool_wrapper(crewai_tool.__class__.__name__)
109
+ wrapper_func_name, wrapper_function_str = generate_crewai_tool_wrapper(crewai_tool)
110
110
  json_schema = generate_schema_from_args_schema(crewai_tool.args_schema, name=wrapper_func_name, description=description)
111
111
 
112
112
  # append heartbeat (necessary for triggering another reasoning step after this tool call)
@@ -1441,10 +1441,6 @@ class SyncServer(Server):
1441
1441
  logger.exception(f"Failed to delete agent {agent_id} via ID with:\n{str(e)}")
1442
1442
  raise ValueError(f"Failed to delete agent {agent_id} in database")
1443
1443
 
1444
- def authenticate_user(self) -> str:
1445
- # TODO: Implement actual authentication to enable multi user setup
1446
- return str(LettaConfig.load().anon_clientid)
1447
-
1448
1444
  def api_key_to_user(self, api_key: str) -> str:
1449
1445
  """Decode an API key to a user"""
1450
1446
  user = self.ms.get_user_from_api_key(api_key=api_key)
@@ -1752,7 +1748,7 @@ class SyncServer(Server):
1752
1748
 
1753
1749
  # TODO: not sure if this always works
1754
1750
  func = env[functions[-1]]
1755
- json_schema = generate_schema(func, request.name)
1751
+ json_schema = generate_schema(func)
1756
1752
  else:
1757
1753
  # provided by client
1758
1754
  json_schema = request.json_schema
@@ -1973,19 +1969,6 @@ class SyncServer(Server):
1973
1969
  return current_user
1974
1970
 
1975
1971
  return self.get_default_user()
1976
- ## NOTE: same code as local client to get the default user
1977
- # config = LettaConfig.load()
1978
- # user_id = config.anon_clientid
1979
- # user = self.get_user(user_id)
1980
-
1981
- # if not user:
1982
- # user = self.create_user(UserCreate())
1983
-
1984
- # # # update config
1985
- # config.anon_clientid = str(user.id)
1986
- # config.save()
1987
-
1988
- # return user
1989
1972
 
1990
1973
  def list_models(self) -> List[LLMConfig]:
1991
1974
  """List available models"""
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "letta-nightly"
3
- version = "0.1.7.dev20240929104004"
3
+ version = "0.1.7.dev20241001104147"
4
4
  packages = [
5
5
  {include = "letta"}
6
6
  ]
@@ -71,6 +71,7 @@ llama-index = "^0.11.9"
71
71
  llama-index-embeddings-openai = "^0.2.5"
72
72
  llama-index-embeddings-ollama = "^0.3.1"
73
73
  #llama-index-embeddings-huggingface = {version = "^0.2.0", optional = true}
74
+ wikipedia = {version = "^1.4.0", optional = true}
74
75
 
75
76
  [tool.poetry.extras]
76
77
  #local = ["llama-index-embeddings-huggingface"]
@@ -82,6 +83,7 @@ autogen = ["pyautogen"]
82
83
  qdrant = ["qdrant-client"]
83
84
  ollama = ["llama-index-embeddings-ollama"]
84
85
  crewai-tools = ["crewai", "docker", "crewai-tools"]
86
+ tests = ["wikipedia"]
85
87
 
86
88
  [tool.poetry.group.dev.dependencies]
87
89
  black = "^24.4.2"