letta-nightly 0.6.3.dev20241212104231__tar.gz → 0.6.3.dev20241213104231__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.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/PKG-INFO +1 -1
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/agent.py +1 -2
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/data_sources/connectors.py +2 -6
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/passage.py +3 -4
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/server.py +45 -22
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/passage_manager.py +19 -28
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/tool_execution_sandbox.py +37 -48
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/pyproject.toml +1 -1
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/LICENSE +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/README.md +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/__main__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/benchmark/benchmark.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/benchmark/constants.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/chat_only_agent.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/cli/cli.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/cli/cli_config.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/cli/cli_load.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/client/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/client/client.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/client/streaming.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/client/utils.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/config.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/constants.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/credentials.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/data_sources/connectors_helper.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/embeddings.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/errors.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/functions/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/functions/function_sets/base.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/functions/function_sets/extras.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/functions/functions.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/functions/helpers.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/functions/schema_generator.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/helpers/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/helpers/tool_rule_solver.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/humans/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/humans/examples/basic.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/humans/examples/cs_phd.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/interface.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/llm_api/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/llm_api/anthropic.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/llm_api/azure_openai.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/llm_api/azure_openai_constants.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/llm_api/cohere.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/llm_api/google_ai.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/llm_api/helpers.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/llm_api/llm_api_tools.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/llm_api/mistral.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/llm_api/openai.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/README.md +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/chat_completion_proxy.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/constants.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/function_parser.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/grammars/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/grammars/json.gbnf +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/json_parser.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/koboldcpp/api.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/koboldcpp/settings.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llamacpp/api.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llamacpp/settings.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/lmstudio/api.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/lmstudio/settings.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/ollama/api.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/ollama/settings.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/settings/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/settings/settings.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/settings/simple.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/utils.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/vllm/api.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/webui/api.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/webui/legacy_api.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/webui/legacy_settings.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/local_llm/webui/settings.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/log.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/main.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/memory.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/metadata.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/o1_agent.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/offline_memory_agent.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/openai_backcompat/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/openai_backcompat/openai_object.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/__all__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/agents_tags.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/base.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/block.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/blocks_agents.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/enums.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/errors.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/file.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/job.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/message.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/mixins.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/organization.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/sandbox_config.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/source.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/sqlalchemy_base.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/sqlite_functions.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/tool.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/tools_agents.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/user.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/examples/anna_pa.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/examples/google_search_persona.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/examples/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/examples/memgpt_starter.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/examples/o1_persona.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/examples/offline_memory_persona.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/examples/sam.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/examples/sam_pov.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/personas/examples/sqldb/test.db +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/gpt_summarize.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/gpt_system.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_base.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_chat.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_convo_only.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/providers.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/pytest.ini +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/agent.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/agents_tags.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/api_key.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/block.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/blocks_agents.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/embedding_config.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/enums.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/file.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/health.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/job.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/letta_base.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/letta_message.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/letta_request.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/letta_response.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/llm_config.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/memory.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/message.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/openai/chat_completion_request.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/openai/chat_completion_response.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/openai/chat_completions.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/openai/embedding_response.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/openai/openai.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/organization.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/passage.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/sandbox_config.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/source.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/tool.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/tool_rule.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/tools_agents.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/usage.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/schemas/user.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/constants.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/generate_openapi_schema.sh +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/app.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/auth/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/auth/index.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/auth_token.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/interface.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/openai/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/openai/assistants/threads.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/agents.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/blocks.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/health.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/jobs.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/llms.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/organizations.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/sources.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/tools.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/routers/v1/users.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/static_files.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/rest_api/utils.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/startup.sh +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/static_files/assets/index-048c9598.js +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/static_files/assets/index-0e31b727.css +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/static_files/favicon.ico +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/static_files/index.html +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/utils.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/ws_api/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/ws_api/example_client.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/ws_api/interface.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/ws_api/protocol.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/server/ws_api/server.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/__init__.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/agents_tags_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/block_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/blocks_agents_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/job_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/message_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/organization_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/per_agent_lock_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/sandbox_config_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/source_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/tool_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/tool_sandbox_env/.gitkeep +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/tools_agents_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/services/user_manager.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/settings.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/streaming_interface.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/streaming_utils.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/system.py +0 -0
- {letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/utils.py +0 -0
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/agent.py
RENAMED
|
@@ -1371,10 +1371,9 @@ class Agent(BaseAgent):
|
|
|
1371
1371
|
# TODO: recall memory
|
|
1372
1372
|
raise NotImplementedError()
|
|
1373
1373
|
|
|
1374
|
-
def attach_source(self, user: PydanticUser, source_id: str, source_manager: SourceManager, ms: MetadataStore):
|
|
1374
|
+
def attach_source(self, user: PydanticUser, source_id: str, source_manager: SourceManager, ms: MetadataStore, page_size: Optional[int] = None):
|
|
1375
1375
|
"""Attach data with name `source_name` to the agent from source_connector."""
|
|
1376
1376
|
# TODO: eventually, adding a data source should just give access to the retriever the source table, rather than modifying archival memory
|
|
1377
|
-
page_size = 100
|
|
1378
1377
|
passages = self.passage_manager.list_passages(actor=user, source_id=source_id, limit=page_size)
|
|
1379
1378
|
|
|
1380
1379
|
for passage in passages:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Dict, Iterator, List, Tuple
|
|
1
|
+
from typing import Dict, Iterator, List, Tuple
|
|
2
2
|
|
|
3
3
|
import typer
|
|
4
4
|
|
|
@@ -13,8 +13,6 @@ from letta.schemas.passage import Passage
|
|
|
13
13
|
from letta.schemas.source import Source
|
|
14
14
|
from letta.services.passage_manager import PassageManager
|
|
15
15
|
from letta.services.source_manager import SourceManager
|
|
16
|
-
from letta.utils import create_uuid_from_string
|
|
17
|
-
|
|
18
16
|
|
|
19
17
|
class DataConnector:
|
|
20
18
|
"""
|
|
@@ -42,7 +40,7 @@ class DataConnector:
|
|
|
42
40
|
"""
|
|
43
41
|
|
|
44
42
|
|
|
45
|
-
def load_data(connector: DataConnector, source: Source, passage_manager: PassageManager, source_manager: SourceManager, actor: "User"
|
|
43
|
+
def load_data(connector: DataConnector, source: Source, passage_manager: PassageManager, source_manager: SourceManager, actor: "User"):
|
|
46
44
|
"""Load data from a connector (generates file and passages) into a specified source_id, associated with a user_id."""
|
|
47
45
|
embedding_config = source.embedding_config
|
|
48
46
|
|
|
@@ -79,10 +77,8 @@ def load_data(connector: DataConnector, source: Source, passage_manager: Passage
|
|
|
79
77
|
continue
|
|
80
78
|
|
|
81
79
|
passage = Passage(
|
|
82
|
-
id=create_uuid_from_string(f"{str(source.id)}_{passage_text}"),
|
|
83
80
|
text=passage_text,
|
|
84
81
|
file_id=file_metadata.id,
|
|
85
|
-
agent_id=agent_id,
|
|
86
82
|
source_id=source.id,
|
|
87
83
|
metadata_=passage_metadata,
|
|
88
84
|
organization_id=source.organization_id,
|
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/orm/passage.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
from typing import
|
|
3
|
-
from sqlalchemy import Column, String, DateTime,
|
|
2
|
+
from typing import Optional, TYPE_CHECKING
|
|
3
|
+
from sqlalchemy import Column, String, DateTime, JSON, ForeignKey
|
|
4
4
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
5
5
|
from sqlalchemy.types import TypeDecorator, BINARY
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ import base64
|
|
|
9
9
|
|
|
10
10
|
from letta.orm.source import EmbeddingConfigColumn
|
|
11
11
|
from letta.orm.sqlalchemy_base import SqlalchemyBase
|
|
12
|
-
from letta.orm.mixins import
|
|
12
|
+
from letta.orm.mixins import FileMixin, OrganizationMixin
|
|
13
13
|
from letta.schemas.passage import Passage as PydanticPassage
|
|
14
14
|
|
|
15
15
|
from letta.config import LettaConfig
|
|
@@ -19,7 +19,6 @@ from letta.settings import settings
|
|
|
19
19
|
config = LettaConfig()
|
|
20
20
|
|
|
21
21
|
if TYPE_CHECKING:
|
|
22
|
-
from letta.orm.file import File
|
|
23
22
|
from letta.orm.organization import Organization
|
|
24
23
|
|
|
25
24
|
class CommonVector(TypeDecorator):
|
|
@@ -1345,17 +1345,10 @@ class SyncServer(Server):
|
|
|
1345
1345
|
letta_agent = self.load_agent(agent_id=agent_id)
|
|
1346
1346
|
|
|
1347
1347
|
# Insert into archival memory
|
|
1348
|
-
|
|
1349
|
-
agent_state=letta_agent.agent_state, agent_id=agent_id, text=memory_contents, actor=actor
|
|
1348
|
+
return self.passage_manager.insert_passage(
|
|
1349
|
+
agent_state=letta_agent.agent_state, agent_id=agent_id, text=memory_contents, actor=actor
|
|
1350
1350
|
)
|
|
1351
1351
|
|
|
1352
|
-
# Update the agent
|
|
1353
|
-
# TODO: should this update the system prompt?
|
|
1354
|
-
save_agent(letta_agent, self.ms)
|
|
1355
|
-
|
|
1356
|
-
# TODO: this is gross, fix
|
|
1357
|
-
return [self.passage_manager.get_passage_by_id(passage_id=passage_id, actor=actor) for passage_id in passage_ids]
|
|
1358
|
-
|
|
1359
1352
|
def delete_archival_memory(self, user_id: str, agent_id: str, memory_id: str):
|
|
1360
1353
|
actor = self.user_manager.get_user_by_id(user_id=user_id)
|
|
1361
1354
|
if actor is None:
|
|
@@ -1584,6 +1577,8 @@ class SyncServer(Server):
|
|
|
1584
1577
|
from letta.data_sources.connectors import DirectoryConnector
|
|
1585
1578
|
|
|
1586
1579
|
source = self.source_manager.get_source_by_id(source_id=source_id)
|
|
1580
|
+
if source is None:
|
|
1581
|
+
raise ValueError(f"Source {source_id} does not exist")
|
|
1587
1582
|
connector = DirectoryConnector(input_files=[file_path])
|
|
1588
1583
|
num_passages, num_documents = self.load_data(user_id=source.created_by_id, source_name=source.name, connector=connector)
|
|
1589
1584
|
|
|
@@ -1593,6 +1588,15 @@ class SyncServer(Server):
|
|
|
1593
1588
|
job.metadata_["num_documents"] = num_documents
|
|
1594
1589
|
self.job_manager.update_job_by_id(job_id=job_id, job_update=JobUpdate(**job.model_dump()), actor=actor)
|
|
1595
1590
|
|
|
1591
|
+
# update all agents who have this source attached
|
|
1592
|
+
agent_ids = self.ms.list_attached_agents(source_id=source_id)
|
|
1593
|
+
for agent_id in agent_ids:
|
|
1594
|
+
agent = self.load_agent(agent_id=agent_id)
|
|
1595
|
+
curr_passage_size = self.passage_manager.size(actor=actor, agent_id=agent_id, source_id=source_id)
|
|
1596
|
+
agent.attach_source(user=actor, source_id=source_id, source_manager=self.source_manager, ms=self.ms)
|
|
1597
|
+
new_passage_size = self.passage_manager.size(actor=actor, agent_id=agent_id, source_id=source_id)
|
|
1598
|
+
assert new_passage_size >= curr_passage_size # in case empty files are added
|
|
1599
|
+
|
|
1596
1600
|
return job
|
|
1597
1601
|
|
|
1598
1602
|
def load_data(
|
|
@@ -1600,7 +1604,6 @@ class SyncServer(Server):
|
|
|
1600
1604
|
user_id: str,
|
|
1601
1605
|
connector: DataConnector,
|
|
1602
1606
|
source_name: str,
|
|
1603
|
-
agent_id: Optional[str] = None,
|
|
1604
1607
|
) -> Tuple[int, int]:
|
|
1605
1608
|
"""Load data from a DataConnector into a source for a specified user_id"""
|
|
1606
1609
|
# TODO: this should be implemented as a batch job or at least async, since it may take a long time
|
|
@@ -1612,9 +1615,7 @@ class SyncServer(Server):
|
|
|
1612
1615
|
raise ValueError(f"Data source {source_name} does not exist for user {user_id}")
|
|
1613
1616
|
|
|
1614
1617
|
# load data into the document store
|
|
1615
|
-
passage_count, document_count = load_data(
|
|
1616
|
-
connector, source, self.passage_manager, self.source_manager, actor=user, agent_id=agent_id
|
|
1617
|
-
)
|
|
1618
|
+
passage_count, document_count = load_data(connector, source, self.passage_manager, self.source_manager, actor=user)
|
|
1618
1619
|
return passage_count, document_count
|
|
1619
1620
|
|
|
1620
1621
|
def attach_source_to_agent(
|
|
@@ -1956,6 +1957,21 @@ class SyncServer(Server):
|
|
|
1956
1957
|
if sandbox_run_result is None:
|
|
1957
1958
|
raise ValueError(f"Tool with id {tool.id} returned execution with None")
|
|
1958
1959
|
function_response = str(sandbox_run_result.func_return)
|
|
1960
|
+
stdout = [s for s in sandbox_run_result.stdout if s.strip()]
|
|
1961
|
+
stderr = [s for s in sandbox_run_result.stderr if s.strip()]
|
|
1962
|
+
|
|
1963
|
+
# expected error
|
|
1964
|
+
if stderr:
|
|
1965
|
+
error_msg = self.get_error_msg_for_func_return(tool.name, stderr[-1])
|
|
1966
|
+
return FunctionReturn(
|
|
1967
|
+
id="null",
|
|
1968
|
+
function_call_id="null",
|
|
1969
|
+
date=get_utc_time(),
|
|
1970
|
+
status="error",
|
|
1971
|
+
function_return=error_msg,
|
|
1972
|
+
stdout=stdout,
|
|
1973
|
+
stderr=stderr,
|
|
1974
|
+
)
|
|
1959
1975
|
|
|
1960
1976
|
return FunctionReturn(
|
|
1961
1977
|
id="null",
|
|
@@ -1963,17 +1979,13 @@ class SyncServer(Server):
|
|
|
1963
1979
|
date=get_utc_time(),
|
|
1964
1980
|
status="success",
|
|
1965
1981
|
function_return=function_response,
|
|
1966
|
-
stdout=
|
|
1967
|
-
stderr=
|
|
1982
|
+
stdout=stdout,
|
|
1983
|
+
stderr=stderr,
|
|
1968
1984
|
)
|
|
1969
|
-
except Exception as e:
|
|
1970
|
-
# same as agent.py
|
|
1971
|
-
from letta.constants import MAX_ERROR_MESSAGE_CHAR_LIMIT
|
|
1972
|
-
|
|
1973
|
-
error_msg = f"Error executing tool {tool.name}: {e}"
|
|
1974
|
-
if len(error_msg) > MAX_ERROR_MESSAGE_CHAR_LIMIT:
|
|
1975
|
-
error_msg = error_msg[:MAX_ERROR_MESSAGE_CHAR_LIMIT]
|
|
1976
1985
|
|
|
1986
|
+
# unexpected error TODO(@cthomas): consolidate error handling
|
|
1987
|
+
except Exception as e:
|
|
1988
|
+
error_msg = self.get_error_msg_for_func_return(tool.name, e)
|
|
1977
1989
|
return FunctionReturn(
|
|
1978
1990
|
id="null",
|
|
1979
1991
|
function_call_id="null",
|
|
@@ -1984,6 +1996,17 @@ class SyncServer(Server):
|
|
|
1984
1996
|
stderr=[traceback.format_exc()],
|
|
1985
1997
|
)
|
|
1986
1998
|
|
|
1999
|
+
|
|
2000
|
+
def get_error_msg_for_func_return(self, tool_name, exception_message):
|
|
2001
|
+
# same as agent.py
|
|
2002
|
+
from letta.constants import MAX_ERROR_MESSAGE_CHAR_LIMIT
|
|
2003
|
+
|
|
2004
|
+
error_msg = f"Error executing tool {tool_name}: {exception_message}"
|
|
2005
|
+
if len(error_msg) > MAX_ERROR_MESSAGE_CHAR_LIMIT:
|
|
2006
|
+
error_msg = error_msg[:MAX_ERROR_MESSAGE_CHAR_LIMIT]
|
|
2007
|
+
return error_msg
|
|
2008
|
+
|
|
2009
|
+
|
|
1987
2010
|
# Composio wrappers
|
|
1988
2011
|
def get_composio_client(self, api_key: Optional[str] = None):
|
|
1989
2012
|
if api_key:
|
|
@@ -26,11 +26,8 @@ class PassageManager:
|
|
|
26
26
|
def get_passage_by_id(self, passage_id: str, actor: PydanticUser) -> Optional[PydanticPassage]:
|
|
27
27
|
"""Fetch a passage by ID."""
|
|
28
28
|
with self.session_maker() as session:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return passage.to_pydantic()
|
|
32
|
-
except NoResultFound:
|
|
33
|
-
return None
|
|
29
|
+
passage = PassageModel.read(db_session=session, identifier=passage_id, actor=actor)
|
|
30
|
+
return passage.to_pydantic()
|
|
34
31
|
|
|
35
32
|
@enforce_types
|
|
36
33
|
def create_passage(self, pydantic_passage: PydanticPassage, actor: PydanticUser) -> PydanticPassage:
|
|
@@ -83,11 +80,6 @@ class PassageManager:
|
|
|
83
80
|
actor=actor
|
|
84
81
|
)
|
|
85
82
|
passages.append(passage)
|
|
86
|
-
|
|
87
|
-
ids = [str(p.id) for p in passages]
|
|
88
|
-
|
|
89
|
-
if return_ids:
|
|
90
|
-
return ids
|
|
91
83
|
|
|
92
84
|
return passages
|
|
93
85
|
|
|
@@ -101,26 +93,23 @@ class PassageManager:
|
|
|
101
93
|
raise ValueError("Passage ID must be provided.")
|
|
102
94
|
|
|
103
95
|
with self.session_maker() as session:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
raise ValueError(f"Passage with id {passage_id} does not exist.")
|
|
96
|
+
# Fetch existing message from database
|
|
97
|
+
curr_passage = PassageModel.read(
|
|
98
|
+
db_session=session,
|
|
99
|
+
identifier=passage_id,
|
|
100
|
+
actor=actor,
|
|
101
|
+
)
|
|
102
|
+
if not curr_passage:
|
|
103
|
+
raise ValueError(f"Passage with id {passage_id} does not exist.")
|
|
113
104
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
105
|
+
# Update the database record with values from the provided record
|
|
106
|
+
update_data = passage.model_dump(exclude_unset=True, exclude_none=True)
|
|
107
|
+
for key, value in update_data.items():
|
|
108
|
+
setattr(curr_passage, key, value)
|
|
118
109
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
except NoResultFound:
|
|
123
|
-
return None
|
|
110
|
+
# Commit changes
|
|
111
|
+
curr_passage.update(session, actor=actor)
|
|
112
|
+
return curr_passage.to_pydantic()
|
|
124
113
|
|
|
125
114
|
@enforce_types
|
|
126
115
|
def delete_passage_by_id(self, passage_id: str, actor: PydanticUser) -> bool:
|
|
@@ -145,6 +134,7 @@ class PassageManager:
|
|
|
145
134
|
query_text : Optional[str] = None,
|
|
146
135
|
start_date : Optional[datetime] = None,
|
|
147
136
|
end_date : Optional[datetime] = None,
|
|
137
|
+
ascending : bool = True,
|
|
148
138
|
source_id : Optional[str] = None,
|
|
149
139
|
embed_query : bool = False,
|
|
150
140
|
embedding_config: Optional[EmbeddingConfig] = None
|
|
@@ -176,6 +166,7 @@ class PassageManager:
|
|
|
176
166
|
start_date=start_date,
|
|
177
167
|
end_date=end_date,
|
|
178
168
|
limit=limit,
|
|
169
|
+
ascending=ascending,
|
|
179
170
|
query_text=query_text if not embedded_text else None,
|
|
180
171
|
query_embedding=embedded_text,
|
|
181
172
|
**filters
|
|
@@ -7,6 +7,7 @@ import runpy
|
|
|
7
7
|
import subprocess
|
|
8
8
|
import sys
|
|
9
9
|
import tempfile
|
|
10
|
+
import traceback
|
|
10
11
|
import uuid
|
|
11
12
|
import venv
|
|
12
13
|
from typing import Any, Dict, Optional, TextIO
|
|
@@ -174,41 +175,16 @@ class ToolExecutionSandbox:
|
|
|
174
175
|
capture_output=True,
|
|
175
176
|
text=True,
|
|
176
177
|
)
|
|
177
|
-
|
|
178
|
-
# Handle error with optimistic error parsing from the string
|
|
179
|
-
# This is very brittle, so we fall back to a RuntimeError if parsing fails
|
|
180
|
-
if result.returncode != 0:
|
|
181
|
-
# Log the error
|
|
182
|
-
logger.error(f"Sandbox execution error:\n{result.stderr}")
|
|
183
|
-
|
|
184
|
-
# Parse and raise the actual error from stderr
|
|
185
|
-
tb_lines = result.stderr.strip().splitlines()
|
|
186
|
-
exception_line = tb_lines[-1] # The last line contains the exception
|
|
187
|
-
|
|
188
|
-
try:
|
|
189
|
-
# Split exception type and message
|
|
190
|
-
exception_type, exception_message = exception_line.split(": ", 1)
|
|
191
|
-
exception_type = exception_type.strip()
|
|
192
|
-
exception_message = exception_message.strip()
|
|
193
|
-
|
|
194
|
-
# Dynamically raise the exception
|
|
195
|
-
exception_class = eval(exception_type) # Look up the exception type
|
|
196
|
-
|
|
197
|
-
except Exception:
|
|
198
|
-
# Fallback to RuntimeError if parsing fails
|
|
199
|
-
raise RuntimeError(result.stderr)
|
|
200
|
-
|
|
201
|
-
raise exception_class(exception_message)
|
|
202
|
-
|
|
203
178
|
func_result, stdout = self.parse_out_function_results_markers(result.stdout)
|
|
204
179
|
func_return, agent_state = self.parse_best_effort(func_result)
|
|
205
180
|
return SandboxRunResult(
|
|
206
|
-
func_return=func_return,
|
|
181
|
+
func_return=func_return,
|
|
207
182
|
agent_state=agent_state,
|
|
208
183
|
stdout=[stdout],
|
|
209
184
|
stderr=[result.stderr],
|
|
210
185
|
sandbox_config_fingerprint=sbx_config.fingerprint(),
|
|
211
186
|
)
|
|
187
|
+
|
|
212
188
|
except subprocess.TimeoutExpired:
|
|
213
189
|
raise TimeoutError(f"Executing tool {self.tool_name} has timed out.")
|
|
214
190
|
except subprocess.CalledProcessError as e:
|
|
@@ -217,39 +193,49 @@ class ToolExecutionSandbox:
|
|
|
217
193
|
except Exception as e:
|
|
218
194
|
logger.error(f"Executing tool {self.tool_name} has an unexpected error: {e}")
|
|
219
195
|
raise e
|
|
196
|
+
|
|
220
197
|
|
|
221
198
|
def run_local_dir_sandbox_runpy(
|
|
222
199
|
self, sbx_config: SandboxConfig, env_vars: Dict[str, str], temp_file_path: str, old_stdout: TextIO, old_stderr: TextIO
|
|
223
200
|
) -> SandboxRunResult:
|
|
201
|
+
func_return, agent_state, error_msg = None, None, None
|
|
202
|
+
|
|
224
203
|
# Redirect stdout and stderr to capture script output
|
|
225
|
-
captured_stdout = io.StringIO()
|
|
226
|
-
captured_stderr = io.StringIO()
|
|
204
|
+
captured_stdout, captured_stderr = io.StringIO(), io.StringIO()
|
|
227
205
|
sys.stdout = captured_stdout
|
|
228
206
|
sys.stderr = captured_stderr
|
|
229
207
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
208
|
+
try:
|
|
209
|
+
# Execute the temp file
|
|
210
|
+
with self.temporary_env_vars(env_vars):
|
|
211
|
+
result = runpy.run_path(temp_file_path, init_globals=env_vars)
|
|
212
|
+
|
|
213
|
+
# Fetch the result
|
|
214
|
+
func_result = result.get(self.LOCAL_SANDBOX_RESULT_VAR_NAME)
|
|
215
|
+
func_return, agent_state = self.parse_best_effort(func_result)
|
|
233
216
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
217
|
+
except Exception as e:
|
|
218
|
+
traceback.print_exc(file=sys.stderr)
|
|
219
|
+
error_msg = f"{type(e).__name__}: {str(e)}"
|
|
237
220
|
|
|
238
221
|
# Restore stdout and stderr and collect captured output
|
|
239
222
|
sys.stdout = old_stdout
|
|
240
223
|
sys.stderr = old_stderr
|
|
241
|
-
stdout_output = captured_stdout.getvalue()
|
|
242
|
-
stderr_output = captured_stderr.getvalue()
|
|
224
|
+
stdout_output = [captured_stdout.getvalue()]
|
|
225
|
+
stderr_output = [captured_stderr.getvalue()]
|
|
226
|
+
stderr_output.append(error_msg if error_msg else '')
|
|
243
227
|
|
|
244
228
|
return SandboxRunResult(
|
|
245
229
|
func_return=func_return,
|
|
246
230
|
agent_state=agent_state,
|
|
247
|
-
stdout=
|
|
248
|
-
stderr=
|
|
231
|
+
stdout=stdout_output,
|
|
232
|
+
stderr=stderr_output,
|
|
249
233
|
sandbox_config_fingerprint=sbx_config.fingerprint(),
|
|
250
234
|
)
|
|
251
235
|
|
|
252
236
|
def parse_out_function_results_markers(self, text: str):
|
|
237
|
+
if self.LOCAL_SANDBOX_RESULT_START_MARKER not in text:
|
|
238
|
+
return '', text
|
|
253
239
|
marker_len = len(self.LOCAL_SANDBOX_RESULT_START_MARKER)
|
|
254
240
|
start_index = text.index(self.LOCAL_SANDBOX_RESULT_START_MARKER) + marker_len
|
|
255
241
|
end_index = text.index(self.LOCAL_SANDBOX_RESULT_END_MARKER)
|
|
@@ -294,21 +280,22 @@ class ToolExecutionSandbox:
|
|
|
294
280
|
env_vars = self.sandbox_config_manager.get_sandbox_env_vars_as_dict(sandbox_config_id=sbx_config.id, actor=self.user, limit=100)
|
|
295
281
|
code = self.generate_execution_script(agent_state=agent_state)
|
|
296
282
|
execution = sbx.run_code(code, envs=env_vars)
|
|
283
|
+
func_return, agent_state = None, None
|
|
297
284
|
if execution.error is not None:
|
|
298
285
|
logger.error(f"Executing tool {self.tool_name} failed with {execution.error}")
|
|
299
|
-
|
|
300
|
-
|
|
286
|
+
execution.logs.stderr.append(execution.error.traceback)
|
|
287
|
+
execution.logs.stderr.append(f"{execution.error.name}: {execution.error.value}")
|
|
301
288
|
elif len(execution.results) == 0:
|
|
302
289
|
return None
|
|
303
290
|
else:
|
|
304
291
|
func_return, agent_state = self.parse_best_effort(execution.results[0].text)
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
292
|
+
return SandboxRunResult(
|
|
293
|
+
func_return=func_return,
|
|
294
|
+
agent_state=agent_state,
|
|
295
|
+
stdout=execution.logs.stdout,
|
|
296
|
+
stderr=execution.logs.stderr,
|
|
297
|
+
sandbox_config_fingerprint=sbx_config.fingerprint(),
|
|
298
|
+
)
|
|
312
299
|
|
|
313
300
|
def parse_exception_from_e2b_execution(self, e2b_execution: "Execution") -> Exception:
|
|
314
301
|
builtins_dict = __builtins__ if isinstance(__builtins__, dict) else vars(__builtins__)
|
|
@@ -356,6 +343,8 @@ class ToolExecutionSandbox:
|
|
|
356
343
|
# general utility functions
|
|
357
344
|
|
|
358
345
|
def parse_best_effort(self, text: str) -> Any:
|
|
346
|
+
if not text:
|
|
347
|
+
return None, None
|
|
359
348
|
result = pickle.loads(base64.b64decode(text))
|
|
360
349
|
agent_state = None
|
|
361
350
|
if not result["agent_state"] is None:
|
|
File without changes
|
|
File without changes
|
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/__init__.py
RENAMED
|
File without changes
|
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/__main__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/cli/cli.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/config.py
RENAMED
|
File without changes
|
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/constants.py
RENAMED
|
File without changes
|
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/credentials.py
RENAMED
|
File without changes
|
|
File without changes
|
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/embeddings.py
RENAMED
|
File without changes
|
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/errors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{letta_nightly-0.6.3.dev20241212104231 → letta_nightly-0.6.3.dev20241213104231}/letta/interface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|