letta-nightly 0.5.4.dev20241126104249__tar.gz → 0.5.4.dev20241127104220__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.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/PKG-INFO +1 -1
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/errors.py +12 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/functions/functions.py +4 -6
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/functions/schema_generator.py +6 -5
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/metadata.py +6 -1
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/block.py +2 -1
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/blocks_agents.py +4 -1
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/sqlalchemy_base.py +13 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/block.py +1 -1
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/agents.py +15 -13
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/tools.py +14 -3
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/server.py +10 -2
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/block_manager.py +17 -1
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/blocks_agents_manager.py +8 -1
- letta_nightly-0.5.4.dev20241127104220/letta/services/per_agent_lock_manager.py +18 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/pyproject.toml +1 -1
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/LICENSE +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/README.md +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/__main__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/agent.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/agent_store/chroma.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/agent_store/db.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/agent_store/lancedb.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/agent_store/milvus.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/agent_store/qdrant.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/agent_store/storage.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/benchmark/benchmark.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/benchmark/constants.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/cli/cli.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/cli/cli_config.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/cli/cli_load.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/client/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/client/client.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/client/streaming.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/client/utils.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/config.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/constants.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/credentials.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/data_sources/connectors.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/data_sources/connectors_helper.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/embeddings.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/functions/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/functions/function_sets/base.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/functions/function_sets/extras.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/functions/helpers.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/helpers/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/helpers/tool_rule_solver.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/humans/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/humans/examples/basic.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/humans/examples/cs_phd.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/interface.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/llm_api/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/llm_api/anthropic.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/llm_api/azure_openai.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/llm_api/azure_openai_constants.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/llm_api/cohere.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/llm_api/google_ai.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/llm_api/helpers.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/llm_api/llm_api_tools.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/llm_api/mistral.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/llm_api/openai.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/README.md +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/chat_completion_proxy.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/constants.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/function_parser.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/grammars/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/grammars/json.gbnf +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/json_parser.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/koboldcpp/api.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/koboldcpp/settings.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llamacpp/api.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llamacpp/settings.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/lmstudio/api.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/lmstudio/settings.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/ollama/api.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/ollama/settings.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/settings/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/settings/settings.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/settings/simple.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/utils.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/vllm/api.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/webui/api.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/webui/legacy_api.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/webui/legacy_settings.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/local_llm/webui/settings.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/log.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/main.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/memory.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/o1_agent.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/openai_backcompat/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/openai_backcompat/openai_object.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/__all__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/agents_tags.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/base.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/enums.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/errors.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/file.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/mixins.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/organization.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/sandbox_config.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/source.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/tool.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/user.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/persistence_manager.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/personas/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/personas/examples/anna_pa.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/personas/examples/google_search_persona.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/personas/examples/memgpt_doc.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/personas/examples/memgpt_starter.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/personas/examples/o1_persona.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/personas/examples/sam.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/personas/examples/sam_pov.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/personas/examples/sqldb/test.db +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/gpt_summarize.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/gpt_system.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/system/memgpt_base.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/system/memgpt_chat.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/system/memgpt_doc.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/providers.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/pytest.ini +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/agent.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/agents_tags.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/api_key.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/blocks_agents.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/embedding_config.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/enums.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/file.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/health.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/job.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/letta_base.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/letta_message.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/letta_request.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/letta_response.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/llm_config.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/memory.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/message.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/openai/chat_completion_request.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/openai/chat_completion_response.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/openai/chat_completions.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/openai/embedding_response.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/openai/openai.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/organization.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/passage.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/sandbox_config.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/source.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/tool.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/tool_rule.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/usage.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/schemas/user.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/constants.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/generate_openapi_schema.sh +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/app.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/auth/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/auth/index.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/auth_token.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/interface.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/openai/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/openai/assistants/threads.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/blocks.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/health.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/jobs.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/llms.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/organizations.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/sources.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/routers/v1/users.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/static_files.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/rest_api/utils.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/startup.sh +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/static_files/assets/index-3ab03d5b.css +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/static_files/assets/index-9fa459a2.js +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/static_files/favicon.ico +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/static_files/index.html +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/utils.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/ws_api/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/ws_api/example_client.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/ws_api/interface.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/ws_api/protocol.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/server/ws_api/server.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/__init__.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/agents_tags_manager.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/organization_manager.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/sandbox_config_manager.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/source_manager.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/tool_execution_sandbox.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/tool_manager.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/tool_sandbox_env/.gitkeep +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/services/user_manager.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/settings.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/streaming_interface.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/streaming_utils.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/system.py +0 -0
- {letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/utils.py +0 -0
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/errors.py
RENAMED
|
@@ -10,6 +10,18 @@ class LettaError(Exception):
|
|
|
10
10
|
"""Base class for all Letta related errors."""
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
class LettaToolCreateError(LettaError):
|
|
14
|
+
"""Error raised when a tool cannot be created."""
|
|
15
|
+
|
|
16
|
+
default_error_message = "Error creating tool."
|
|
17
|
+
|
|
18
|
+
def __init__(self, message=None):
|
|
19
|
+
if message is None:
|
|
20
|
+
message = self.default_error_message
|
|
21
|
+
self.message = message
|
|
22
|
+
super().__init__(self.message)
|
|
23
|
+
|
|
24
|
+
|
|
13
25
|
class LLMError(LettaError):
|
|
14
26
|
pass
|
|
15
27
|
|
|
@@ -3,9 +3,10 @@ import inspect
|
|
|
3
3
|
import os
|
|
4
4
|
from textwrap import dedent # remove indentation
|
|
5
5
|
from types import ModuleType
|
|
6
|
-
from typing import
|
|
6
|
+
from typing import Dict, List, Optional
|
|
7
7
|
|
|
8
8
|
from letta.constants import CLI_WARNING_PREFIX
|
|
9
|
+
from letta.errors import LettaToolCreateError
|
|
9
10
|
from letta.functions.schema_generator import generate_schema
|
|
10
11
|
|
|
11
12
|
|
|
@@ -13,10 +14,7 @@ def derive_openai_json_schema(source_code: str, name: Optional[str] = None) -> d
|
|
|
13
14
|
# auto-generate openai schema
|
|
14
15
|
try:
|
|
15
16
|
# Define a custom environment with necessary imports
|
|
16
|
-
env = {
|
|
17
|
-
"Optional": Optional, # Add any other required imports here
|
|
18
|
-
"List": List
|
|
19
|
-
}
|
|
17
|
+
env = {"Optional": Optional, "List": List, "Dict": Dict} # Add any other required imports here
|
|
20
18
|
|
|
21
19
|
env.update(globals())
|
|
22
20
|
exec(source_code, env)
|
|
@@ -29,7 +27,7 @@ def derive_openai_json_schema(source_code: str, name: Optional[str] = None) -> d
|
|
|
29
27
|
json_schema = generate_schema(func, name=name)
|
|
30
28
|
return json_schema
|
|
31
29
|
except Exception as e:
|
|
32
|
-
raise
|
|
30
|
+
raise LettaToolCreateError(f"Failed to derive JSON schema from source code: {e}")
|
|
33
31
|
|
|
34
32
|
|
|
35
33
|
def parse_source_code(func) -> str:
|
|
@@ -131,11 +131,12 @@ def generate_schema(function, name: Optional[str] = None, description: Optional[
|
|
|
131
131
|
else:
|
|
132
132
|
# Add parameter details to the schema
|
|
133
133
|
param_doc = next((d for d in docstring.params if d.arg_name == param.name), None)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
if param_doc:
|
|
135
|
+
schema["parameters"]["properties"][param.name] = {
|
|
136
|
+
# "type": "string" if param.annotation == str else str(param.annotation),
|
|
137
|
+
"type": type_to_json_schema_type(param.annotation) if param.annotation != inspect.Parameter.empty else "string",
|
|
138
|
+
"description": param_doc.description,
|
|
139
|
+
}
|
|
139
140
|
if param.default == inspect.Parameter.empty:
|
|
140
141
|
schema["parameters"]["required"].append(param.name)
|
|
141
142
|
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/metadata.py
RENAMED
|
@@ -25,6 +25,7 @@ from letta.schemas.tool_rule import (
|
|
|
25
25
|
ToolRule,
|
|
26
26
|
)
|
|
27
27
|
from letta.schemas.user import User
|
|
28
|
+
from letta.services.per_agent_lock_manager import PerAgentLockManager
|
|
28
29
|
from letta.settings import settings
|
|
29
30
|
from letta.utils import enforce_types, get_utc_time, printd
|
|
30
31
|
|
|
@@ -383,7 +384,11 @@ class MetadataStore:
|
|
|
383
384
|
session.commit()
|
|
384
385
|
|
|
385
386
|
@enforce_types
|
|
386
|
-
def delete_agent(self, agent_id: str):
|
|
387
|
+
def delete_agent(self, agent_id: str, per_agent_lock_manager: PerAgentLockManager):
|
|
388
|
+
# TODO: Remove this once Agent is on the ORM
|
|
389
|
+
# TODO: To prevent unbounded growth
|
|
390
|
+
per_agent_lock_manager.clear_lock(agent_id)
|
|
391
|
+
|
|
387
392
|
with self.session_maker() as session:
|
|
388
393
|
|
|
389
394
|
# delete agents
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/orm/block.py
RENAMED
|
@@ -10,7 +10,7 @@ from letta.schemas.block import Block as PydanticBlock
|
|
|
10
10
|
from letta.schemas.block import Human, Persona
|
|
11
11
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
13
|
-
from letta.orm
|
|
13
|
+
from letta.orm import BlocksAgents, Organization
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class Block(OrganizationMixin, SqlalchemyBase):
|
|
@@ -35,6 +35,7 @@ class Block(OrganizationMixin, SqlalchemyBase):
|
|
|
35
35
|
|
|
36
36
|
# relationships
|
|
37
37
|
organization: Mapped[Optional["Organization"]] = relationship("Organization")
|
|
38
|
+
blocks_agents: Mapped[list["BlocksAgents"]] = relationship("BlocksAgents", back_populates="block", cascade="all, delete")
|
|
38
39
|
|
|
39
40
|
def to_pydantic(self) -> Type:
|
|
40
41
|
match self.label:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from sqlalchemy import ForeignKey, ForeignKeyConstraint, String, UniqueConstraint
|
|
2
|
-
from sqlalchemy.orm import Mapped, mapped_column
|
|
2
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
3
3
|
|
|
4
4
|
from letta.orm.sqlalchemy_base import SqlalchemyBase
|
|
5
5
|
from letta.schemas.blocks_agents import BlocksAgents as PydanticBlocksAgents
|
|
@@ -27,3 +27,6 @@ class BlocksAgents(SqlalchemyBase):
|
|
|
27
27
|
agent_id: Mapped[str] = mapped_column(String, ForeignKey("agents.id"), primary_key=True)
|
|
28
28
|
block_id: Mapped[str] = mapped_column(String, primary_key=True)
|
|
29
29
|
block_label: Mapped[str] = mapped_column(String, primary_key=True)
|
|
30
|
+
|
|
31
|
+
# relationships
|
|
32
|
+
block: Mapped["Block"] = relationship("Block", back_populates="blocks_agents")
|
|
@@ -180,6 +180,19 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
|
180
180
|
"""Handle database errors and raise appropriate custom exceptions."""
|
|
181
181
|
orig = e.orig # Extract the original error from the DBAPIError
|
|
182
182
|
error_code = None
|
|
183
|
+
error_message = str(orig) if orig else str(e)
|
|
184
|
+
logger.info(f"Handling DBAPIError: {error_message}")
|
|
185
|
+
|
|
186
|
+
# Handle SQLite-specific errors
|
|
187
|
+
if "UNIQUE constraint failed" in error_message:
|
|
188
|
+
raise UniqueConstraintViolationError(
|
|
189
|
+
f"A unique constraint was violated for {cls.__name__}. Check your input for duplicates: {e}"
|
|
190
|
+
) from e
|
|
191
|
+
|
|
192
|
+
if "FOREIGN KEY constraint failed" in error_message:
|
|
193
|
+
raise ForeignKeyConstraintViolationError(
|
|
194
|
+
f"A foreign key constraint was violated for {cls.__name__}. Check your input for missing or invalid references: {e}"
|
|
195
|
+
) from e
|
|
183
196
|
|
|
184
197
|
# For psycopg2
|
|
185
198
|
if hasattr(orig, "pgcode"):
|
|
@@ -30,7 +30,7 @@ class BaseBlock(LettaBase, validate_assignment=True):
|
|
|
30
30
|
|
|
31
31
|
@model_validator(mode="after")
|
|
32
32
|
def verify_char_limit(self) -> Self:
|
|
33
|
-
if len(self.value) > self.limit:
|
|
33
|
+
if self.value and len(self.value) > self.limit:
|
|
34
34
|
error_msg = f"Edit failed: Exceeds {self.limit} character limit (requested {len(self.value)}) - {str(self)}."
|
|
35
35
|
raise ValueError(error_msg)
|
|
36
36
|
|
|
@@ -475,19 +475,21 @@ async def send_message(
|
|
|
475
475
|
"""
|
|
476
476
|
actor = server.get_user_or_default(user_id=user_id)
|
|
477
477
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
478
|
+
agent_lock = server.per_agent_lock_manager.get_lock(agent_id)
|
|
479
|
+
async with agent_lock:
|
|
480
|
+
result = await send_message_to_agent(
|
|
481
|
+
server=server,
|
|
482
|
+
agent_id=agent_id,
|
|
483
|
+
user_id=actor.id,
|
|
484
|
+
messages=request.messages,
|
|
485
|
+
stream_steps=request.stream_steps,
|
|
486
|
+
stream_tokens=request.stream_tokens,
|
|
487
|
+
return_message_object=request.return_message_object,
|
|
488
|
+
# Support for AssistantMessage
|
|
489
|
+
use_assistant_message=request.use_assistant_message,
|
|
490
|
+
assistant_message_function_name=request.assistant_message_function_name,
|
|
491
|
+
assistant_message_function_kwarg=request.assistant_message_function_kwarg,
|
|
492
|
+
)
|
|
491
493
|
return result
|
|
492
494
|
|
|
493
495
|
|
|
@@ -2,6 +2,7 @@ from typing import List, Optional
|
|
|
2
2
|
|
|
3
3
|
from fastapi import APIRouter, Body, Depends, Header, HTTPException
|
|
4
4
|
|
|
5
|
+
from letta.errors import LettaToolCreateError
|
|
5
6
|
from letta.orm.errors import UniqueConstraintViolationError
|
|
6
7
|
from letta.schemas.tool import Tool, ToolCreate, ToolUpdate
|
|
7
8
|
from letta.server.rest_api.utils import get_letta_server
|
|
@@ -14,12 +15,13 @@ router = APIRouter(prefix="/tools", tags=["tools"])
|
|
|
14
15
|
def delete_tool(
|
|
15
16
|
tool_id: str,
|
|
16
17
|
server: SyncServer = Depends(get_letta_server),
|
|
18
|
+
user_id: Optional[str] = Header(None, alias="user_id"), # Extract user_id from header, default to None if not present
|
|
17
19
|
):
|
|
18
20
|
"""
|
|
19
21
|
Delete a tool by name
|
|
20
22
|
"""
|
|
21
|
-
|
|
22
|
-
server.tool_manager.
|
|
23
|
+
actor = server.get_user_or_default(user_id=user_id)
|
|
24
|
+
server.tool_manager.delete_tool_by_id(tool_id=tool_id, actor=actor)
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
@router.get("/{tool_id}", response_model=Tool, operation_id="get_tool")
|
|
@@ -91,7 +93,16 @@ def create_tool(
|
|
|
91
93
|
except UniqueConstraintViolationError as e:
|
|
92
94
|
# Log or print the full exception here for debugging
|
|
93
95
|
print(f"Error occurred: {e}")
|
|
94
|
-
|
|
96
|
+
clean_error_message = f"Tool with name {request.name} already exists."
|
|
97
|
+
raise HTTPException(status_code=409, detail=clean_error_message)
|
|
98
|
+
except LettaToolCreateError as e:
|
|
99
|
+
# HTTP 400 == Bad Request
|
|
100
|
+
print(f"Error occurred during tool creation: {e}")
|
|
101
|
+
# print the full stack trace
|
|
102
|
+
import traceback
|
|
103
|
+
|
|
104
|
+
print(traceback.format_exc())
|
|
105
|
+
raise HTTPException(status_code=400, detail=str(e))
|
|
95
106
|
except Exception as e:
|
|
96
107
|
# Catch other unexpected errors and raise an internal server error
|
|
97
108
|
print(f"Unexpected error occurred: {e}")
|
|
@@ -3,6 +3,7 @@ import os
|
|
|
3
3
|
import traceback
|
|
4
4
|
import warnings
|
|
5
5
|
from abc import abstractmethod
|
|
6
|
+
from asyncio import Lock
|
|
6
7
|
from datetime import datetime
|
|
7
8
|
from typing import Callable, Dict, List, Optional, Tuple, Union
|
|
8
9
|
|
|
@@ -79,6 +80,7 @@ from letta.services.agents_tags_manager import AgentsTagsManager
|
|
|
79
80
|
from letta.services.block_manager import BlockManager
|
|
80
81
|
from letta.services.blocks_agents_manager import BlocksAgentsManager
|
|
81
82
|
from letta.services.organization_manager import OrganizationManager
|
|
83
|
+
from letta.services.per_agent_lock_manager import PerAgentLockManager
|
|
82
84
|
from letta.services.sandbox_config_manager import SandboxConfigManager
|
|
83
85
|
from letta.services.source_manager import SourceManager
|
|
84
86
|
from letta.services.tool_manager import ToolManager
|
|
@@ -231,6 +233,9 @@ class SyncServer(Server):
|
|
|
231
233
|
|
|
232
234
|
self.credentials = LettaCredentials.load()
|
|
233
235
|
|
|
236
|
+
# Locks
|
|
237
|
+
self.send_message_lock = Lock()
|
|
238
|
+
|
|
234
239
|
# Initialize the metadata store
|
|
235
240
|
config = LettaConfig.load()
|
|
236
241
|
if settings.letta_pg_uri_no_default:
|
|
@@ -252,6 +257,9 @@ class SyncServer(Server):
|
|
|
252
257
|
self.blocks_agents_manager = BlocksAgentsManager()
|
|
253
258
|
self.sandbox_config_manager = SandboxConfigManager(tool_settings)
|
|
254
259
|
|
|
260
|
+
# Managers that interface with parallelism
|
|
261
|
+
self.per_agent_lock_manager = PerAgentLockManager()
|
|
262
|
+
|
|
255
263
|
# Make default user and org
|
|
256
264
|
if init_with_default_org_and_user:
|
|
257
265
|
self.default_org = self.organization_manager.create_default_organization()
|
|
@@ -925,7 +933,7 @@ class SyncServer(Server):
|
|
|
925
933
|
logger.exception(e)
|
|
926
934
|
try:
|
|
927
935
|
if agent:
|
|
928
|
-
self.ms.delete_agent(agent_id=agent.agent_state.id)
|
|
936
|
+
self.ms.delete_agent(agent_id=agent.agent_state.id, per_agent_lock_manager=self.per_agent_lock_manager)
|
|
929
937
|
except Exception as delete_e:
|
|
930
938
|
logger.exception(f"Failed to delete_agent:\n{delete_e}")
|
|
931
939
|
raise e
|
|
@@ -1522,7 +1530,7 @@ class SyncServer(Server):
|
|
|
1522
1530
|
|
|
1523
1531
|
# Next, attempt to delete it from the actual database
|
|
1524
1532
|
try:
|
|
1525
|
-
self.ms.delete_agent(agent_id=agent_id)
|
|
1533
|
+
self.ms.delete_agent(agent_id=agent_id, per_agent_lock_manager=self.per_agent_lock_manager)
|
|
1526
1534
|
except Exception as e:
|
|
1527
1535
|
logger.exception(f"Failed to delete agent {agent_id} via ID with:\n{str(e)}")
|
|
1528
1536
|
raise ValueError(f"Failed to delete agent {agent_id} in database")
|
|
@@ -7,6 +7,7 @@ from letta.schemas.block import Block
|
|
|
7
7
|
from letta.schemas.block import Block as PydanticBlock
|
|
8
8
|
from letta.schemas.block import BlockUpdate, Human, Persona
|
|
9
9
|
from letta.schemas.user import User as PydanticUser
|
|
10
|
+
from letta.services.blocks_agents_manager import BlocksAgentsManager
|
|
10
11
|
from letta.utils import enforce_types, list_human_files, list_persona_files
|
|
11
12
|
|
|
12
13
|
|
|
@@ -38,13 +39,28 @@ class BlockManager:
|
|
|
38
39
|
@enforce_types
|
|
39
40
|
def update_block(self, block_id: str, block_update: BlockUpdate, actor: PydanticUser) -> PydanticBlock:
|
|
40
41
|
"""Update a block by its ID with the given BlockUpdate object."""
|
|
42
|
+
# TODO: REMOVE THIS ONCE AGENT IS ON ORM -> Update blocks_agents
|
|
43
|
+
blocks_agents_manager = BlocksAgentsManager()
|
|
44
|
+
agent_ids = []
|
|
45
|
+
if block_update.label:
|
|
46
|
+
agent_ids = blocks_agents_manager.list_agent_ids_with_block(block_id=block_id)
|
|
47
|
+
for agent_id in agent_ids:
|
|
48
|
+
blocks_agents_manager.remove_block_with_id_from_agent(agent_id=agent_id, block_id=block_id)
|
|
49
|
+
|
|
41
50
|
with self.session_maker() as session:
|
|
51
|
+
# Update block
|
|
42
52
|
block = BlockModel.read(db_session=session, identifier=block_id, actor=actor)
|
|
43
53
|
update_data = block_update.model_dump(exclude_unset=True, exclude_none=True)
|
|
44
54
|
for key, value in update_data.items():
|
|
45
55
|
setattr(block, key, value)
|
|
46
56
|
block.update(db_session=session, actor=actor)
|
|
47
|
-
|
|
57
|
+
|
|
58
|
+
# TODO: REMOVE THIS ONCE AGENT IS ON ORM -> Update blocks_agents
|
|
59
|
+
if block_update.label:
|
|
60
|
+
for agent_id in agent_ids:
|
|
61
|
+
blocks_agents_manager.add_block_to_agent(agent_id=agent_id, block_id=block_id, block_label=block_update.label)
|
|
62
|
+
|
|
63
|
+
return block.to_pydantic()
|
|
48
64
|
|
|
49
65
|
@enforce_types
|
|
50
66
|
def delete_block(self, block_id: str, actor: PydanticUser) -> PydanticBlock:
|
|
@@ -71,11 +71,18 @@ class BlocksAgentsManager:
|
|
|
71
71
|
|
|
72
72
|
@enforce_types
|
|
73
73
|
def list_block_ids_for_agent(self, agent_id: str) -> List[str]:
|
|
74
|
-
"""List all
|
|
74
|
+
"""List all block ids associated with a specific agent."""
|
|
75
75
|
with self.session_maker() as session:
|
|
76
76
|
blocks_agents_record = BlocksAgentsModel.list(db_session=session, agent_id=agent_id)
|
|
77
77
|
return [record.block_id for record in blocks_agents_record]
|
|
78
78
|
|
|
79
|
+
@enforce_types
|
|
80
|
+
def list_block_labels_for_agent(self, agent_id: str) -> List[str]:
|
|
81
|
+
"""List all block labels associated with a specific agent."""
|
|
82
|
+
with self.session_maker() as session:
|
|
83
|
+
blocks_agents_record = BlocksAgentsModel.list(db_session=session, agent_id=agent_id)
|
|
84
|
+
return [record.block_label for record in blocks_agents_record]
|
|
85
|
+
|
|
79
86
|
@enforce_types
|
|
80
87
|
def list_agent_ids_with_block(self, block_id: str) -> List[str]:
|
|
81
88
|
"""List all agents associated with a specific block."""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
from collections import defaultdict
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PerAgentLockManager:
|
|
6
|
+
"""Manages per-agent locks."""
|
|
7
|
+
|
|
8
|
+
def __init__(self):
|
|
9
|
+
self.locks = defaultdict(asyncio.Lock)
|
|
10
|
+
|
|
11
|
+
def get_lock(self, agent_id: str) -> asyncio.Lock:
|
|
12
|
+
"""Retrieve the lock for a specific agent_id."""
|
|
13
|
+
return self.locks[agent_id]
|
|
14
|
+
|
|
15
|
+
def clear_lock(self, agent_id: str):
|
|
16
|
+
"""Optionally remove a lock if no longer needed (to prevent unbounded growth)."""
|
|
17
|
+
if agent_id in self.locks:
|
|
18
|
+
del self.locks[agent_id]
|
|
File without changes
|
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/__init__.py
RENAMED
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/__main__.py
RENAMED
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/agent.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/cli/cli.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/config.py
RENAMED
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/constants.py
RENAMED
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/credentials.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/embeddings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/interface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/log.py
RENAMED
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/main.py
RENAMED
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/memory.py
RENAMED
|
File without changes
|
{letta_nightly-0.5.4.dev20241126104249 → letta_nightly-0.5.4.dev20241127104220}/letta/o1_agent.py
RENAMED
|
File without changes
|
|
File without changes
|