letta-nightly 0.6.4.dev20241216104246__tar.gz → 0.6.5.dev20241218055539__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.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/PKG-INFO +6 -6
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/README.md +5 -5
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/__init__.py +1 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/agent.py +95 -101
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/client/client.py +1 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/constants.py +6 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/embeddings.py +3 -9
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/functions/function_sets/base.py +11 -57
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/functions/schema_generator.py +2 -6
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/llm_api/anthropic.py +38 -13
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/llm_api/llm_api_tools.py +12 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/function_parser.py +2 -2
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/__init__.py +1 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/agent.py +19 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/errors.py +8 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/file.py +3 -2
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/mixins.py +3 -14
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/organization.py +19 -3
- letta_nightly-0.6.5.dev20241218055539/letta/orm/passage.py +85 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/source.py +4 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/sqlalchemy_base.py +25 -18
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_modified_chat.txt +1 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_modified_o1.txt +1 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/providers.py +2 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/agent.py +35 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/embedding_config.py +20 -2
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/passage.py +1 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/sandbox_config.py +2 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/app.py +43 -5
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/tools.py +1 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/utils.py +24 -5
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/server.py +105 -164
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/ws_api/server.py +1 -1
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/agent_manager.py +344 -9
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/passage_manager.py +76 -100
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/tool_execution_sandbox.py +54 -45
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/settings.py +10 -5
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/utils.py +8 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/pyproject.toml +1 -1
- letta_nightly-0.6.4.dev20241216104246/letta/orm/passage.py +0 -49
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/LICENSE +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/__main__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/benchmark/benchmark.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/benchmark/constants.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/chat_only_agent.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/cli/cli.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/cli/cli_config.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/cli/cli_load.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/client/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/client/streaming.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/client/utils.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/config.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/credentials.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/data_sources/connectors.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/data_sources/connectors_helper.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/errors.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/functions/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/functions/function_sets/extras.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/functions/functions.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/functions/helpers.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/helpers/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/helpers/tool_rule_solver.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/humans/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/humans/examples/basic.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/humans/examples/cs_phd.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/interface.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/llm_api/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/llm_api/azure_openai.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/llm_api/azure_openai_constants.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/llm_api/cohere.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/llm_api/google_ai.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/llm_api/helpers.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/llm_api/mistral.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/llm_api/openai.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/README.md +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/chat_completion_proxy.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/constants.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/grammars/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/grammars/json.gbnf +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/json_parser.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/koboldcpp/api.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/koboldcpp/settings.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llamacpp/api.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llamacpp/settings.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/lmstudio/api.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/lmstudio/settings.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/ollama/api.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/ollama/settings.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/settings/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/settings/settings.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/settings/simple.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/utils.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/vllm/api.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/webui/api.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/webui/legacy_api.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/webui/legacy_settings.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/local_llm/webui/settings.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/log.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/main.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/memory.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/o1_agent.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/offline_memory_agent.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/openai_backcompat/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/openai_backcompat/openai_object.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/__all__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/agents_tags.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/base.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/block.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/blocks_agents.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/custom_columns.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/enums.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/job.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/message.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/sandbox_config.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/sources_agents.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/sqlite_functions.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/tool.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/tools_agents.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/orm/user.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/examples/anna_pa.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/examples/google_search_persona.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/examples/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/examples/memgpt_starter.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/examples/o1_persona.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/examples/offline_memory_persona.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/examples/sam.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/examples/sam_pov.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/personas/examples/sqldb/test.db +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/gpt_summarize.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/gpt_system.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_base.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_chat.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_convo_only.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/pytest.ini +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/block.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/enums.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/file.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/health.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/job.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/letta_base.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/letta_message.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/letta_request.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/letta_response.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/llm_config.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/memory.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/message.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/openai/chat_completion_request.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/openai/chat_completion_response.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/openai/chat_completions.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/openai/embedding_response.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/openai/openai.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/organization.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/source.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/tool.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/tool_rule.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/usage.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/schemas/user.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/constants.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/generate_openapi_schema.sh +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/auth/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/auth/index.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/auth_token.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/interface.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/openai/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/agents.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/blocks.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/health.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/jobs.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/llms.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/organizations.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/sources.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/routers/v1/users.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/rest_api/static_files.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/startup.sh +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/static_files/assets/index-048c9598.js +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/static_files/assets/index-0e31b727.css +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/static_files/favicon.ico +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/static_files/index.html +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/utils.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/ws_api/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/ws_api/example_client.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/ws_api/interface.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/server/ws_api/protocol.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/__init__.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/block_manager.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/helpers/agent_manager_helper.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/job_manager.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/message_manager.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/organization_manager.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/per_agent_lock_manager.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/sandbox_config_manager.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/source_manager.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/tool_manager.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/tool_sandbox_env/.gitkeep +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/services/user_manager.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/streaming_interface.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/streaming_utils.py +0 -0
- {letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/system.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: letta-nightly
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.5.dev20241218055539
|
|
4
4
|
Summary: Create LLM agents with long-term memory and custom tools
|
|
5
5
|
License: Apache License
|
|
6
6
|
Author: Letta Team
|
|
@@ -167,7 +167,7 @@ Once the Letta server is running, you can access it via port `8283` (e.g. sendin
|
|
|
167
167
|
> [!NOTE]
|
|
168
168
|
> The Letta ADE is a graphical user interface for creating, deploying, interacting and observing with your Letta agents.
|
|
169
169
|
>
|
|
170
|
-
> For example, if you're running a Letta server to power an end-user application (such as a customer support chatbot), you can use the ADE to test, debug, and observe the agents in your server. You can also use the ADE as a general chat interface to
|
|
170
|
+
> For example, if you're running a Letta server to power an end-user application (such as a customer support chatbot), you can use the ADE to test, debug, and observe the agents in your server. You can also use the ADE as a general chat interface to interact with your Letta agents.
|
|
171
171
|
|
|
172
172
|
<p align="center">
|
|
173
173
|
<picture>
|
|
@@ -221,7 +221,7 @@ No, you can install Letta using `pip` (via `pip install -U letta`), as well as f
|
|
|
221
221
|
|
|
222
222
|
Letta gives your agents persistence (they live indefinitely) by storing all your agent data in a database. Letta is designed to be used with a [PostgreSQL](https://en.wikipedia.org/wiki/PostgreSQL) (the world's most popular database), however, it is not possible to install PostgreSQL via `pip`, so the `pip` install of Letta defaults to using [SQLite](https://www.sqlite.org/). If you have a PostgreSQL instance running on your own computer, you can still connect Letta (installed via `pip`) to PostgreSQL by setting the environment variable `LETTA_PG_URI`.
|
|
223
223
|
|
|
224
|
-
**Database migrations are not officially supported for Letta when using SQLite**, so you would like to ensure that
|
|
224
|
+
**Database migrations are not officially supported for Letta when using SQLite**, so if you would like to ensure that you're able to upgrade to the latest Letta version and migrate your Letta agents data, make sure that you're using PostgreSQL as your Letta database backend. Full compatability table below:
|
|
225
225
|
|
|
226
226
|
| Installation method | Start server command | Database backend | Data migrations supported? |
|
|
227
227
|
|---|---|---|---|
|
|
@@ -293,7 +293,7 @@ Hit enter to begin (will request first Letta message)
|
|
|
293
293
|
## ⚡ Quickstart (pip)
|
|
294
294
|
|
|
295
295
|
> [!WARNING]
|
|
296
|
-
> **Database migrations are not officially
|
|
296
|
+
> **Database migrations are not officially supported with `SQLite`**
|
|
297
297
|
>
|
|
298
298
|
> When you install Letta with `pip`, the default database backend is `SQLite` (you can still use an external `postgres` service with your `pip` install of Letta by setting `LETTA_PG_URI`).
|
|
299
299
|
>
|
|
@@ -303,7 +303,7 @@ Hit enter to begin (will request first Letta message)
|
|
|
303
303
|
|
|
304
304
|
<summary>View instructions for installing with pip</summary>
|
|
305
305
|
|
|
306
|
-
You can also install Letta with `pip`, will default to using `SQLite` for the database backends (whereas Docker will default to using `postgres`).
|
|
306
|
+
You can also install Letta with `pip`, which will default to using `SQLite` for the database backends (whereas Docker will default to using `postgres`).
|
|
307
307
|
|
|
308
308
|
### Step 1 - Install Letta using `pip`
|
|
309
309
|
```sh
|
|
@@ -377,7 +377,7 @@ Letta is an open source project built by over a hundred contributors. There are
|
|
|
377
377
|
|
|
378
378
|
* **Contribute to the project**: Interested in contributing? Start by reading our [Contribution Guidelines](https://github.com/cpacker/MemGPT/tree/main/CONTRIBUTING.md).
|
|
379
379
|
* **Ask a question**: Join our community on [Discord](https://discord.gg/letta) and direct your questions to the `#support` channel.
|
|
380
|
-
* **Report
|
|
380
|
+
* **Report issues or suggest features**: Have an issue or a feature request? Please submit them through our [GitHub Issues page](https://github.com/cpacker/MemGPT/issues).
|
|
381
381
|
* **Explore the roadmap**: Curious about future developments? View and comment on our [project roadmap](https://github.com/cpacker/MemGPT/issues/1533).
|
|
382
382
|
* **Join community events**: Stay updated with the [event calendar](https://lu.ma/berkeley-llm-meetup) or follow our [Twitter account](https://twitter.com/Letta_AI).
|
|
383
383
|
|
|
@@ -85,7 +85,7 @@ Once the Letta server is running, you can access it via port `8283` (e.g. sendin
|
|
|
85
85
|
> [!NOTE]
|
|
86
86
|
> The Letta ADE is a graphical user interface for creating, deploying, interacting and observing with your Letta agents.
|
|
87
87
|
>
|
|
88
|
-
> For example, if you're running a Letta server to power an end-user application (such as a customer support chatbot), you can use the ADE to test, debug, and observe the agents in your server. You can also use the ADE as a general chat interface to
|
|
88
|
+
> For example, if you're running a Letta server to power an end-user application (such as a customer support chatbot), you can use the ADE to test, debug, and observe the agents in your server. You can also use the ADE as a general chat interface to interact with your Letta agents.
|
|
89
89
|
|
|
90
90
|
<p align="center">
|
|
91
91
|
<picture>
|
|
@@ -139,7 +139,7 @@ No, you can install Letta using `pip` (via `pip install -U letta`), as well as f
|
|
|
139
139
|
|
|
140
140
|
Letta gives your agents persistence (they live indefinitely) by storing all your agent data in a database. Letta is designed to be used with a [PostgreSQL](https://en.wikipedia.org/wiki/PostgreSQL) (the world's most popular database), however, it is not possible to install PostgreSQL via `pip`, so the `pip` install of Letta defaults to using [SQLite](https://www.sqlite.org/). If you have a PostgreSQL instance running on your own computer, you can still connect Letta (installed via `pip`) to PostgreSQL by setting the environment variable `LETTA_PG_URI`.
|
|
141
141
|
|
|
142
|
-
**Database migrations are not officially supported for Letta when using SQLite**, so you would like to ensure that
|
|
142
|
+
**Database migrations are not officially supported for Letta when using SQLite**, so if you would like to ensure that you're able to upgrade to the latest Letta version and migrate your Letta agents data, make sure that you're using PostgreSQL as your Letta database backend. Full compatability table below:
|
|
143
143
|
|
|
144
144
|
| Installation method | Start server command | Database backend | Data migrations supported? |
|
|
145
145
|
|---|---|---|---|
|
|
@@ -211,7 +211,7 @@ Hit enter to begin (will request first Letta message)
|
|
|
211
211
|
## ⚡ Quickstart (pip)
|
|
212
212
|
|
|
213
213
|
> [!WARNING]
|
|
214
|
-
> **Database migrations are not officially
|
|
214
|
+
> **Database migrations are not officially supported with `SQLite`**
|
|
215
215
|
>
|
|
216
216
|
> When you install Letta with `pip`, the default database backend is `SQLite` (you can still use an external `postgres` service with your `pip` install of Letta by setting `LETTA_PG_URI`).
|
|
217
217
|
>
|
|
@@ -221,7 +221,7 @@ Hit enter to begin (will request first Letta message)
|
|
|
221
221
|
|
|
222
222
|
<summary>View instructions for installing with pip</summary>
|
|
223
223
|
|
|
224
|
-
You can also install Letta with `pip`, will default to using `SQLite` for the database backends (whereas Docker will default to using `postgres`).
|
|
224
|
+
You can also install Letta with `pip`, which will default to using `SQLite` for the database backends (whereas Docker will default to using `postgres`).
|
|
225
225
|
|
|
226
226
|
### Step 1 - Install Letta using `pip`
|
|
227
227
|
```sh
|
|
@@ -295,7 +295,7 @@ Letta is an open source project built by over a hundred contributors. There are
|
|
|
295
295
|
|
|
296
296
|
* **Contribute to the project**: Interested in contributing? Start by reading our [Contribution Guidelines](https://github.com/cpacker/MemGPT/tree/main/CONTRIBUTING.md).
|
|
297
297
|
* **Ask a question**: Join our community on [Discord](https://discord.gg/letta) and direct your questions to the `#support` channel.
|
|
298
|
-
* **Report
|
|
298
|
+
* **Report issues or suggest features**: Have an issue or a feature request? Please submit them through our [GitHub Issues page](https://github.com/cpacker/MemGPT/issues).
|
|
299
299
|
* **Explore the roadmap**: Curious about future developments? View and comment on our [project roadmap](https://github.com/cpacker/MemGPT/issues/1533).
|
|
300
300
|
* **Join community events**: Stay updated with the [event calendar](https://lu.ma/berkeley-llm-meetup) or follow our [Twitter account](https://twitter.com/Letta_AI).
|
|
301
301
|
|
{letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/agent.py
RENAMED
|
@@ -18,6 +18,7 @@ from letta.constants import (
|
|
|
18
18
|
MESSAGE_SUMMARY_WARNING_FRAC,
|
|
19
19
|
O1_BASE_TOOLS,
|
|
20
20
|
REQ_HEARTBEAT_MESSAGE,
|
|
21
|
+
STRUCTURED_OUTPUT_MODELS,
|
|
21
22
|
)
|
|
22
23
|
from letta.errors import LLMError
|
|
23
24
|
from letta.helpers import ToolRulesSolver
|
|
@@ -41,7 +42,6 @@ from letta.schemas.openai.chat_completion_response import (
|
|
|
41
42
|
Message as ChatCompletionMessage,
|
|
42
43
|
)
|
|
43
44
|
from letta.schemas.openai.chat_completion_response import UsageStatistics
|
|
44
|
-
from letta.schemas.passage import Passage
|
|
45
45
|
from letta.schemas.tool import Tool
|
|
46
46
|
from letta.schemas.tool_rule import TerminalToolRule
|
|
47
47
|
from letta.schemas.usage import LettaUsageStatistics
|
|
@@ -64,6 +64,7 @@ from letta.system import (
|
|
|
64
64
|
)
|
|
65
65
|
from letta.utils import (
|
|
66
66
|
count_tokens,
|
|
67
|
+
get_friendly_error_msg,
|
|
67
68
|
get_local_time,
|
|
68
69
|
get_tool_call_id,
|
|
69
70
|
get_utc_time,
|
|
@@ -82,7 +83,7 @@ def compile_memory_metadata_block(
|
|
|
82
83
|
actor: PydanticUser,
|
|
83
84
|
agent_id: str,
|
|
84
85
|
memory_edit_timestamp: datetime.datetime,
|
|
85
|
-
|
|
86
|
+
agent_manager: Optional[AgentManager] = None,
|
|
86
87
|
message_manager: Optional[MessageManager] = None,
|
|
87
88
|
) -> str:
|
|
88
89
|
# Put the timestamp in the local timezone (mimicking get_local_time())
|
|
@@ -93,7 +94,7 @@ def compile_memory_metadata_block(
|
|
|
93
94
|
[
|
|
94
95
|
f"### Memory [last modified: {timestamp_str}]",
|
|
95
96
|
f"{message_manager.size(actor=actor, agent_id=agent_id) if message_manager else 0} previous messages between you and the user are stored in recall memory (use functions to access them)",
|
|
96
|
-
f"{
|
|
97
|
+
f"{agent_manager.passage_size(actor=actor, agent_id=agent_id) if agent_manager else 0} total memories you created are stored in archival memory (use functions to access them)",
|
|
97
98
|
"\nCore memory shown below (limited in size, additional information stored in archival / recall memory):",
|
|
98
99
|
]
|
|
99
100
|
)
|
|
@@ -106,7 +107,7 @@ def compile_system_message(
|
|
|
106
107
|
in_context_memory: Memory,
|
|
107
108
|
in_context_memory_last_edit: datetime.datetime, # TODO move this inside of BaseMemory?
|
|
108
109
|
actor: PydanticUser,
|
|
109
|
-
|
|
110
|
+
agent_manager: Optional[AgentManager] = None,
|
|
110
111
|
message_manager: Optional[MessageManager] = None,
|
|
111
112
|
user_defined_variables: Optional[dict] = None,
|
|
112
113
|
append_icm_if_missing: bool = True,
|
|
@@ -135,7 +136,7 @@ def compile_system_message(
|
|
|
135
136
|
actor=actor,
|
|
136
137
|
agent_id=agent_id,
|
|
137
138
|
memory_edit_timestamp=in_context_memory_last_edit,
|
|
138
|
-
|
|
139
|
+
agent_manager=agent_manager,
|
|
139
140
|
message_manager=message_manager,
|
|
140
141
|
)
|
|
141
142
|
full_memory_string = memory_metadata_string + "\n" + in_context_memory.compile()
|
|
@@ -172,7 +173,7 @@ def initialize_message_sequence(
|
|
|
172
173
|
agent_id: str,
|
|
173
174
|
memory: Memory,
|
|
174
175
|
actor: PydanticUser,
|
|
175
|
-
|
|
176
|
+
agent_manager: Optional[AgentManager] = None,
|
|
176
177
|
message_manager: Optional[MessageManager] = None,
|
|
177
178
|
memory_edit_timestamp: Optional[datetime.datetime] = None,
|
|
178
179
|
include_initial_boot_message: bool = True,
|
|
@@ -181,7 +182,7 @@ def initialize_message_sequence(
|
|
|
181
182
|
memory_edit_timestamp = get_local_time()
|
|
182
183
|
|
|
183
184
|
# full_system_message = construct_system_with_memory(
|
|
184
|
-
# system, memory, memory_edit_timestamp,
|
|
185
|
+
# system, memory, memory_edit_timestamp, agent_manager=agent_manager, recall_memory=recall_memory
|
|
185
186
|
# )
|
|
186
187
|
full_system_message = compile_system_message(
|
|
187
188
|
agent_id=agent_id,
|
|
@@ -189,7 +190,7 @@ def initialize_message_sequence(
|
|
|
189
190
|
in_context_memory=memory,
|
|
190
191
|
in_context_memory_last_edit=memory_edit_timestamp,
|
|
191
192
|
actor=actor,
|
|
192
|
-
|
|
193
|
+
agent_manager=agent_manager,
|
|
193
194
|
message_manager=message_manager,
|
|
194
195
|
user_defined_variables=None,
|
|
195
196
|
append_icm_if_missing=True,
|
|
@@ -259,9 +260,6 @@ class Agent(BaseAgent):
|
|
|
259
260
|
|
|
260
261
|
self.user = user
|
|
261
262
|
|
|
262
|
-
# link tools
|
|
263
|
-
self.link_tools(agent_state.tools)
|
|
264
|
-
|
|
265
263
|
# initialize a tool rules solver
|
|
266
264
|
if agent_state.tool_rules:
|
|
267
265
|
# if there are tool rules, print out a warning
|
|
@@ -277,6 +275,7 @@ class Agent(BaseAgent):
|
|
|
277
275
|
|
|
278
276
|
# gpt-4, gpt-3.5-turbo, ...
|
|
279
277
|
self.model = self.agent_state.llm_config.model
|
|
278
|
+
self.check_tool_rules()
|
|
280
279
|
|
|
281
280
|
# state managers
|
|
282
281
|
self.block_manager = BlockManager()
|
|
@@ -291,12 +290,11 @@ class Agent(BaseAgent):
|
|
|
291
290
|
self.interface = interface
|
|
292
291
|
|
|
293
292
|
# Create the persistence manager object based on the AgentState info
|
|
294
|
-
self.passage_manager = PassageManager()
|
|
295
293
|
self.message_manager = MessageManager()
|
|
294
|
+
self.passage_manager = PassageManager()
|
|
295
|
+
self.agent_manager = AgentManager()
|
|
296
296
|
|
|
297
297
|
# State needed for heartbeat pausing
|
|
298
|
-
self.pause_heartbeats_start = None
|
|
299
|
-
self.pause_heartbeats_minutes = 0
|
|
300
298
|
|
|
301
299
|
self.first_message_verify_mono = first_message_verify_mono
|
|
302
300
|
|
|
@@ -322,7 +320,7 @@ class Agent(BaseAgent):
|
|
|
322
320
|
agent_id=self.agent_state.id,
|
|
323
321
|
memory=self.agent_state.memory,
|
|
324
322
|
actor=self.user,
|
|
325
|
-
|
|
323
|
+
agent_manager=None,
|
|
326
324
|
message_manager=None,
|
|
327
325
|
memory_edit_timestamp=get_utc_time(),
|
|
328
326
|
include_initial_boot_message=True,
|
|
@@ -347,7 +345,7 @@ class Agent(BaseAgent):
|
|
|
347
345
|
memory=self.agent_state.memory,
|
|
348
346
|
agent_id=self.agent_state.id,
|
|
349
347
|
actor=self.user,
|
|
350
|
-
|
|
348
|
+
agent_manager=None,
|
|
351
349
|
message_manager=None,
|
|
352
350
|
memory_edit_timestamp=get_utc_time(),
|
|
353
351
|
include_initial_boot_message=True,
|
|
@@ -381,6 +379,16 @@ class Agent(BaseAgent):
|
|
|
381
379
|
# Create the agent in the DB
|
|
382
380
|
self.update_state()
|
|
383
381
|
|
|
382
|
+
def check_tool_rules(self):
|
|
383
|
+
if self.model not in STRUCTURED_OUTPUT_MODELS:
|
|
384
|
+
if len(self.tool_rules_solver.init_tool_rules) > 1:
|
|
385
|
+
raise ValueError(
|
|
386
|
+
"Multiple initial tools are not supported for non-structured models. Please use only one initial tool rule."
|
|
387
|
+
)
|
|
388
|
+
self.supports_structured_output = False
|
|
389
|
+
else:
|
|
390
|
+
self.supports_structured_output = True
|
|
391
|
+
|
|
384
392
|
def update_memory_if_change(self, new_memory: Memory) -> bool:
|
|
385
393
|
"""
|
|
386
394
|
Update internal memory object and system prompt if there have been modifications.
|
|
@@ -415,11 +423,21 @@ class Agent(BaseAgent):
|
|
|
415
423
|
return True
|
|
416
424
|
return False
|
|
417
425
|
|
|
418
|
-
def execute_tool_and_persist_state(self, function_name,
|
|
426
|
+
def execute_tool_and_persist_state(self, function_name: str, function_args: dict, target_letta_tool: Tool):
|
|
419
427
|
"""
|
|
420
428
|
Execute tool modifications and persist the state of the agent.
|
|
421
429
|
Note: only some agent state modifications will be persisted, such as data in the AgentState ORM and block data
|
|
422
430
|
"""
|
|
431
|
+
# TODO: Get rid of this. This whole piece is pretty shady, that we exec the function to just get the type hints for args.
|
|
432
|
+
env = {}
|
|
433
|
+
env.update(globals())
|
|
434
|
+
exec(target_letta_tool.source_code, env)
|
|
435
|
+
callable_func = env[target_letta_tool.json_schema["name"]]
|
|
436
|
+
spec = inspect.getfullargspec(callable_func).annotations
|
|
437
|
+
for name, arg in function_args.items():
|
|
438
|
+
if isinstance(function_args[name], dict):
|
|
439
|
+
function_args[name] = spec[name](**function_args[name])
|
|
440
|
+
|
|
423
441
|
# TODO: add agent manager here
|
|
424
442
|
orig_memory_str = self.agent_state.memory.compile()
|
|
425
443
|
|
|
@@ -432,11 +450,11 @@ class Agent(BaseAgent):
|
|
|
432
450
|
if function_name in BASE_TOOLS or function_name in O1_BASE_TOOLS:
|
|
433
451
|
# base tools are allowed to access the `Agent` object and run on the database
|
|
434
452
|
function_args["self"] = self # need to attach self to arg since it's dynamically linked
|
|
435
|
-
function_response =
|
|
453
|
+
function_response = callable_func(**function_args)
|
|
436
454
|
else:
|
|
437
455
|
# execute tool in a sandbox
|
|
438
456
|
# TODO: allow agent_state to specify which sandbox to execute tools in
|
|
439
|
-
sandbox_run_result = ToolExecutionSandbox(function_name, function_args, self.
|
|
457
|
+
sandbox_run_result = ToolExecutionSandbox(function_name, function_args, self.user).run(
|
|
440
458
|
agent_state=self.agent_state.__deepcopy__()
|
|
441
459
|
)
|
|
442
460
|
function_response, updated_agent_state = sandbox_run_result.func_return, sandbox_run_result.agent_state
|
|
@@ -446,12 +464,9 @@ class Agent(BaseAgent):
|
|
|
446
464
|
except Exception as e:
|
|
447
465
|
# Need to catch error here, or else trunction wont happen
|
|
448
466
|
# TODO: modify to function execution error
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
if len(error_msg) > MAX_ERROR_MESSAGE_CHAR_LIMIT:
|
|
453
|
-
error_msg = error_msg[:MAX_ERROR_MESSAGE_CHAR_LIMIT]
|
|
454
|
-
raise ValueError(error_msg)
|
|
467
|
+
function_response = get_friendly_error_msg(
|
|
468
|
+
function_name=function_name, exception_name=type(e).__name__, exception_message=str(e)
|
|
469
|
+
)
|
|
455
470
|
|
|
456
471
|
return function_response
|
|
457
472
|
|
|
@@ -464,27 +479,6 @@ class Agent(BaseAgent):
|
|
|
464
479
|
def messages(self, value):
|
|
465
480
|
raise Exception("Modifying message list directly not allowed")
|
|
466
481
|
|
|
467
|
-
def link_tools(self, tools: List[Tool]):
|
|
468
|
-
"""Bind a tool object (schema + python function) to the agent object"""
|
|
469
|
-
|
|
470
|
-
# Store the functions schemas (this is passed as an argument to ChatCompletion)
|
|
471
|
-
self.functions = []
|
|
472
|
-
self.functions_python = {}
|
|
473
|
-
env = {}
|
|
474
|
-
env.update(globals())
|
|
475
|
-
for tool in tools:
|
|
476
|
-
try:
|
|
477
|
-
# WARNING: name may not be consistent?
|
|
478
|
-
# if tool.module: # execute the whole module
|
|
479
|
-
# exec(tool.module, env)
|
|
480
|
-
# else:
|
|
481
|
-
exec(tool.source_code, env)
|
|
482
|
-
self.functions_python[tool.json_schema["name"]] = env[tool.json_schema["name"]]
|
|
483
|
-
self.functions.append(tool.json_schema)
|
|
484
|
-
except Exception:
|
|
485
|
-
warnings.warn(f"WARNING: tool {tool.name} failed to link")
|
|
486
|
-
assert all([callable(f) for k, f in self.functions_python.items()]), self.functions_python
|
|
487
|
-
|
|
488
482
|
def _load_messages_from_recall(self, message_ids: List[str]) -> List[Message]:
|
|
489
483
|
"""Load a list of messages from recall storage"""
|
|
490
484
|
|
|
@@ -588,14 +582,32 @@ class Agent(BaseAgent):
|
|
|
588
582
|
empty_response_retry_limit: int = 3,
|
|
589
583
|
backoff_factor: float = 0.5, # delay multiplier for exponential backoff
|
|
590
584
|
max_delay: float = 10.0, # max delay between retries
|
|
585
|
+
step_count: Optional[int] = None,
|
|
591
586
|
) -> ChatCompletionResponse:
|
|
592
587
|
"""Get response from LLM API with robust retry mechanism."""
|
|
593
588
|
|
|
594
589
|
allowed_tool_names = self.tool_rules_solver.get_allowed_tool_names()
|
|
590
|
+
agent_state_tool_jsons = [t.json_schema for t in self.agent_state.tools]
|
|
591
|
+
|
|
595
592
|
allowed_functions = (
|
|
596
|
-
|
|
593
|
+
agent_state_tool_jsons
|
|
594
|
+
if not allowed_tool_names
|
|
595
|
+
else [func for func in agent_state_tool_jsons if func["name"] in allowed_tool_names]
|
|
597
596
|
)
|
|
598
597
|
|
|
598
|
+
# For the first message, force the initial tool if one is specified
|
|
599
|
+
force_tool_call = None
|
|
600
|
+
if (
|
|
601
|
+
step_count is not None
|
|
602
|
+
and step_count == 0
|
|
603
|
+
and not self.supports_structured_output
|
|
604
|
+
and len(self.tool_rules_solver.init_tool_rules) > 0
|
|
605
|
+
):
|
|
606
|
+
force_tool_call = self.tool_rules_solver.init_tool_rules[0].tool_name
|
|
607
|
+
# Force a tool call if exactly one tool is specified
|
|
608
|
+
elif step_count is not None and step_count > 0 and len(allowed_tool_names) == 1:
|
|
609
|
+
force_tool_call = allowed_tool_names[0]
|
|
610
|
+
|
|
599
611
|
for attempt in range(1, empty_response_retry_limit + 1):
|
|
600
612
|
try:
|
|
601
613
|
response = create(
|
|
@@ -603,9 +615,10 @@ class Agent(BaseAgent):
|
|
|
603
615
|
messages=message_sequence,
|
|
604
616
|
user_id=self.agent_state.created_by_id,
|
|
605
617
|
functions=allowed_functions,
|
|
606
|
-
functions_python=self.functions_python,
|
|
618
|
+
# functions_python=self.functions_python, do we need this?
|
|
607
619
|
function_call=function_call,
|
|
608
620
|
first_message=first_message,
|
|
621
|
+
force_tool_call=force_tool_call,
|
|
609
622
|
stream=stream,
|
|
610
623
|
stream_interface=self.interface,
|
|
611
624
|
)
|
|
@@ -711,10 +724,13 @@ class Agent(BaseAgent):
|
|
|
711
724
|
function_name = function_call.name
|
|
712
725
|
printd(f"Request to call function {function_name} with tool_call_id: {tool_call_id}")
|
|
713
726
|
|
|
714
|
-
# Failure case 1: function name is wrong
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
727
|
+
# Failure case 1: function name is wrong (not in agent_state.tools)
|
|
728
|
+
target_letta_tool = None
|
|
729
|
+
for t in self.agent_state.tools:
|
|
730
|
+
if t.name == function_name:
|
|
731
|
+
target_letta_tool = t
|
|
732
|
+
|
|
733
|
+
if not target_letta_tool:
|
|
718
734
|
error_msg = f"No function named {function_name}"
|
|
719
735
|
function_response = package_function_response(False, error_msg)
|
|
720
736
|
messages.append(
|
|
@@ -782,14 +798,8 @@ class Agent(BaseAgent):
|
|
|
782
798
|
# this is because the function/tool role message is only created once the function/tool has executed/returned
|
|
783
799
|
self.interface.function_message(f"Running {function_name}({function_args})", msg_obj=messages[-1])
|
|
784
800
|
try:
|
|
785
|
-
spec = inspect.getfullargspec(function_to_call).annotations
|
|
786
|
-
|
|
787
|
-
for name, arg in function_args.items():
|
|
788
|
-
if isinstance(function_args[name], dict):
|
|
789
|
-
function_args[name] = spec[name](**function_args[name])
|
|
790
|
-
|
|
791
801
|
# handle tool execution (sandbox) and state updates
|
|
792
|
-
function_response = self.execute_tool_and_persist_state(function_name,
|
|
802
|
+
function_response = self.execute_tool_and_persist_state(function_name, function_args, target_letta_tool)
|
|
793
803
|
|
|
794
804
|
# handle trunction
|
|
795
805
|
if function_name in ["conversation_search", "conversation_search_date", "archival_memory_search"]:
|
|
@@ -801,8 +811,7 @@ class Agent(BaseAgent):
|
|
|
801
811
|
truncate = True
|
|
802
812
|
|
|
803
813
|
# get the function response limit
|
|
804
|
-
|
|
805
|
-
return_char_limit = tool_obj.return_char_limit
|
|
814
|
+
return_char_limit = target_letta_tool.return_char_limit
|
|
806
815
|
function_response_string = validate_function_response(
|
|
807
816
|
function_response, return_char_limit=return_char_limit, truncate=truncate
|
|
808
817
|
)
|
|
@@ -897,6 +906,7 @@ class Agent(BaseAgent):
|
|
|
897
906
|
step_count = 0
|
|
898
907
|
while True:
|
|
899
908
|
kwargs["first_message"] = False
|
|
909
|
+
kwargs["step_count"] = step_count
|
|
900
910
|
step_response = self.inner_step(
|
|
901
911
|
messages=next_input_message,
|
|
902
912
|
**kwargs,
|
|
@@ -972,6 +982,7 @@ class Agent(BaseAgent):
|
|
|
972
982
|
first_message_retry_limit: int = FIRST_MESSAGE_ATTEMPTS,
|
|
973
983
|
skip_verify: bool = False,
|
|
974
984
|
stream: bool = False, # TODO move to config?
|
|
985
|
+
step_count: Optional[int] = None,
|
|
975
986
|
) -> AgentStepResponse:
|
|
976
987
|
"""Runs a single step in the agent loop (generates at most one LLM call)"""
|
|
977
988
|
|
|
@@ -1014,7 +1025,9 @@ class Agent(BaseAgent):
|
|
|
1014
1025
|
else:
|
|
1015
1026
|
response = self._get_ai_reply(
|
|
1016
1027
|
message_sequence=input_message_sequence,
|
|
1028
|
+
first_message=first_message,
|
|
1017
1029
|
stream=stream,
|
|
1030
|
+
step_count=step_count,
|
|
1018
1031
|
)
|
|
1019
1032
|
|
|
1020
1033
|
# Step 3: check if LLM wanted to call a function
|
|
@@ -1235,17 +1248,6 @@ class Agent(BaseAgent):
|
|
|
1235
1248
|
|
|
1236
1249
|
printd(f"Ran summarizer, messages length {prior_len} -> {len(self.messages)}")
|
|
1237
1250
|
|
|
1238
|
-
def heartbeat_is_paused(self):
|
|
1239
|
-
"""Check if there's a requested pause on timed heartbeats"""
|
|
1240
|
-
|
|
1241
|
-
# Check if the pause has been initiated
|
|
1242
|
-
if self.pause_heartbeats_start is None:
|
|
1243
|
-
return False
|
|
1244
|
-
|
|
1245
|
-
# Check if it's been more than pause_heartbeats_minutes since pause_heartbeats_start
|
|
1246
|
-
elapsed_time = get_utc_time() - self.pause_heartbeats_start
|
|
1247
|
-
return elapsed_time.total_seconds() < self.pause_heartbeats_minutes * 60
|
|
1248
|
-
|
|
1249
1251
|
def _swap_system_message_in_buffer(self, new_system_message: str):
|
|
1250
1252
|
"""Update the system message (NOT prompt) of the Agent (requires updating the internal buffer)"""
|
|
1251
1253
|
assert isinstance(new_system_message, str)
|
|
@@ -1290,14 +1292,14 @@ class Agent(BaseAgent):
|
|
|
1290
1292
|
# NOTE: a bit of a hack - we pull the timestamp from the message created_by
|
|
1291
1293
|
memory_edit_timestamp = self._messages[0].created_at
|
|
1292
1294
|
|
|
1293
|
-
# update memory (TODO: potentially update recall/archival stats
|
|
1295
|
+
# update memory (TODO: potentially update recall/archival stats separately)
|
|
1294
1296
|
new_system_message_str = compile_system_message(
|
|
1295
1297
|
agent_id=self.agent_state.id,
|
|
1296
1298
|
system_prompt=self.agent_state.system,
|
|
1297
1299
|
in_context_memory=self.agent_state.memory,
|
|
1298
1300
|
in_context_memory_last_edit=memory_edit_timestamp,
|
|
1299
1301
|
actor=self.user,
|
|
1300
|
-
|
|
1302
|
+
agent_manager=self.agent_manager,
|
|
1301
1303
|
message_manager=self.message_manager,
|
|
1302
1304
|
user_defined_variables=None,
|
|
1303
1305
|
append_icm_if_missing=True,
|
|
@@ -1368,33 +1370,24 @@ class Agent(BaseAgent):
|
|
|
1368
1370
|
source_id: str,
|
|
1369
1371
|
source_manager: SourceManager,
|
|
1370
1372
|
agent_manager: AgentManager,
|
|
1371
|
-
page_size: Optional[int] = None,
|
|
1372
1373
|
):
|
|
1373
|
-
"""Attach
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
agents_passages = self.passage_manager.list_passages(actor=user, agent_id=self.agent_state.id, source_id=source_id, limit=page_size)
|
|
1383
|
-
passage_size = self.passage_manager.size(actor=user, agent_id=self.agent_state.id, source_id=source_id)
|
|
1384
|
-
assert all([p.agent_id == self.agent_state.id for p in agents_passages])
|
|
1385
|
-
assert len(agents_passages) == passage_size # sanity check
|
|
1386
|
-
assert passage_size == len(passages), f"Expected {len(passages)} passages, got {passage_size}"
|
|
1387
|
-
|
|
1388
|
-
# attach to agent
|
|
1374
|
+
"""Attach a source to the agent using the SourcesAgents ORM relationship.
|
|
1375
|
+
|
|
1376
|
+
Args:
|
|
1377
|
+
user: User performing the action
|
|
1378
|
+
source_id: ID of the source to attach
|
|
1379
|
+
source_manager: SourceManager instance to verify source exists
|
|
1380
|
+
agent_manager: AgentManager instance to manage agent-source relationship
|
|
1381
|
+
"""
|
|
1382
|
+
# Verify source exists and user has permission to access it
|
|
1389
1383
|
source = source_manager.get_source_by_id(source_id=source_id, actor=user)
|
|
1390
|
-
assert source is not None, f"Source {source_id} not found in
|
|
1384
|
+
assert source is not None, f"Source {source_id} not found in user's organization ({user.organization_id})"
|
|
1391
1385
|
|
|
1392
|
-
#
|
|
1393
|
-
# TODO: delete @matt and remove
|
|
1386
|
+
# Use the agent_manager to create the relationship
|
|
1394
1387
|
agent_manager.attach_source(agent_id=self.agent_state.id, source_id=source_id, actor=user)
|
|
1395
1388
|
|
|
1396
1389
|
printd(
|
|
1397
|
-
f"Attached data source {source.name} to agent {self.agent_state.name}
|
|
1390
|
+
f"Attached data source {source.name} to agent {self.agent_state.name}.",
|
|
1398
1391
|
)
|
|
1399
1392
|
|
|
1400
1393
|
def update_message(self, message_id: str, request: MessageUpdate) -> Message:
|
|
@@ -1550,21 +1543,22 @@ class Agent(BaseAgent):
|
|
|
1550
1543
|
num_tokens_from_messages(messages=messages_openai_format[1:], model=self.model) if len(messages_openai_format) > 1 else 0
|
|
1551
1544
|
)
|
|
1552
1545
|
|
|
1553
|
-
|
|
1546
|
+
agent_manager_passage_size = self.agent_manager.passage_size(actor=self.user, agent_id=self.agent_state.id)
|
|
1554
1547
|
message_manager_size = self.message_manager.size(actor=self.user, agent_id=self.agent_state.id)
|
|
1555
1548
|
external_memory_summary = compile_memory_metadata_block(
|
|
1556
1549
|
actor=self.user,
|
|
1557
1550
|
agent_id=self.agent_state.id,
|
|
1558
1551
|
memory_edit_timestamp=get_utc_time(), # dummy timestamp
|
|
1559
|
-
|
|
1552
|
+
agent_manager=self.agent_manager,
|
|
1560
1553
|
message_manager=self.message_manager,
|
|
1561
1554
|
)
|
|
1562
1555
|
num_tokens_external_memory_summary = count_tokens(external_memory_summary)
|
|
1563
1556
|
|
|
1564
1557
|
# tokens taken up by function definitions
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1558
|
+
agent_state_tool_jsons = [t.json_schema for t in self.agent_state.tools]
|
|
1559
|
+
if agent_state_tool_jsons:
|
|
1560
|
+
available_functions_definitions = [ChatCompletionRequestTool(type="function", function=f) for f in agent_state_tool_jsons]
|
|
1561
|
+
num_tokens_available_functions_definitions = num_tokens_from_functions(functions=agent_state_tool_jsons, model=self.model)
|
|
1568
1562
|
else:
|
|
1569
1563
|
available_functions_definitions = []
|
|
1570
1564
|
num_tokens_available_functions_definitions = 0
|
|
@@ -1582,7 +1576,7 @@ class Agent(BaseAgent):
|
|
|
1582
1576
|
return ContextWindowOverview(
|
|
1583
1577
|
# context window breakdown (in messages)
|
|
1584
1578
|
num_messages=len(self._messages),
|
|
1585
|
-
num_archival_memory=
|
|
1579
|
+
num_archival_memory=agent_manager_passage_size,
|
|
1586
1580
|
num_recall_memory=message_manager_size,
|
|
1587
1581
|
num_tokens_external_memory_summary=num_tokens_external_memory_summary,
|
|
1588
1582
|
# top-level information
|
|
@@ -2156,6 +2156,7 @@ class LocalClient(AbstractClient):
|
|
|
2156
2156
|
"block_ids": [b.id for b in memory.get_blocks()] + block_ids,
|
|
2157
2157
|
"tool_ids": tool_ids,
|
|
2158
2158
|
"tool_rules": tool_rules,
|
|
2159
|
+
"include_base_tools": include_base_tools,
|
|
2159
2160
|
"system": system,
|
|
2160
2161
|
"agent_type": agent_type,
|
|
2161
2162
|
"llm_config": llm_config if llm_config else self._default_llm_config,
|
{letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/constants.py
RENAMED
|
@@ -23,6 +23,7 @@ MIN_CONTEXT_WINDOW = 4096
|
|
|
23
23
|
|
|
24
24
|
# embeddings
|
|
25
25
|
MAX_EMBEDDING_DIM = 4096 # maximum supported embeding size - do NOT change or else DBs will need to be reset
|
|
26
|
+
DEFAULT_EMBEDDING_CHUNK_SIZE = 300
|
|
26
27
|
|
|
27
28
|
# tokenizers
|
|
28
29
|
EMBEDDING_TO_TOKENIZER_MAP = {
|
|
@@ -37,7 +38,8 @@ DEFAULT_HUMAN = "basic"
|
|
|
37
38
|
DEFAULT_PRESET = "memgpt_chat"
|
|
38
39
|
|
|
39
40
|
# Base tools that cannot be edited, as they access agent state directly
|
|
40
|
-
|
|
41
|
+
# Note that we don't include "conversation_search_date" for now
|
|
42
|
+
BASE_TOOLS = ["send_message", "conversation_search", "archival_memory_insert", "archival_memory_search"]
|
|
41
43
|
O1_BASE_TOOLS = ["send_thinking_message", "send_final_message"]
|
|
42
44
|
# Base memory tools CAN be edited, and are added by default by the server
|
|
43
45
|
BASE_MEMORY_TOOLS = ["core_memory_append", "core_memory_replace"]
|
|
@@ -48,6 +50,9 @@ BASE_MEMORY_TOOLS = ["core_memory_append", "core_memory_replace"]
|
|
|
48
50
|
DEFAULT_MESSAGE_TOOL = "send_message"
|
|
49
51
|
DEFAULT_MESSAGE_TOOL_KWARG = "message"
|
|
50
52
|
|
|
53
|
+
# Structured output models
|
|
54
|
+
STRUCTURED_OUTPUT_MODELS = {"gpt-4o", "gpt-4o-mini"}
|
|
55
|
+
|
|
51
56
|
# LOGGER_LOG_LEVEL is use to convert Text to Logging level value for logging mostly for Cli input to setting level
|
|
52
57
|
LOGGER_LOG_LEVELS = {"CRITICAL": CRITICAL, "ERROR": ERROR, "WARN": WARN, "WARNING": WARNING, "INFO": INFO, "DEBUG": DEBUG, "NOTSET": NOTSET}
|
|
53
58
|
|
{letta_nightly-0.6.4.dev20241216104246 → letta_nightly-0.6.5.dev20241218055539}/letta/embeddings.py
RENAMED
|
@@ -234,16 +234,10 @@ def embedding_model(config: EmbeddingConfig, user_id: Optional[uuid.UUID] = None
|
|
|
234
234
|
)
|
|
235
235
|
elif endpoint_type == "ollama":
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
ollama_additional_kwargs = {}
|
|
240
|
-
callback_manager = None
|
|
241
|
-
|
|
242
|
-
model = OllamaEmbedding(
|
|
243
|
-
model_name=config.embedding_model,
|
|
237
|
+
model = OllamaEmbeddings(
|
|
238
|
+
model=config.embedding_model,
|
|
244
239
|
base_url=config.embedding_endpoint,
|
|
245
|
-
ollama_additional_kwargs=
|
|
246
|
-
callback_manager=callback_manager or None,
|
|
240
|
+
ollama_additional_kwargs={},
|
|
247
241
|
)
|
|
248
242
|
return model
|
|
249
243
|
|