letta-nightly 0.6.1.dev20241207104149__tar.gz → 0.6.1.dev20241208104134__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.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/PKG-INFO +2 -2
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/agent.py +17 -42
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/cli/cli.py +1 -3
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/client/client.py +8 -7
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/functions/helpers.py +3 -3
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/llm_api/openai.py +0 -1
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +13 -1
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/message.py +1 -3
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/message.py +5 -5
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/tool.py +18 -11
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/app.py +2 -3
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/agents.py +5 -4
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/tools.py +26 -4
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/utils.py +3 -1
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/server.py +15 -12
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/message_manager.py +22 -10
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/sandbox_config_manager.py +16 -1
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/tool_manager.py +1 -3
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/pyproject.toml +2 -2
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/LICENSE +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/README.md +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/__main__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/agent_store/chroma.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/agent_store/db.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/agent_store/milvus.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/agent_store/qdrant.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/agent_store/storage.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/benchmark/benchmark.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/benchmark/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/chat_only_agent.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/cli/cli_config.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/cli/cli_load.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/client/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/client/streaming.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/client/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/config.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/credentials.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/data_sources/connectors.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/data_sources/connectors_helper.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/embeddings.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/errors.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/functions/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/functions/function_sets/base.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/functions/function_sets/extras.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/functions/functions.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/functions/schema_generator.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/helpers/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/helpers/tool_rule_solver.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/humans/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/humans/examples/basic.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/humans/examples/cs_phd.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/interface.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/llm_api/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/llm_api/anthropic.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/llm_api/azure_openai.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/llm_api/azure_openai_constants.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/llm_api/cohere.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/llm_api/google_ai.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/llm_api/helpers.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/llm_api/llm_api_tools.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/llm_api/mistral.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/README.md +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/chat_completion_proxy.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/function_parser.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/grammars/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/grammars/json.gbnf +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/json_parser.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/koboldcpp/api.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/koboldcpp/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llamacpp/api.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llamacpp/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/lmstudio/api.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/lmstudio/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/ollama/api.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/ollama/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/settings/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/settings/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/settings/simple.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/vllm/api.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/webui/api.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/webui/legacy_api.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/webui/legacy_settings.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/local_llm/webui/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/log.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/main.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/memory.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/metadata.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/o1_agent.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/offline_memory_agent.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/openai_backcompat/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/openai_backcompat/openai_object.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/__all__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/agents_tags.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/base.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/block.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/blocks_agents.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/enums.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/errors.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/file.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/job.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/mixins.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/organization.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/sandbox_config.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/source.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/sqlalchemy_base.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/tool.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/tools_agents.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/user.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/examples/anna_pa.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/examples/google_search_persona.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/examples/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/examples/memgpt_starter.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/examples/o1_persona.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/examples/offline_memory_persona.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/examples/sam.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/examples/sam_pov.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/personas/examples/sqldb/test.db +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/gpt_summarize.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/gpt_system.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_base.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_chat.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_convo_only.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/providers.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/pytest.ini +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/agent.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/agents_tags.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/api_key.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/block.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/blocks_agents.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/embedding_config.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/enums.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/file.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/health.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/job.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/letta_base.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/letta_message.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/letta_request.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/letta_response.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/llm_config.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/memory.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/openai/chat_completion_request.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/openai/chat_completion_response.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/openai/chat_completions.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/openai/embedding_response.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/openai/openai.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/organization.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/passage.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/sandbox_config.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/source.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/tool_rule.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/tools_agents.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/usage.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/schemas/user.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/generate_openapi_schema.sh +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/auth/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/auth/index.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/auth_token.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/interface.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/openai/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/openai/assistants/threads.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/blocks.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/health.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/jobs.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/llms.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/organizations.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/sources.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/routers/v1/users.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/rest_api/static_files.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/startup.sh +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/static_files/assets/index-43ab4d62.css +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/static_files/assets/index-4848e3d7.js +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/static_files/favicon.ico +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/static_files/index.html +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/ws_api/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/ws_api/example_client.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/ws_api/interface.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/ws_api/protocol.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/server/ws_api/server.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/agents_tags_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/block_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/blocks_agents_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/job_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/organization_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/per_agent_lock_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/source_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/tool_execution_sandbox.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/tool_sandbox_env/.gitkeep +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/tools_agents_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/services/user_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/streaming_interface.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/streaming_utils.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/system.py +0 -0
- {letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: letta-nightly
|
|
3
|
-
Version: 0.6.1.
|
|
3
|
+
Version: 0.6.1.dev20241208104134
|
|
4
4
|
Summary: Create LLM agents with long-term memory and custom tools
|
|
5
5
|
License: Apache License
|
|
6
6
|
Author: Letta Team
|
|
@@ -26,7 +26,7 @@ Requires-Dist: alembic (>=1.13.3,<2.0.0)
|
|
|
26
26
|
Requires-Dist: autoflake (>=2.3.0,<3.0.0) ; extra == "dev" or extra == "all"
|
|
27
27
|
Requires-Dist: black[jupyter] (>=24.2.0,<25.0.0) ; extra == "dev" or extra == "all"
|
|
28
28
|
Requires-Dist: chromadb (>=0.4.24,<0.5.0)
|
|
29
|
-
Requires-Dist: composio-core (>=0.5.
|
|
29
|
+
Requires-Dist: composio-core (>=0.5.51,<0.6.0)
|
|
30
30
|
Requires-Dist: composio-langchain (>=0.5.28,<0.6.0)
|
|
31
31
|
Requires-Dist: datasets (>=2.14.6,<3.0.0) ; extra == "dev" or extra == "all"
|
|
32
32
|
Requires-Dist: demjson3 (>=3.0.6,<4.0.0)
|
{letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/agent.py
RENAMED
|
@@ -36,7 +36,7 @@ from letta.schemas.block import BlockUpdate
|
|
|
36
36
|
from letta.schemas.embedding_config import EmbeddingConfig
|
|
37
37
|
from letta.schemas.enums import MessageRole
|
|
38
38
|
from letta.schemas.memory import ContextWindowOverview, Memory
|
|
39
|
-
from letta.schemas.message import Message,
|
|
39
|
+
from letta.schemas.message import Message, MessageUpdate
|
|
40
40
|
from letta.schemas.openai.chat_completion_request import (
|
|
41
41
|
Tool as ChatCompletionRequestTool,
|
|
42
42
|
)
|
|
@@ -477,10 +477,10 @@ class Agent(BaseAgent):
|
|
|
477
477
|
for tool in tools:
|
|
478
478
|
try:
|
|
479
479
|
# WARNING: name may not be consistent?
|
|
480
|
-
if tool.module: # execute the whole module
|
|
481
|
-
|
|
482
|
-
else:
|
|
483
|
-
|
|
480
|
+
# if tool.module: # execute the whole module
|
|
481
|
+
# exec(tool.module, env)
|
|
482
|
+
# else:
|
|
483
|
+
exec(tool.source_code, env)
|
|
484
484
|
self.functions_python[tool.json_schema["name"]] = env[tool.json_schema["name"]]
|
|
485
485
|
self.functions.append(tool.json_schema)
|
|
486
486
|
except Exception:
|
|
@@ -512,9 +512,10 @@ class Agent(BaseAgent):
|
|
|
512
512
|
for m in self._messages:
|
|
513
513
|
# assert is_utc_datetime(m.created_at), f"created_at on message for agent {self.agent_state.name} isn't UTC:\n{vars(m)}"
|
|
514
514
|
# TODO eventually do casting via an edit_message function
|
|
515
|
-
if
|
|
516
|
-
|
|
517
|
-
|
|
515
|
+
if m.created_at:
|
|
516
|
+
if not is_utc_datetime(m.created_at):
|
|
517
|
+
printd(f"Warning - created_at on message for agent {self.agent_state.name} isn't UTC (text='{m.text}')")
|
|
518
|
+
m.created_at = m.created_at.replace(tzinfo=datetime.timezone.utc)
|
|
518
519
|
|
|
519
520
|
def set_message_buffer(self, message_ids: List[str], force_utc: bool = True):
|
|
520
521
|
"""Set the messages in the buffer to the message IDs list"""
|
|
@@ -1405,36 +1406,10 @@ class Agent(BaseAgent):
|
|
|
1405
1406
|
f"Attached data source {source.name} to agent {self.agent_state.name}, consisting of {len(all_passages)}. Agent now has {total_agent_passages} embeddings in archival memory.",
|
|
1406
1407
|
)
|
|
1407
1408
|
|
|
1408
|
-
def update_message(self, request:
|
|
1409
|
+
def update_message(self, message_id: str, request: MessageUpdate) -> Message:
|
|
1409
1410
|
"""Update the details of a message associated with an agent"""
|
|
1410
|
-
|
|
1411
|
-
message = self.message_manager.get_message_by_id(message_id=request.id, actor=self.user)
|
|
1412
|
-
if message is None:
|
|
1413
|
-
raise ValueError(f"Message with id {request.id} not found")
|
|
1414
|
-
assert isinstance(message, Message), f"Message is not a Message object: {type(message)}"
|
|
1415
|
-
|
|
1416
|
-
# Override fields
|
|
1417
|
-
# NOTE: we try to do some sanity checking here (see asserts), but it's not foolproof
|
|
1418
|
-
if request.role:
|
|
1419
|
-
message.role = request.role
|
|
1420
|
-
if request.text:
|
|
1421
|
-
message.text = request.text
|
|
1422
|
-
if request.name:
|
|
1423
|
-
message.name = request.name
|
|
1424
|
-
if request.tool_calls:
|
|
1425
|
-
assert message.role == MessageRole.assistant, "Tool calls can only be added to assistant messages"
|
|
1426
|
-
message.tool_calls = request.tool_calls
|
|
1427
|
-
if request.tool_call_id:
|
|
1428
|
-
assert message.role == MessageRole.tool, "tool_call_id can only be added to tool messages"
|
|
1429
|
-
message.tool_call_id = request.tool_call_id
|
|
1430
|
-
|
|
1431
1411
|
# Save the updated message
|
|
1432
|
-
self.message_manager.update_message_by_id(message_id=
|
|
1433
|
-
|
|
1434
|
-
# Return the updated message
|
|
1435
|
-
updated_message = self.message_manager.get_message_by_id(message_id=message.id, actor=self.user)
|
|
1436
|
-
if updated_message is None:
|
|
1437
|
-
raise ValueError(f"Error persisting message - message with id {request.id} not found")
|
|
1412
|
+
updated_message = self.message_manager.update_message_by_id(message_id=message_id, message_update=request, actor=self.user)
|
|
1438
1413
|
return updated_message
|
|
1439
1414
|
|
|
1440
1415
|
# TODO(sarah): should we be creating a new message here, or just editing a message?
|
|
@@ -1444,10 +1419,10 @@ class Agent(BaseAgent):
|
|
|
1444
1419
|
msg_obj = self._messages[x]
|
|
1445
1420
|
if msg_obj.role == MessageRole.assistant:
|
|
1446
1421
|
updated_message = self.update_message(
|
|
1447
|
-
|
|
1448
|
-
|
|
1422
|
+
message_id=msg_obj.id,
|
|
1423
|
+
request=MessageUpdate(
|
|
1449
1424
|
text=new_thought,
|
|
1450
|
-
)
|
|
1425
|
+
),
|
|
1451
1426
|
)
|
|
1452
1427
|
self.refresh_message_buffer()
|
|
1453
1428
|
return updated_message
|
|
@@ -1486,10 +1461,10 @@ class Agent(BaseAgent):
|
|
|
1486
1461
|
|
|
1487
1462
|
# Write the update to the DB
|
|
1488
1463
|
updated_message = self.update_message(
|
|
1489
|
-
|
|
1490
|
-
|
|
1464
|
+
message_id=message_obj.id,
|
|
1465
|
+
request=MessageUpdate(
|
|
1491
1466
|
tool_calls=message_obj.tool_calls,
|
|
1492
|
-
)
|
|
1467
|
+
),
|
|
1493
1468
|
)
|
|
1494
1469
|
self.refresh_message_buffer()
|
|
1495
1470
|
return updated_message
|
{letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/cli/cli.py
RENAMED
|
@@ -51,7 +51,6 @@ def server(
|
|
|
51
51
|
port: Annotated[Optional[int], typer.Option(help="Port to run the server on")] = None,
|
|
52
52
|
host: Annotated[Optional[str], typer.Option(help="Host to run the server on (default to localhost)")] = None,
|
|
53
53
|
debug: Annotated[bool, typer.Option(help="Turn debugging output on")] = False,
|
|
54
|
-
ade: Annotated[bool, typer.Option(help="Allows remote access")] = False,
|
|
55
54
|
secure: Annotated[bool, typer.Option(help="Adds simple security access")] = False,
|
|
56
55
|
):
|
|
57
56
|
"""Launch a Letta server process"""
|
|
@@ -371,8 +370,7 @@ def delete_agent(
|
|
|
371
370
|
sys.exit(1)
|
|
372
371
|
|
|
373
372
|
|
|
374
|
-
def version():
|
|
373
|
+
def version() -> str:
|
|
375
374
|
import letta
|
|
376
375
|
|
|
377
|
-
print(letta.__version__)
|
|
378
376
|
return letta.__version__
|
|
@@ -22,7 +22,7 @@ from letta.schemas.embedding_config import EmbeddingConfig
|
|
|
22
22
|
from letta.schemas.enums import JobStatus, MessageRole
|
|
23
23
|
from letta.schemas.file import FileMetadata
|
|
24
24
|
from letta.schemas.job import Job
|
|
25
|
-
from letta.schemas.letta_request import LettaRequest
|
|
25
|
+
from letta.schemas.letta_request import LettaRequest, LettaStreamingRequest
|
|
26
26
|
from letta.schemas.letta_response import LettaResponse, LettaStreamingResponse
|
|
27
27
|
from letta.schemas.llm_config import LLMConfig
|
|
28
28
|
from letta.schemas.memory import (
|
|
@@ -32,7 +32,7 @@ from letta.schemas.memory import (
|
|
|
32
32
|
Memory,
|
|
33
33
|
RecallMemorySummary,
|
|
34
34
|
)
|
|
35
|
-
from letta.schemas.message import Message, MessageCreate,
|
|
35
|
+
from letta.schemas.message import Message, MessageCreate, MessageUpdate
|
|
36
36
|
from letta.schemas.openai.chat_completions import ToolCall
|
|
37
37
|
from letta.schemas.organization import Organization
|
|
38
38
|
from letta.schemas.passage import Passage
|
|
@@ -586,8 +586,7 @@ class RESTClient(AbstractClient):
|
|
|
586
586
|
tool_calls: Optional[List[ToolCall]] = None,
|
|
587
587
|
tool_call_id: Optional[str] = None,
|
|
588
588
|
) -> Message:
|
|
589
|
-
request =
|
|
590
|
-
id=message_id,
|
|
589
|
+
request = MessageUpdate(
|
|
591
590
|
role=role,
|
|
592
591
|
text=text,
|
|
593
592
|
name=name,
|
|
@@ -965,8 +964,10 @@ class RESTClient(AbstractClient):
|
|
|
965
964
|
if stream_tokens or stream_steps:
|
|
966
965
|
from letta.client.streaming import _sse_post
|
|
967
966
|
|
|
967
|
+
request = LettaStreamingRequest(messages=messages, stream_tokens=stream_tokens)
|
|
968
968
|
return _sse_post(f"{self.base_url}/{self.api_prefix}/agents/{agent_id}/messages/stream", request.model_dump(), self.headers)
|
|
969
969
|
else:
|
|
970
|
+
request = LettaRequest(messages=messages)
|
|
970
971
|
response = requests.post(
|
|
971
972
|
f"{self.base_url}/{self.api_prefix}/agents/{agent_id}/messages", json=request.model_dump(), headers=self.headers
|
|
972
973
|
)
|
|
@@ -2146,8 +2147,8 @@ class LocalClient(AbstractClient):
|
|
|
2146
2147
|
) -> Message:
|
|
2147
2148
|
message = self.server.update_agent_message(
|
|
2148
2149
|
agent_id=agent_id,
|
|
2149
|
-
|
|
2150
|
-
|
|
2150
|
+
message_id=message_id,
|
|
2151
|
+
request=MessageUpdate(
|
|
2151
2152
|
role=role,
|
|
2152
2153
|
text=text,
|
|
2153
2154
|
name=name,
|
|
@@ -2683,7 +2684,7 @@ class LocalClient(AbstractClient):
|
|
|
2683
2684
|
return self.server.tool_manager.create_or_update_tool(pydantic_tool=Tool(**tool_create.model_dump()), actor=self.user)
|
|
2684
2685
|
|
|
2685
2686
|
def load_composio_tool(self, action: "ActionType") -> Tool:
|
|
2686
|
-
tool_create = ToolCreate.from_composio(
|
|
2687
|
+
tool_create = ToolCreate.from_composio(action_name=action.name)
|
|
2687
2688
|
return self.server.tool_manager.create_or_update_tool(pydantic_tool=Tool(**tool_create.model_dump()), actor=self.user)
|
|
2688
2689
|
|
|
2689
2690
|
def create_tool(
|
|
@@ -4,12 +4,12 @@ import humps
|
|
|
4
4
|
from pydantic import BaseModel
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
def generate_composio_tool_wrapper(
|
|
7
|
+
def generate_composio_tool_wrapper(action_name: str) -> tuple[str, str]:
|
|
8
8
|
# Instantiate the object
|
|
9
|
-
tool_instantiation_str = f"composio_toolset.get_tools(actions=[
|
|
9
|
+
tool_instantiation_str = f"composio_toolset.get_tools(actions=['{action_name}'])[0]"
|
|
10
10
|
|
|
11
11
|
# Generate func name
|
|
12
|
-
func_name =
|
|
12
|
+
func_name = action_name.lower()
|
|
13
13
|
|
|
14
14
|
wrapper_function_str = f"""
|
|
15
15
|
def {func_name}(**kwargs):
|
|
@@ -3,6 +3,7 @@ from letta.local_llm.json_parser import clean_json
|
|
|
3
3
|
from letta.local_llm.llm_chat_completion_wrappers.wrapper_base import (
|
|
4
4
|
LLMChatCompletionWrapper,
|
|
5
5
|
)
|
|
6
|
+
from letta.schemas.enums import MessageRole
|
|
6
7
|
from letta.utils import json_dumps, json_loads
|
|
7
8
|
|
|
8
9
|
PREFIX_HINT = """# Reminders:
|
|
@@ -208,7 +209,9 @@ class ChatMLInnerMonologueWrapper(LLMChatCompletionWrapper):
|
|
|
208
209
|
|
|
209
210
|
# Last are the user/assistant messages
|
|
210
211
|
for message in messages[1:]:
|
|
211
|
-
|
|
212
|
+
# check that message["role"] is a valid option for MessageRole
|
|
213
|
+
# TODO: this shouldn't be necessary if we use pydantic in the future
|
|
214
|
+
assert message["role"] in [role.value for role in MessageRole]
|
|
212
215
|
|
|
213
216
|
if message["role"] == "user":
|
|
214
217
|
# Support for AutoGen naming of agents
|
|
@@ -231,6 +234,15 @@ class ChatMLInnerMonologueWrapper(LLMChatCompletionWrapper):
|
|
|
231
234
|
|
|
232
235
|
prompt += f"\n<|im_start|>{role_str}\n{msg_str.strip()}<|im_end|>"
|
|
233
236
|
|
|
237
|
+
elif message["role"] == "system":
|
|
238
|
+
|
|
239
|
+
role_str = "system"
|
|
240
|
+
msg_str = self._compile_system_message(
|
|
241
|
+
system_message=message["content"], functions=functions, function_documentation=function_documentation
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
prompt += f"\n<|im_start|>{role_str}\n{msg_str.strip()}<|im_end|>"
|
|
245
|
+
|
|
234
246
|
elif message["role"] in ["tool", "function"]:
|
|
235
247
|
if self.allow_function_role:
|
|
236
248
|
role_str = message["role"]
|
{letta_nightly-0.6.1.dev20241207104149 → letta_nightly-0.6.1.dev20241208104134}/letta/orm/message.py
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
1
|
from typing import Optional
|
|
3
2
|
|
|
4
|
-
from sqlalchemy import JSON,
|
|
3
|
+
from sqlalchemy import JSON, TypeDecorator
|
|
5
4
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
6
5
|
|
|
7
6
|
from letta.orm.mixins import AgentMixin, OrganizationMixin
|
|
@@ -58,7 +57,6 @@ class Message(SqlalchemyBase, OrganizationMixin, AgentMixin):
|
|
|
58
57
|
name: Mapped[Optional[str]] = mapped_column(nullable=True, doc="Name for multi-agent scenarios")
|
|
59
58
|
tool_calls: Mapped[ToolCall] = mapped_column(ToolCallColumn, doc="Tool call information")
|
|
60
59
|
tool_call_id: Mapped[Optional[str]] = mapped_column(nullable=True, doc="ID of the tool call")
|
|
61
|
-
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=datetime.utcnow)
|
|
62
60
|
|
|
63
61
|
# Relationships
|
|
64
62
|
# TODO: Add in after Agent ORM is created
|
|
@@ -13,7 +13,7 @@ from letta.constants import (
|
|
|
13
13
|
)
|
|
14
14
|
from letta.local_llm.constants import INNER_THOUGHTS_KWARG
|
|
15
15
|
from letta.schemas.enums import MessageRole
|
|
16
|
-
from letta.schemas.letta_base import
|
|
16
|
+
from letta.schemas.letta_base import OrmMetadataBase
|
|
17
17
|
from letta.schemas.letta_message import (
|
|
18
18
|
AssistantMessage,
|
|
19
19
|
FunctionCall,
|
|
@@ -50,7 +50,7 @@ def add_inner_thoughts_to_tool_call(
|
|
|
50
50
|
raise e
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
class BaseMessage(
|
|
53
|
+
class BaseMessage(OrmMetadataBase):
|
|
54
54
|
__id_prefix__ = "message"
|
|
55
55
|
|
|
56
56
|
|
|
@@ -66,10 +66,9 @@ class MessageCreate(BaseMessage):
|
|
|
66
66
|
name: Optional[str] = Field(None, description="The name of the participant.")
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
class
|
|
69
|
+
class MessageUpdate(BaseMessage):
|
|
70
70
|
"""Request to update a message"""
|
|
71
71
|
|
|
72
|
-
id: str = Field(..., description="The id of the message.")
|
|
73
72
|
role: Optional[MessageRole] = Field(None, description="The role of the participant.")
|
|
74
73
|
text: Optional[str] = Field(None, description="The text of the message.")
|
|
75
74
|
# NOTE: probably doesn't make sense to allow remapping user_id or agent_id (vs creating a new message)
|
|
@@ -109,9 +108,10 @@ class Message(BaseMessage):
|
|
|
109
108
|
agent_id: Optional[str] = Field(None, description="The unique identifier of the agent.")
|
|
110
109
|
model: Optional[str] = Field(None, description="The model used to make the function call.")
|
|
111
110
|
name: Optional[str] = Field(None, description="The name of the participant.")
|
|
112
|
-
created_at: datetime = Field(default_factory=get_utc_time, description="The time the message was created.")
|
|
113
111
|
tool_calls: Optional[List[ToolCall]] = Field(None, description="The list of tool calls requested.")
|
|
114
112
|
tool_call_id: Optional[str] = Field(None, description="The id of the tool call.")
|
|
113
|
+
# This overrides the optional base orm schema, created_at MUST exist on all messages objects
|
|
114
|
+
created_at: datetime = Field(default_factory=get_utc_time, description="The timestamp when the object was created.")
|
|
115
115
|
|
|
116
116
|
@field_validator("role")
|
|
117
117
|
@classmethod
|
|
@@ -93,7 +93,7 @@ class ToolCreate(LettaBase):
|
|
|
93
93
|
)
|
|
94
94
|
|
|
95
95
|
@classmethod
|
|
96
|
-
def from_composio(cls,
|
|
96
|
+
def from_composio(cls, action_name: str, api_key: Optional[str] = None) -> "ToolCreate":
|
|
97
97
|
"""
|
|
98
98
|
Class method to create an instance of Letta-compatible Composio Tool.
|
|
99
99
|
Check https://docs.composio.dev/introduction/intro/overview to look at options for from_composio
|
|
@@ -101,15 +101,20 @@ class ToolCreate(LettaBase):
|
|
|
101
101
|
This function will error if we find more than one tool, or 0 tools.
|
|
102
102
|
|
|
103
103
|
Args:
|
|
104
|
-
|
|
104
|
+
action_name str: A action name to filter tools by.
|
|
105
105
|
Returns:
|
|
106
106
|
Tool: A Letta Tool initialized with attributes derived from the Composio tool.
|
|
107
107
|
"""
|
|
108
108
|
from composio import LogLevel
|
|
109
109
|
from composio_langchain import ComposioToolSet
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
if api_key:
|
|
112
|
+
# Pass in an external API key
|
|
113
|
+
composio_toolset = ComposioToolSet(logging_level=LogLevel.ERROR, api_key=api_key)
|
|
114
|
+
else:
|
|
115
|
+
# Use environmental variable
|
|
116
|
+
composio_toolset = ComposioToolSet(logging_level=LogLevel.ERROR)
|
|
117
|
+
composio_tools = composio_toolset.get_tools(actions=[action_name])
|
|
113
118
|
|
|
114
119
|
assert len(composio_tools) > 0, "User supplied parameters do not match any Composio tools"
|
|
115
120
|
assert len(composio_tools) == 1, f"User supplied parameters match too many Composio tools; {len(composio_tools)} > 1"
|
|
@@ -119,7 +124,7 @@ class ToolCreate(LettaBase):
|
|
|
119
124
|
description = composio_tool.description
|
|
120
125
|
source_type = "python"
|
|
121
126
|
tags = ["composio"]
|
|
122
|
-
wrapper_func_name, wrapper_function_str = generate_composio_tool_wrapper(
|
|
127
|
+
wrapper_func_name, wrapper_function_str = generate_composio_tool_wrapper(action_name)
|
|
123
128
|
json_schema = generate_schema_from_args_schema_v2(composio_tool.args_schema, name=wrapper_func_name, description=description)
|
|
124
129
|
|
|
125
130
|
return cls(
|
|
@@ -177,14 +182,16 @@ class ToolCreate(LettaBase):
|
|
|
177
182
|
|
|
178
183
|
@classmethod
|
|
179
184
|
def load_default_composio_tools(cls) -> List["ToolCreate"]:
|
|
180
|
-
|
|
185
|
+
pass
|
|
181
186
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
187
|
+
# TODO: Disable composio tools for now
|
|
188
|
+
# TODO: Naming is causing issues
|
|
189
|
+
# calculator = ToolCreate.from_composio(action_name=Action.MATHEMATICAL_CALCULATOR.name)
|
|
190
|
+
# serp_news = ToolCreate.from_composio(action_name=Action.SERPAPI_NEWS_SEARCH.name)
|
|
191
|
+
# serp_google_search = ToolCreate.from_composio(action_name=Action.SERPAPI_SEARCH.name)
|
|
192
|
+
# serp_google_maps = ToolCreate.from_composio(action_name=Action.SERPAPI_GOOGLE_MAPS_SEARCH.name)
|
|
186
193
|
|
|
187
|
-
return [
|
|
194
|
+
return []
|
|
188
195
|
|
|
189
196
|
|
|
190
197
|
class ToolUpdate(LettaBase):
|
|
@@ -144,9 +144,8 @@ def create_application() -> "FastAPI":
|
|
|
144
144
|
debug=True,
|
|
145
145
|
)
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
print(f"▶ View using ADE at: https://app.letta.com/development-servers/local/dashboard")
|
|
147
|
+
settings.cors_origins.append("https://app.letta.com")
|
|
148
|
+
print(f"▶ View using ADE at: https://app.letta.com/development-servers/local/dashboard")
|
|
150
149
|
|
|
151
150
|
if (os.getenv("LETTA_SERVER_SECURE") == "true") or "--secure" in sys.argv:
|
|
152
151
|
print(f"▶ Using secure mode with password: {random_password}")
|
|
@@ -28,7 +28,7 @@ from letta.schemas.memory import (
|
|
|
28
28
|
Memory,
|
|
29
29
|
RecallMemorySummary,
|
|
30
30
|
)
|
|
31
|
-
from letta.schemas.message import Message, MessageCreate,
|
|
31
|
+
from letta.schemas.message import Message, MessageCreate, MessageUpdate
|
|
32
32
|
from letta.schemas.passage import Passage
|
|
33
33
|
from letta.schemas.source import Source
|
|
34
34
|
from letta.schemas.tool import Tool
|
|
@@ -422,14 +422,13 @@ def get_agent_messages(
|
|
|
422
422
|
def update_message(
|
|
423
423
|
agent_id: str,
|
|
424
424
|
message_id: str,
|
|
425
|
-
request:
|
|
425
|
+
request: MessageUpdate = Body(...),
|
|
426
426
|
server: "SyncServer" = Depends(get_letta_server),
|
|
427
427
|
):
|
|
428
428
|
"""
|
|
429
429
|
Update the details of a message associated with an agent.
|
|
430
430
|
"""
|
|
431
|
-
|
|
432
|
-
return server.update_agent_message(agent_id=agent_id, request=request)
|
|
431
|
+
return server.update_agent_message(agent_id=agent_id, message_id=message_id, request=request)
|
|
433
432
|
|
|
434
433
|
|
|
435
434
|
@router.post(
|
|
@@ -486,6 +485,8 @@ async def send_message_streaming(
|
|
|
486
485
|
This endpoint accepts a message from a user and processes it through the agent.
|
|
487
486
|
It will stream the steps of the response always, and stream the tokens if 'stream_tokens' is set to True.
|
|
488
487
|
"""
|
|
488
|
+
request.stream_tokens = False
|
|
489
|
+
|
|
489
490
|
actor = server.get_user_or_default(user_id=user_id)
|
|
490
491
|
result = await send_message_to_agent(
|
|
491
492
|
server=server,
|
|
@@ -7,6 +7,7 @@ from letta.errors import LettaToolCreateError
|
|
|
7
7
|
from letta.orm.errors import UniqueConstraintViolationError
|
|
8
8
|
from letta.schemas.letta_message import FunctionReturn
|
|
9
9
|
from letta.schemas.tool import Tool, ToolCreate, ToolRunFromSource, ToolUpdate
|
|
10
|
+
from letta.schemas.user import User
|
|
10
11
|
from letta.server.rest_api.utils import get_letta_server
|
|
11
12
|
from letta.server.server import SyncServer
|
|
12
13
|
|
|
@@ -213,22 +214,27 @@ def run_tool_from_source(
|
|
|
213
214
|
|
|
214
215
|
|
|
215
216
|
@router.get("/composio/apps", response_model=List[AppModel], operation_id="list_composio_apps")
|
|
216
|
-
def list_composio_apps(server: SyncServer = Depends(get_letta_server)):
|
|
217
|
+
def list_composio_apps(server: SyncServer = Depends(get_letta_server), user_id: Optional[str] = Header(None, alias="user_id")):
|
|
217
218
|
"""
|
|
218
219
|
Get a list of all Composio apps
|
|
219
220
|
"""
|
|
220
|
-
|
|
221
|
+
actor = server.get_user_or_default(user_id=user_id)
|
|
222
|
+
composio_api_key = get_composio_key(server, actor=actor)
|
|
223
|
+
return server.get_composio_apps(api_key=composio_api_key)
|
|
221
224
|
|
|
222
225
|
|
|
223
226
|
@router.get("/composio/apps/{composio_app_name}/actions", response_model=List[ActionModel], operation_id="list_composio_actions_by_app")
|
|
224
227
|
def list_composio_actions_by_app(
|
|
225
228
|
composio_app_name: str,
|
|
226
229
|
server: SyncServer = Depends(get_letta_server),
|
|
230
|
+
user_id: Optional[str] = Header(None, alias="user_id"),
|
|
227
231
|
):
|
|
228
232
|
"""
|
|
229
233
|
Get a list of all Composio actions for a specific app
|
|
230
234
|
"""
|
|
231
|
-
|
|
235
|
+
actor = server.get_user_or_default(user_id=user_id)
|
|
236
|
+
composio_api_key = get_composio_key(server, actor=actor)
|
|
237
|
+
return server.get_composio_actions_from_app_name(composio_app_name=composio_app_name, api_key=composio_api_key)
|
|
232
238
|
|
|
233
239
|
|
|
234
240
|
@router.post("/composio/{composio_action_name}", response_model=Tool, operation_id="add_composio_tool")
|
|
@@ -241,5 +247,21 @@ def add_composio_tool(
|
|
|
241
247
|
Add a new Composio tool by action name (Composio refers to each tool as an `Action`)
|
|
242
248
|
"""
|
|
243
249
|
actor = server.get_user_or_default(user_id=user_id)
|
|
244
|
-
|
|
250
|
+
composio_api_key = get_composio_key(server, actor=actor)
|
|
251
|
+
tool_create = ToolCreate.from_composio(action_name=composio_action_name, api_key=composio_api_key)
|
|
245
252
|
return server.tool_manager.create_or_update_tool(pydantic_tool=Tool(**tool_create.model_dump()), actor=actor)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
# TODO: Factor this out to somewhere else
|
|
256
|
+
def get_composio_key(server: SyncServer, actor: User):
|
|
257
|
+
api_keys = server.sandbox_config_manager.list_sandbox_env_vars_by_key(key="COMPOSIO_API_KEY", actor=actor)
|
|
258
|
+
if not api_keys:
|
|
259
|
+
raise HTTPException(
|
|
260
|
+
status_code=400, # Bad Request
|
|
261
|
+
detail=f"No API keys found for Composio. Please add your Composio API Key as an environment variable for your sandbox configuration.",
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
# TODO: Add more protections around this
|
|
265
|
+
# Ideally, not tied to a specific sandbox, but for now we just get the first one
|
|
266
|
+
# Theoretically possible for someone to have different composio api keys per sandbox
|
|
267
|
+
return api_keys[0].value
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import json
|
|
3
|
-
import traceback
|
|
4
3
|
import warnings
|
|
5
4
|
from enum import Enum
|
|
6
5
|
from typing import AsyncGenerator, Optional, Union
|
|
@@ -62,6 +61,9 @@ async def sse_async_generator(
|
|
|
62
61
|
raise ValueError(f"Expected LettaUsageStatistics, got {type(usage)}")
|
|
63
62
|
yield sse_formatter({"usage": usage.model_dump()})
|
|
64
63
|
except Exception as e:
|
|
64
|
+
import traceback
|
|
65
|
+
|
|
66
|
+
traceback.print_exc()
|
|
65
67
|
warnings.warn(f"Error getting usage data: {e}")
|
|
66
68
|
yield sse_formatter({"error": "Failed to get usage data"})
|
|
67
69
|
|
|
@@ -67,7 +67,7 @@ from letta.schemas.memory import (
|
|
|
67
67
|
Memory,
|
|
68
68
|
RecallMemorySummary,
|
|
69
69
|
)
|
|
70
|
-
from letta.schemas.message import Message, MessageCreate, MessageRole,
|
|
70
|
+
from letta.schemas.message import Message, MessageCreate, MessageRole, MessageUpdate
|
|
71
71
|
from letta.schemas.organization import Organization
|
|
72
72
|
from letta.schemas.passage import Passage
|
|
73
73
|
from letta.schemas.source import Source
|
|
@@ -236,11 +236,6 @@ class SyncServer(Server):
|
|
|
236
236
|
# Locks
|
|
237
237
|
self.send_message_lock = Lock()
|
|
238
238
|
|
|
239
|
-
# Composio
|
|
240
|
-
self.composio_client = None
|
|
241
|
-
if tool_settings.composio_api_key:
|
|
242
|
-
self.composio_client = Composio(api_key=tool_settings.composio_api_key)
|
|
243
|
-
|
|
244
239
|
# Initialize the metadata store
|
|
245
240
|
config = LettaConfig.load()
|
|
246
241
|
if settings.letta_pg_uri_no_default:
|
|
@@ -1667,12 +1662,12 @@ class SyncServer(Server):
|
|
|
1667
1662
|
save_agent(letta_agent, self.ms)
|
|
1668
1663
|
return message
|
|
1669
1664
|
|
|
1670
|
-
def update_agent_message(self, agent_id: str, request:
|
|
1665
|
+
def update_agent_message(self, agent_id: str, message_id: str, request: MessageUpdate) -> Message:
|
|
1671
1666
|
"""Update the details of a message associated with an agent"""
|
|
1672
1667
|
|
|
1673
1668
|
# Get the current message
|
|
1674
1669
|
letta_agent = self.load_agent(agent_id=agent_id)
|
|
1675
|
-
response = letta_agent.update_message(request=request)
|
|
1670
|
+
response = letta_agent.update_message(message_id=message_id, request=request)
|
|
1676
1671
|
save_agent(letta_agent, self.ms)
|
|
1677
1672
|
return response
|
|
1678
1673
|
|
|
@@ -1899,9 +1894,17 @@ class SyncServer(Server):
|
|
|
1899
1894
|
)
|
|
1900
1895
|
|
|
1901
1896
|
# Composio wrappers
|
|
1902
|
-
def
|
|
1897
|
+
def get_composio_client(self, api_key: Optional[str] = None):
|
|
1898
|
+
if api_key:
|
|
1899
|
+
return Composio(api_key=api_key)
|
|
1900
|
+
elif tool_settings.composio_api_key:
|
|
1901
|
+
return Composio(api_key=tool_settings.composio_api_key)
|
|
1902
|
+
else:
|
|
1903
|
+
return Composio()
|
|
1904
|
+
|
|
1905
|
+
def get_composio_apps(self, api_key: Optional[str] = None) -> List["AppModel"]:
|
|
1903
1906
|
"""Get a list of all Composio apps with actions"""
|
|
1904
|
-
apps = self.
|
|
1907
|
+
apps = self.get_composio_client(api_key=api_key).apps.get()
|
|
1905
1908
|
apps_with_actions = []
|
|
1906
1909
|
for app in apps:
|
|
1907
1910
|
# A bit of hacky logic until composio patches this
|
|
@@ -1910,6 +1913,6 @@ class SyncServer(Server):
|
|
|
1910
1913
|
|
|
1911
1914
|
return apps_with_actions
|
|
1912
1915
|
|
|
1913
|
-
def get_composio_actions_from_app_name(self, composio_app_name: str) -> List["ActionModel"]:
|
|
1914
|
-
actions = self.
|
|
1916
|
+
def get_composio_actions_from_app_name(self, composio_app_name: str, api_key: Optional[str] = None) -> List["ActionModel"]:
|
|
1917
|
+
actions = self.get_composio_client(api_key=api_key).actions.get(apps=[composio_app_name])
|
|
1915
1918
|
return actions
|
|
@@ -5,6 +5,7 @@ from letta.orm.errors import NoResultFound
|
|
|
5
5
|
from letta.orm.message import Message as MessageModel
|
|
6
6
|
from letta.schemas.enums import MessageRole
|
|
7
7
|
from letta.schemas.message import Message as PydanticMessage
|
|
8
|
+
from letta.schemas.message import MessageUpdate
|
|
8
9
|
from letta.schemas.user import User as PydanticUser
|
|
9
10
|
from letta.utils import enforce_types
|
|
10
11
|
|
|
@@ -44,27 +45,38 @@ class MessageManager:
|
|
|
44
45
|
return [self.create_message(m, actor=actor) for m in pydantic_msgs]
|
|
45
46
|
|
|
46
47
|
@enforce_types
|
|
47
|
-
def update_message_by_id(self, message_id: str,
|
|
48
|
+
def update_message_by_id(self, message_id: str, message_update: MessageUpdate, actor: PydanticUser) -> PydanticMessage:
|
|
48
49
|
"""
|
|
49
50
|
Updates an existing record in the database with values from the provided record object.
|
|
50
51
|
"""
|
|
51
52
|
with self.session_maker() as session:
|
|
52
53
|
# Fetch existing message from database
|
|
53
|
-
|
|
54
|
+
message = MessageModel.read(
|
|
54
55
|
db_session=session,
|
|
55
56
|
identifier=message_id,
|
|
56
57
|
actor=actor,
|
|
57
58
|
)
|
|
58
59
|
|
|
59
|
-
#
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
# Some safety checks specific to messages
|
|
61
|
+
if message_update.tool_calls and message.role != MessageRole.assistant:
|
|
62
|
+
raise ValueError(
|
|
63
|
+
f"Tool calls {message_update.tool_calls} can only be added to assistant messages. Message {message_id} has role {message.role}."
|
|
64
|
+
)
|
|
65
|
+
if message_update.tool_call_id and message.role != MessageRole.tool:
|
|
66
|
+
raise ValueError(
|
|
67
|
+
f"Tool call IDs {message_update.tool_call_id} can only be added to tool messages. Message {message_id} has role {message.role}."
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
# get update dictionary
|
|
71
|
+
update_data = message_update.model_dump(exclude_unset=True, exclude_none=True)
|
|
72
|
+
# Remove redundant update fields
|
|
73
|
+
update_data = {key: value for key, value in update_data.items() if getattr(message, key) != value}
|
|
74
|
+
|
|
75
|
+
for key, value in update_data.items():
|
|
76
|
+
setattr(message, key, value)
|
|
77
|
+
message.update(db_session=session, actor=actor)
|
|
65
78
|
|
|
66
|
-
|
|
67
|
-
return msg.update(db_session=session, actor=actor).to_pydantic()
|
|
79
|
+
return message.to_pydantic()
|
|
68
80
|
|
|
69
81
|
@enforce_types
|
|
70
82
|
def delete_message_by_id(self, message_id: str, actor: PydanticUser) -> bool:
|