letta-nightly 0.1.7.dev20241001104147__tar.gz → 0.1.7.dev20241003104113__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.
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/PKG-INFO +14 -10
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/README.md +4 -4
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/__init__.py +1 -1
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/agent.py +18 -55
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/client/client.py +1 -1
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/functions/functions.py +1 -24
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/functions/helpers.py +74 -12
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/llm_api/openai.py +2 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/block.py +1 -9
- letta_nightly-0.1.7.dev20241003104113/letta/schemas/health.py +10 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/tool.py +52 -3
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/v1/__init__.py +2 -0
- letta_nightly-0.1.7.dev20241003104113/letta/server/rest_api/routers/v1/health.py +20 -0
- letta_nightly-0.1.7.dev20241001104147/letta/server/static_files/assets/index-0cbf7ad5.js → letta_nightly-0.1.7.dev20241003104113/letta/server/static_files/assets/index-4d08d8a3.js +75 -75
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/static_files/index.html +1 -1
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/pyproject.toml +6 -2
- letta_nightly-0.1.7.dev20241001104147/letta/server/static_files/assets/index-486e3228.js +0 -274
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/LICENSE +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/__main__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/agent_store/chroma.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/agent_store/db.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/agent_store/lancedb.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/agent_store/milvus.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/agent_store/qdrant.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/agent_store/storage.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/benchmark/benchmark.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/benchmark/constants.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/cli/cli.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/cli/cli_config.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/cli/cli_load.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/client/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/client/admin.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/client/streaming.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/client/utils.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/config.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/configs/anthropic.json +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/configs/letta_hosted.json +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/configs/openai.json +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/constants.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/credentials.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/data_sources/connectors.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/embeddings.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/errors.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/functions/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/functions/function_sets/base.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/functions/function_sets/extras.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/functions/schema_generator.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/humans/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/humans/examples/basic.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/humans/examples/cs_phd.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/interface.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/llm_api/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/llm_api/anthropic.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/llm_api/azure_openai.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/llm_api/cohere.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/llm_api/google_ai.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/llm_api/llm_api_tools.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/README.md +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/chat_completion_proxy.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/constants.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/function_parser.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/grammars/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/grammars/json.gbnf +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/groq/api.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/json_parser.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/koboldcpp/api.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/koboldcpp/settings.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llamacpp/api.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llamacpp/settings.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/lmstudio/api.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/lmstudio/settings.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/ollama/api.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/ollama/settings.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/settings/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/settings/settings.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/settings/simple.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/utils.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/vllm/api.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/webui/api.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/webui/legacy_api.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/webui/legacy_settings.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/local_llm/webui/settings.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/log.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/main.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/memory.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/metadata.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/openai_backcompat/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/openai_backcompat/openai_object.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/persistence_manager.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/personas/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/personas/examples/anna_pa.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/personas/examples/google_search_persona.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/personas/examples/memgpt_doc.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/personas/examples/memgpt_starter.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/personas/examples/sam.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/personas/examples/sam_pov.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/personas/examples/sqldb/test.db +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/gpt_summarize.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/gpt_system.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/system/memgpt_base.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/system/memgpt_chat.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/system/memgpt_doc.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/pytest.ini +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/agent.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/api_key.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/document.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/embedding_config.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/enums.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/job.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/letta_base.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/letta_message.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/letta_request.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/letta_response.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/llm_config.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/memory.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/message.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/openai/chat_completion_request.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/openai/chat_completion_response.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/openai/chat_completions.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/openai/embedding_response.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/openai/openai.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/organization.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/passage.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/source.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/usage.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/schemas/user.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/constants.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/admin/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/admin/agents.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/admin/tools.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/admin/users.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/app.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/auth/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/auth/index.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/auth_token.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/interface.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/openai/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/openai/assistants/threads.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/v1/agents.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/v1/blocks.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/v1/jobs.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/v1/llms.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/v1/organizations.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/v1/sources.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/v1/tools.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/routers/v1/users.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/static_files.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/rest_api/utils.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/server.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/startup.sh +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/static_files/assets/index-156816da.css +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/static_files/favicon.ico +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/utils.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/ws_api/__init__.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/ws_api/example_client.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/ws_api/interface.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/ws_api/protocol.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/server/ws_api/server.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/settings.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/streaming_interface.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/system.py +0 -0
- {letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/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.
|
|
3
|
+
Version: 0.1.7.dev20241003104113
|
|
4
4
|
Summary: Create LLM agents with long-term memory and custom tools
|
|
5
5
|
License: Apache License
|
|
6
6
|
Author: Letta Team
|
|
@@ -12,8 +12,8 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Provides-Extra: autogen
|
|
15
|
-
Provides-Extra: crewai-tools
|
|
16
15
|
Provides-Extra: dev
|
|
16
|
+
Provides-Extra: external-tools
|
|
17
17
|
Provides-Extra: milvus
|
|
18
18
|
Provides-Extra: ollama
|
|
19
19
|
Provides-Extra: postgres
|
|
@@ -23,11 +23,13 @@ Provides-Extra: tests
|
|
|
23
23
|
Requires-Dist: autoflake (>=2.3.0,<3.0.0) ; extra == "dev"
|
|
24
24
|
Requires-Dist: black[jupyter] (>=24.2.0,<25.0.0) ; extra == "dev"
|
|
25
25
|
Requires-Dist: chromadb (>=0.4.24,<0.5.0)
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
26
|
+
Requires-Dist: composio-core (>=0.5.28,<0.6.0) ; extra == "external-tools"
|
|
27
|
+
Requires-Dist: composio-langchain (>=0.5.28,<0.6.0) ; extra == "external-tools"
|
|
28
|
+
Requires-Dist: crewai (>=0.41.1,<0.42.0) ; extra == "external-tools"
|
|
29
|
+
Requires-Dist: crewai-tools (>=0.8.3,<0.9.0) ; extra == "external-tools"
|
|
28
30
|
Requires-Dist: datasets (>=2.14.6,<3.0.0) ; extra == "dev"
|
|
29
31
|
Requires-Dist: demjson3 (>=3.0.6,<4.0.0)
|
|
30
|
-
Requires-Dist: docker (>=7.1.0,<8.0.0) ; extra == "
|
|
32
|
+
Requires-Dist: docker (>=7.1.0,<8.0.0) ; extra == "external-tools"
|
|
31
33
|
Requires-Dist: docstring-parser (>=0.16,<0.17)
|
|
32
34
|
Requires-Dist: docx2txt (>=0.8,<0.9)
|
|
33
35
|
Requires-Dist: fastapi (>=0.104.1,<0.105.0) ; extra == "server"
|
|
@@ -36,6 +38,8 @@ Requires-Dist: httpx (>=0.27.2,<0.28.0)
|
|
|
36
38
|
Requires-Dist: httpx-sse (>=0.4.0,<0.5.0)
|
|
37
39
|
Requires-Dist: isort (>=5.13.2,<6.0.0) ; extra == "dev"
|
|
38
40
|
Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
|
|
41
|
+
Requires-Dist: langchain (>=0.2.16,<0.3.0) ; extra == "external-tools"
|
|
42
|
+
Requires-Dist: langchain-community (>=0.2.17,<0.3.0) ; extra == "external-tools"
|
|
39
43
|
Requires-Dist: llama-index (>=0.11.9,<0.12.0)
|
|
40
44
|
Requires-Dist: llama-index-embeddings-ollama (>=0.3.1,<0.4.0) ; extra == "ollama"
|
|
41
45
|
Requires-Dist: llama-index-embeddings-openai (>=0.2.5,<0.3.0)
|
|
@@ -70,7 +74,7 @@ Requires-Dist: tqdm (>=4.66.1,<5.0.0)
|
|
|
70
74
|
Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
|
|
71
75
|
Requires-Dist: uvicorn (>=0.24.0.post1,<0.25.0) ; extra == "server"
|
|
72
76
|
Requires-Dist: websockets (>=12.0,<13.0) ; extra == "server"
|
|
73
|
-
Requires-Dist: wikipedia (>=1.4.0,<2.0.0) ; extra == "tests"
|
|
77
|
+
Requires-Dist: wikipedia (>=1.4.0,<2.0.0) ; extra == "external-tools" or extra == "tests"
|
|
74
78
|
Description-Content-Type: text/markdown
|
|
75
79
|
|
|
76
80
|
# Letta (previously MemGPT)
|
|
@@ -79,13 +83,13 @@ Description-Content-Type: text/markdown
|
|
|
79
83
|
[](https://arxiv.org/abs/2310.08560)
|
|
80
84
|
|
|
81
85
|
> [!NOTE]
|
|
82
|
-
> **Looking for MemGPT?**
|
|
86
|
+
> **Looking for MemGPT?** You're in the right place!
|
|
83
87
|
>
|
|
84
|
-
> The MemGPT package and Docker image have been renamed to `letta` to clarify the distinction between
|
|
88
|
+
> The MemGPT package and Docker image have been renamed to `letta` to clarify the distinction between MemGPT agents and the API server / runtime that runs LLM agents as *services*.
|
|
85
89
|
>
|
|
86
|
-
> You use the **Letta
|
|
90
|
+
> You use the **Letta _framework_** to create **MemGPT _agents_**. Read more about the relationship between MemGPT and Letta [here](https://www.letta.com/blog/memgpt-and-letta).
|
|
87
91
|
|
|
88
|
-
|
|
92
|
+
Visit our [documentation page](https://docs.letta.com) for information on setup and usage.
|
|
89
93
|
|
|
90
94
|
## How to Get Involved
|
|
91
95
|
* **Contribute to the Project**: Interested in contributing? Start by reading our [Contribution Guidelines](https://github.com/cpacker/MemGPT/tree/main/CONTRIBUTING.md).
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
[](https://arxiv.org/abs/2310.08560)
|
|
5
5
|
|
|
6
6
|
> [!NOTE]
|
|
7
|
-
> **Looking for MemGPT?**
|
|
7
|
+
> **Looking for MemGPT?** You're in the right place!
|
|
8
8
|
>
|
|
9
|
-
> The MemGPT package and Docker image have been renamed to `letta` to clarify the distinction between
|
|
9
|
+
> The MemGPT package and Docker image have been renamed to `letta` to clarify the distinction between MemGPT agents and the API server / runtime that runs LLM agents as *services*.
|
|
10
10
|
>
|
|
11
|
-
> You use the **Letta
|
|
11
|
+
> You use the **Letta _framework_** to create **MemGPT _agents_**. Read more about the relationship between MemGPT and Letta [here](https://www.letta.com/blog/memgpt-and-letta).
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Visit our [documentation page](https://docs.letta.com) for information on setup and usage.
|
|
14
14
|
|
|
15
15
|
## How to Get Involved
|
|
16
16
|
* **Contribute to the Project**: Interested in contributing? Start by reading our [Contribution Guidelines](https://github.com/cpacker/MemGPT/tree/main/CONTRIBUTING.md).
|
{letta_nightly-0.1.7.dev20241001104147 → letta_nightly-0.1.7.dev20241003104113}/letta/agent.py
RENAMED
|
@@ -237,10 +237,8 @@ class Agent(BaseAgent):
|
|
|
237
237
|
self.agent_state = agent_state
|
|
238
238
|
assert isinstance(self.agent_state.memory, Memory), f"Memory object is not of type Memory: {type(self.agent_state.memory)}"
|
|
239
239
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
except Exception as e:
|
|
243
|
-
raise ValueError(f"Encountered an error while trying to link agent tools during initialization:\n{str(e)}")
|
|
240
|
+
# link tools
|
|
241
|
+
self.link_tools(tools)
|
|
244
242
|
|
|
245
243
|
# gpt-4, gpt-3.5-turbo, ...
|
|
246
244
|
self.model = self.agent_state.llm_config.model
|
|
@@ -345,16 +343,18 @@ class Agent(BaseAgent):
|
|
|
345
343
|
env = {}
|
|
346
344
|
env.update(globals())
|
|
347
345
|
for tool in tools:
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
346
|
+
try:
|
|
347
|
+
# WARNING: name may not be consistent?
|
|
348
|
+
if tool.module: # execute the whole module
|
|
349
|
+
exec(tool.module, env)
|
|
350
|
+
else:
|
|
351
|
+
exec(tool.source_code, env)
|
|
354
352
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
353
|
+
self.functions_python[tool.json_schema["name"]] = env[tool.json_schema["name"]]
|
|
354
|
+
self.functions.append(tool.json_schema)
|
|
355
|
+
except Exception as e:
|
|
356
|
+
warnings.warn(f"WARNING: tool {tool.name} failed to link")
|
|
357
|
+
print(e)
|
|
358
358
|
assert all([callable(f) for k, f in self.functions_python.items()]), self.functions_python
|
|
359
359
|
|
|
360
360
|
def _load_messages_from_recall(self, message_ids: List[str]) -> List[Message]:
|
|
@@ -551,18 +551,19 @@ class Agent(BaseAgent):
|
|
|
551
551
|
) # extend conversation with assistant's reply
|
|
552
552
|
printd(f"Function call message: {messages[-1]}")
|
|
553
553
|
|
|
554
|
-
|
|
555
|
-
|
|
554
|
+
if response_message.content:
|
|
555
|
+
# The content if then internal monologue, not chat
|
|
556
|
+
self.interface.internal_monologue(response_message.content, msg_obj=messages[-1])
|
|
556
557
|
|
|
557
558
|
# Step 3: call the function
|
|
558
559
|
# Note: the JSON response may not always be valid; be sure to handle errors
|
|
559
|
-
|
|
560
|
-
# Failure case 1: function name is wrong
|
|
561
560
|
function_call = (
|
|
562
561
|
response_message.function_call if response_message.function_call is not None else response_message.tool_calls[0].function
|
|
563
562
|
)
|
|
564
563
|
function_name = function_call.name
|
|
565
564
|
printd(f"Request to call function {function_name} with tool_call_id: {tool_call_id}")
|
|
565
|
+
|
|
566
|
+
# Failure case 1: function name is wrong
|
|
566
567
|
try:
|
|
567
568
|
function_to_call = self.functions_python[function_name]
|
|
568
569
|
except KeyError:
|
|
@@ -1117,48 +1118,10 @@ class Agent(BaseAgent):
|
|
|
1117
1118
|
def add_function(self, function_name: str) -> str:
|
|
1118
1119
|
# TODO: refactor
|
|
1119
1120
|
raise NotImplementedError
|
|
1120
|
-
# if function_name in self.functions_python.keys():
|
|
1121
|
-
# msg = f"Function {function_name} already loaded"
|
|
1122
|
-
# printd(msg)
|
|
1123
|
-
# return msg
|
|
1124
|
-
|
|
1125
|
-
# available_functions = load_all_function_sets()
|
|
1126
|
-
# if function_name not in available_functions.keys():
|
|
1127
|
-
# raise ValueError(f"Function {function_name} not found in function library")
|
|
1128
|
-
|
|
1129
|
-
# self.functions.append(available_functions[function_name]["json_schema"])
|
|
1130
|
-
# self.functions_python[function_name] = available_functions[function_name]["python_function"]
|
|
1131
|
-
|
|
1132
|
-
# msg = f"Added function {function_name}"
|
|
1133
|
-
## self.save()
|
|
1134
|
-
# self.update_state()
|
|
1135
|
-
# printd(msg)
|
|
1136
|
-
# return msg
|
|
1137
1121
|
|
|
1138
1122
|
def remove_function(self, function_name: str) -> str:
|
|
1139
1123
|
# TODO: refactor
|
|
1140
1124
|
raise NotImplementedError
|
|
1141
|
-
# if function_name not in self.functions_python.keys():
|
|
1142
|
-
# msg = f"Function {function_name} not loaded, ignoring"
|
|
1143
|
-
# printd(msg)
|
|
1144
|
-
# return msg
|
|
1145
|
-
|
|
1146
|
-
## only allow removal of user defined functions
|
|
1147
|
-
# user_func_path = Path(USER_FUNCTIONS_DIR)
|
|
1148
|
-
# func_path = Path(inspect.getfile(self.functions_python[function_name]))
|
|
1149
|
-
# is_subpath = func_path.resolve().parts[: len(user_func_path.resolve().parts)] == user_func_path.resolve().parts
|
|
1150
|
-
|
|
1151
|
-
# if not is_subpath:
|
|
1152
|
-
# raise ValueError(f"Function {function_name} is not user defined and cannot be removed")
|
|
1153
|
-
|
|
1154
|
-
# self.functions = [f_schema for f_schema in self.functions if f_schema["name"] != function_name]
|
|
1155
|
-
# self.functions_python.pop(function_name)
|
|
1156
|
-
|
|
1157
|
-
# msg = f"Removed function {function_name}"
|
|
1158
|
-
## self.save()
|
|
1159
|
-
# self.update_state()
|
|
1160
|
-
# printd(msg)
|
|
1161
|
-
# return msg
|
|
1162
1125
|
|
|
1163
1126
|
def update_state(self) -> AgentState:
|
|
1164
1127
|
message_ids = [msg.id for msg in self._messages]
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import importlib
|
|
2
2
|
import inspect
|
|
3
3
|
import os
|
|
4
|
-
import sys
|
|
5
4
|
from textwrap import dedent # remove indentation
|
|
6
5
|
from types import ModuleType
|
|
7
6
|
|
|
8
|
-
from letta.constants import CLI_WARNING_PREFIX
|
|
7
|
+
from letta.constants import CLI_WARNING_PREFIX
|
|
9
8
|
from letta.functions.schema_generator import generate_schema
|
|
10
9
|
|
|
11
|
-
USER_FUNCTIONS_DIR = os.path.join(LETTA_DIR, "functions")
|
|
12
|
-
|
|
13
|
-
sys.path.append(USER_FUNCTIONS_DIR)
|
|
14
|
-
|
|
15
10
|
|
|
16
11
|
def parse_source_code(func) -> str:
|
|
17
12
|
"""Parse the source code of a function and remove indendation"""
|
|
@@ -68,24 +63,6 @@ def validate_function(module_name, module_full_path):
|
|
|
68
63
|
return True, None
|
|
69
64
|
|
|
70
65
|
|
|
71
|
-
def write_function(module_name: str, function_name: str, function_code: str):
|
|
72
|
-
"""Write a function to a file in the user functions directory"""
|
|
73
|
-
# Create the user functions directory if it doesn't exist
|
|
74
|
-
if not os.path.exists(USER_FUNCTIONS_DIR):
|
|
75
|
-
os.makedirs(USER_FUNCTIONS_DIR)
|
|
76
|
-
|
|
77
|
-
# Write the function to a file
|
|
78
|
-
file_path = os.path.join(USER_FUNCTIONS_DIR, f"{module_name}.py")
|
|
79
|
-
with open(file_path, "w", encoding="utf-8") as f:
|
|
80
|
-
f.write(function_code)
|
|
81
|
-
succ, error = validate_function(module_name, file_path)
|
|
82
|
-
|
|
83
|
-
# raise error if function cannot be loaded
|
|
84
|
-
if not succ:
|
|
85
|
-
raise ValueError(error)
|
|
86
|
-
return file_path
|
|
87
|
-
|
|
88
|
-
|
|
89
66
|
def load_function_file(filepath: str) -> dict:
|
|
90
67
|
file = os.path.basename(filepath)
|
|
91
68
|
module_name = file[:-3] # Remove '.py' from filename
|
|
@@ -3,21 +3,40 @@ from typing import Any, Optional, Union
|
|
|
3
3
|
from pydantic import BaseModel
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def
|
|
6
|
+
def generate_composio_tool_wrapper(action: "ActionType") -> tuple[str, str]:
|
|
7
|
+
# Instantiate the object
|
|
8
|
+
tool_instantiation_str = f"composio_toolset.get_tools(actions=[Action.{action.name}])[0]"
|
|
9
|
+
|
|
10
|
+
# Generate func name
|
|
11
|
+
func_name = f"run_{action.name}"
|
|
12
|
+
|
|
13
|
+
wrapper_function_str = f"""
|
|
14
|
+
def {func_name}(**kwargs):
|
|
15
|
+
if 'self' in kwargs:
|
|
16
|
+
del kwargs['self']
|
|
17
|
+
from composio import Action, App, Tag
|
|
18
|
+
from composio_langchain import ComposioToolSet
|
|
19
|
+
|
|
20
|
+
composio_toolset = ComposioToolSet()
|
|
21
|
+
tool = {tool_instantiation_str}
|
|
22
|
+
tool.func(**kwargs)
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
# Compile safety check
|
|
26
|
+
assert_code_gen_compilable(wrapper_function_str)
|
|
27
|
+
|
|
28
|
+
return func_name, wrapper_function_str
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def generate_langchain_tool_wrapper(
|
|
32
|
+
tool: "LangChainBaseTool", additional_imports_module_attr_map: dict[str, str] = None
|
|
33
|
+
) -> tuple[str, str]:
|
|
7
34
|
tool_name = tool.__class__.__name__
|
|
8
35
|
import_statement = f"from langchain_community.tools import {tool_name}"
|
|
9
36
|
extra_module_imports = generate_import_code(additional_imports_module_attr_map)
|
|
10
37
|
|
|
11
38
|
# Safety check that user has passed in all required imports:
|
|
12
|
-
|
|
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)
|
|
39
|
+
assert_all_classes_are_imported(tool, additional_imports_module_attr_map)
|
|
21
40
|
|
|
22
41
|
tool_instantiation = f"tool = {generate_imported_tool_instantiation_call_str(tool)}"
|
|
23
42
|
run_call = f"return tool._run(**kwargs)"
|
|
@@ -34,12 +53,21 @@ def {func_name}(**kwargs):
|
|
|
34
53
|
{tool_instantiation}
|
|
35
54
|
{run_call}
|
|
36
55
|
"""
|
|
56
|
+
|
|
57
|
+
# Compile safety check
|
|
58
|
+
assert_code_gen_compilable(wrapper_function_str)
|
|
59
|
+
|
|
37
60
|
return func_name, wrapper_function_str
|
|
38
61
|
|
|
39
62
|
|
|
40
|
-
def generate_crewai_tool_wrapper(tool: "CrewAIBaseTool") -> tuple[str, str]:
|
|
63
|
+
def generate_crewai_tool_wrapper(tool: "CrewAIBaseTool", additional_imports_module_attr_map: dict[str, str] = None) -> tuple[str, str]:
|
|
41
64
|
tool_name = tool.__class__.__name__
|
|
42
65
|
import_statement = f"from crewai_tools import {tool_name}"
|
|
66
|
+
extra_module_imports = generate_import_code(additional_imports_module_attr_map)
|
|
67
|
+
|
|
68
|
+
# Safety check that user has passed in all required imports:
|
|
69
|
+
assert_all_classes_are_imported(tool, additional_imports_module_attr_map)
|
|
70
|
+
|
|
43
71
|
tool_instantiation = f"tool = {generate_imported_tool_instantiation_call_str(tool)}"
|
|
44
72
|
run_call = f"return tool._run(**kwargs)"
|
|
45
73
|
func_name = f"run_{tool_name.lower()}"
|
|
@@ -49,13 +77,42 @@ def generate_crewai_tool_wrapper(tool: "CrewAIBaseTool") -> tuple[str, str]:
|
|
|
49
77
|
def {func_name}(**kwargs):
|
|
50
78
|
if 'self' in kwargs:
|
|
51
79
|
del kwargs['self']
|
|
80
|
+
import importlib
|
|
52
81
|
{import_statement}
|
|
82
|
+
{extra_module_imports}
|
|
53
83
|
{tool_instantiation}
|
|
54
84
|
{run_call}
|
|
55
85
|
"""
|
|
86
|
+
|
|
87
|
+
# Compile safety check
|
|
88
|
+
assert_code_gen_compilable(wrapper_function_str)
|
|
89
|
+
|
|
56
90
|
return func_name, wrapper_function_str
|
|
57
91
|
|
|
58
92
|
|
|
93
|
+
def assert_code_gen_compilable(code_str):
|
|
94
|
+
try:
|
|
95
|
+
compile(code_str, "<string>", "exec")
|
|
96
|
+
except SyntaxError as e:
|
|
97
|
+
print(f"Syntax error in code: {e}")
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def assert_all_classes_are_imported(
|
|
101
|
+
tool: Union["LangChainBaseTool", "CrewAIBaseTool"], additional_imports_module_attr_map: dict[str, str]
|
|
102
|
+
) -> None:
|
|
103
|
+
# Safety check that user has passed in all required imports:
|
|
104
|
+
tool_name = tool.__class__.__name__
|
|
105
|
+
current_class_imports = {tool_name}
|
|
106
|
+
if additional_imports_module_attr_map:
|
|
107
|
+
current_class_imports.update(set(additional_imports_module_attr_map.values()))
|
|
108
|
+
required_class_imports = set(find_required_class_names_for_import(tool))
|
|
109
|
+
|
|
110
|
+
if not current_class_imports.issuperset(required_class_imports):
|
|
111
|
+
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}"
|
|
112
|
+
print(err_msg)
|
|
113
|
+
raise RuntimeError(err_msg)
|
|
114
|
+
|
|
115
|
+
|
|
59
116
|
def find_required_class_names_for_import(obj: Union["LangChainBaseTool", "CrewAIBaseTool", BaseModel]) -> list[str]:
|
|
60
117
|
"""
|
|
61
118
|
Finds all the class names for required imports when instantiating the `obj`.
|
|
@@ -113,7 +170,7 @@ def generate_imported_tool_instantiation_call_str(obj: Any) -> Optional[str]:
|
|
|
113
170
|
# e.g. {arg}={value}
|
|
114
171
|
# The reason why this is recursive, is because the value can be another BaseModel that we need to stringify
|
|
115
172
|
model_name = obj.__class__.__name__
|
|
116
|
-
fields = dict(
|
|
173
|
+
fields = obj.dict()
|
|
117
174
|
# Generate code for each field, skipping empty or None values
|
|
118
175
|
field_assignments = []
|
|
119
176
|
for arg, value in fields.items():
|
|
@@ -152,6 +209,11 @@ def generate_imported_tool_instantiation_call_str(obj: Any) -> Optional[str]:
|
|
|
152
209
|
print(
|
|
153
210
|
f"[WARNING] Skipping parsing unknown class {obj.__class__.__name__} (does not inherit from the Pydantic BaseModel and is not a basic Python type)"
|
|
154
211
|
)
|
|
212
|
+
if obj.__class__.__name__ == "function":
|
|
213
|
+
import inspect
|
|
214
|
+
|
|
215
|
+
print(inspect.getsource(obj))
|
|
216
|
+
|
|
155
217
|
return None
|
|
156
218
|
|
|
157
219
|
|
|
@@ -419,6 +419,8 @@ def openai_chat_completions_request(
|
|
|
419
419
|
try:
|
|
420
420
|
response = requests.post(url, headers=headers, json=data)
|
|
421
421
|
printd(f"response = {response}, response.text = {response.text}")
|
|
422
|
+
# print(json.dumps(data, indent=4))
|
|
423
|
+
# raise requests.exceptions.HTTPError
|
|
422
424
|
response.raise_for_status() # Raises HTTPError for 4XX/5XX status
|
|
423
425
|
|
|
424
426
|
response = response.json() # convert to dict from string
|
|
@@ -46,15 +46,7 @@ class BaseBlock(LettaBase, validate_assignment=True):
|
|
|
46
46
|
return self
|
|
47
47
|
|
|
48
48
|
def __len__(self):
|
|
49
|
-
return len(
|
|
50
|
-
|
|
51
|
-
def __str__(self) -> str:
|
|
52
|
-
if isinstance(self.value, list):
|
|
53
|
-
return ",".join(self.value)
|
|
54
|
-
elif isinstance(self.value, str):
|
|
55
|
-
return self.value
|
|
56
|
-
else:
|
|
57
|
-
return ""
|
|
49
|
+
return len(self.value)
|
|
58
50
|
|
|
59
51
|
def __setattr__(self, name, value):
|
|
60
52
|
"""Run validation if self.value is updated"""
|
|
@@ -3,6 +3,7 @@ from typing import Dict, List, Optional
|
|
|
3
3
|
from pydantic import Field
|
|
4
4
|
|
|
5
5
|
from letta.functions.helpers import (
|
|
6
|
+
generate_composio_tool_wrapper,
|
|
6
7
|
generate_crewai_tool_wrapper,
|
|
7
8
|
generate_langchain_tool_wrapper,
|
|
8
9
|
)
|
|
@@ -57,6 +58,54 @@ class Tool(BaseTool):
|
|
|
57
58
|
)
|
|
58
59
|
)
|
|
59
60
|
|
|
61
|
+
@classmethod
|
|
62
|
+
def get_composio_tool(
|
|
63
|
+
cls,
|
|
64
|
+
action: "ActionType",
|
|
65
|
+
) -> "Tool":
|
|
66
|
+
"""
|
|
67
|
+
Class method to create an instance of Letta-compatible Composio Tool.
|
|
68
|
+
Check https://docs.composio.dev/introduction/intro/overview to look at options for get_composio_tool
|
|
69
|
+
|
|
70
|
+
This function will error if we find more than one tool, or 0 tools.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
action ActionType: A action name to filter tools by.
|
|
74
|
+
Returns:
|
|
75
|
+
Tool: A Letta Tool initialized with attributes derived from the Composio tool.
|
|
76
|
+
"""
|
|
77
|
+
from composio_langchain import ComposioToolSet
|
|
78
|
+
|
|
79
|
+
composio_toolset = ComposioToolSet()
|
|
80
|
+
composio_tools = composio_toolset.get_tools(actions=[action])
|
|
81
|
+
|
|
82
|
+
assert len(composio_tools) > 0, "User supplied parameters do not match any Composio tools"
|
|
83
|
+
assert len(composio_tools) == 1, f"User supplied parameters match too many Composio tools; {len(composio_tools)} > 1"
|
|
84
|
+
|
|
85
|
+
composio_tool = composio_tools[0]
|
|
86
|
+
|
|
87
|
+
description = composio_tool.description
|
|
88
|
+
source_type = "python"
|
|
89
|
+
tags = ["composio"]
|
|
90
|
+
wrapper_func_name, wrapper_function_str = generate_composio_tool_wrapper(action)
|
|
91
|
+
json_schema = generate_schema_from_args_schema(composio_tool.args_schema, name=wrapper_func_name, description=description)
|
|
92
|
+
|
|
93
|
+
# append heartbeat (necessary for triggering another reasoning step after this tool call)
|
|
94
|
+
json_schema["parameters"]["properties"]["request_heartbeat"] = {
|
|
95
|
+
"type": "boolean",
|
|
96
|
+
"description": "Request an immediate heartbeat after function execution. Set to 'true' if you want to send a follow-up message or run a follow-up function.",
|
|
97
|
+
}
|
|
98
|
+
json_schema["parameters"]["required"].append("request_heartbeat")
|
|
99
|
+
|
|
100
|
+
return cls(
|
|
101
|
+
name=wrapper_func_name,
|
|
102
|
+
description=description,
|
|
103
|
+
source_type=source_type,
|
|
104
|
+
tags=tags,
|
|
105
|
+
source_code=wrapper_function_str,
|
|
106
|
+
json_schema=json_schema,
|
|
107
|
+
)
|
|
108
|
+
|
|
60
109
|
@classmethod
|
|
61
110
|
def from_langchain(cls, langchain_tool: "LangChainBaseTool", additional_imports_module_attr_map: dict[str, str] = None) -> "Tool":
|
|
62
111
|
"""
|
|
@@ -93,7 +142,7 @@ class Tool(BaseTool):
|
|
|
93
142
|
)
|
|
94
143
|
|
|
95
144
|
@classmethod
|
|
96
|
-
def from_crewai(cls, crewai_tool: "CrewAIBaseTool") -> "Tool":
|
|
145
|
+
def from_crewai(cls, crewai_tool: "CrewAIBaseTool", additional_imports_module_attr_map: dict[str, str] = None) -> "Tool":
|
|
97
146
|
"""
|
|
98
147
|
Class method to create an instance of Tool from a crewAI BaseTool object.
|
|
99
148
|
|
|
@@ -106,7 +155,7 @@ class Tool(BaseTool):
|
|
|
106
155
|
description = crewai_tool.description
|
|
107
156
|
source_type = "python"
|
|
108
157
|
tags = ["crew-ai"]
|
|
109
|
-
wrapper_func_name, wrapper_function_str = generate_crewai_tool_wrapper(crewai_tool)
|
|
158
|
+
wrapper_func_name, wrapper_function_str = generate_crewai_tool_wrapper(crewai_tool, additional_imports_module_attr_map)
|
|
110
159
|
json_schema = generate_schema_from_args_schema(crewai_tool.args_schema, name=wrapper_func_name, description=description)
|
|
111
160
|
|
|
112
161
|
# append heartbeat (necessary for triggering another reasoning step after this tool call)
|
|
@@ -128,7 +177,7 @@ class Tool(BaseTool):
|
|
|
128
177
|
|
|
129
178
|
class ToolCreate(BaseTool):
|
|
130
179
|
name: Optional[str] = Field(None, description="The name of the function (auto-generated from source_code if not provided).")
|
|
131
|
-
tags: List[str] = Field(
|
|
180
|
+
tags: List[str] = Field([], description="Metadata tags.")
|
|
132
181
|
source_code: str = Field(..., description="The source code of the function.")
|
|
133
182
|
json_schema: Optional[Dict] = Field(
|
|
134
183
|
None, description="The JSON schema of the function (auto-generated from source_code if not provided)"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from letta.server.rest_api.routers.v1.agents import router as agents_router
|
|
2
2
|
from letta.server.rest_api.routers.v1.blocks import router as blocks_router
|
|
3
|
+
from letta.server.rest_api.routers.v1.health import router as health_router
|
|
3
4
|
from letta.server.rest_api.routers.v1.jobs import router as jobs_router
|
|
4
5
|
from letta.server.rest_api.routers.v1.llms import router as llm_router
|
|
5
6
|
from letta.server.rest_api.routers.v1.sources import router as sources_router
|
|
@@ -12,4 +13,5 @@ ROUTERS = [
|
|
|
12
13
|
llm_router,
|
|
13
14
|
blocks_router,
|
|
14
15
|
jobs_router,
|
|
16
|
+
health_router,
|
|
15
17
|
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING
|
|
2
|
+
|
|
3
|
+
from fastapi import APIRouter
|
|
4
|
+
|
|
5
|
+
from letta.cli.cli import version
|
|
6
|
+
from letta.schemas.health import Health
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
pass
|
|
10
|
+
|
|
11
|
+
router = APIRouter(prefix="/health", tags=["health"])
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# Health check
|
|
15
|
+
@router.get("/", response_model=Health, operation_id="health_check")
|
|
16
|
+
def health_check():
|
|
17
|
+
return Health(
|
|
18
|
+
version=version(),
|
|
19
|
+
status="ok",
|
|
20
|
+
)
|