letta-nightly 0.6.5.dev20241218104144__tar.gz → 0.6.5.dev20241219104153__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.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/PKG-INFO +3 -3
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/agent.py +17 -5
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/client/client.py +2 -2
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/errors.py +54 -19
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/functions/function_sets/base.py +0 -54
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/llm_api/llm_api_tools.py +2 -2
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/message.py +2 -1
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/passage.py +14 -15
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/agents.py +11 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/tools.py +3 -18
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/utils.py +23 -22
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/server.py +31 -4
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/agent_manager.py +32 -46
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/tool_manager.py +3 -3
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/pyproject.toml +3 -3
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/LICENSE +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/README.md +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/__main__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/benchmark/benchmark.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/benchmark/constants.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/chat_only_agent.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/cli/cli.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/cli/cli_config.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/cli/cli_load.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/client/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/client/streaming.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/client/utils.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/config.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/constants.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/credentials.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/data_sources/connectors.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/data_sources/connectors_helper.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/embeddings.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/functions/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/functions/function_sets/extras.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/functions/functions.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/functions/helpers.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/functions/schema_generator.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/helpers/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/helpers/tool_rule_solver.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/humans/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/humans/examples/basic.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/humans/examples/cs_phd.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/interface.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/llm_api/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/llm_api/anthropic.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/llm_api/azure_openai.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/llm_api/azure_openai_constants.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/llm_api/cohere.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/llm_api/google_ai.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/llm_api/helpers.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/llm_api/mistral.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/llm_api/openai.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/README.md +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/chat_completion_proxy.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/constants.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/function_parser.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/grammars/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/grammars/json.gbnf +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/json_parser.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/koboldcpp/api.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/koboldcpp/settings.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llamacpp/api.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llamacpp/settings.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/lmstudio/api.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/lmstudio/settings.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/ollama/api.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/ollama/settings.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/settings/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/settings/settings.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/settings/simple.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/utils.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/vllm/api.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/webui/api.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/webui/legacy_api.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/webui/legacy_settings.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/local_llm/webui/settings.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/log.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/main.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/memory.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/o1_agent.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/offline_memory_agent.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/openai_backcompat/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/openai_backcompat/openai_object.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/__all__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/agent.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/agents_tags.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/base.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/block.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/blocks_agents.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/custom_columns.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/enums.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/errors.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/file.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/job.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/mixins.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/organization.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/sandbox_config.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/source.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/sources_agents.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/sqlalchemy_base.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/sqlite_functions.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/tool.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/tools_agents.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/user.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/examples/anna_pa.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/examples/google_search_persona.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/examples/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/examples/memgpt_starter.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/examples/o1_persona.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/examples/offline_memory_persona.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/examples/sam.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/examples/sam_pov.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/personas/examples/sqldb/test.db +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/gpt_summarize.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/gpt_system.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_base.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_chat.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_convo_only.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/providers.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/pytest.ini +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/agent.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/block.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/embedding_config.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/enums.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/file.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/health.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/job.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/letta_base.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/letta_message.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/letta_request.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/letta_response.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/llm_config.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/memory.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/message.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/openai/chat_completion_request.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/openai/chat_completion_response.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/openai/chat_completions.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/openai/embedding_response.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/openai/openai.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/organization.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/passage.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/sandbox_config.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/source.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/tool.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/tool_rule.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/usage.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/schemas/user.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/constants.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/generate_openapi_schema.sh +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/app.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/auth/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/auth/index.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/auth_token.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/interface.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/openai/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/blocks.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/health.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/jobs.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/llms.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/organizations.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/sources.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/routers/v1/users.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/rest_api/static_files.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/startup.sh +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/static_files/assets/index-048c9598.js +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/static_files/assets/index-0e31b727.css +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/static_files/favicon.ico +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/static_files/index.html +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/utils.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/ws_api/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/ws_api/example_client.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/ws_api/interface.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/ws_api/protocol.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/server/ws_api/server.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/__init__.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/block_manager.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/helpers/agent_manager_helper.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/job_manager.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/message_manager.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/organization_manager.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/passage_manager.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/per_agent_lock_manager.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/sandbox_config_manager.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/source_manager.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/tool_execution_sandbox.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/tool_sandbox_env/.gitkeep +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/services/user_manager.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/settings.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/streaming_interface.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/streaming_utils.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/system.py +0 -0
- {letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: letta-nightly
|
|
3
|
-
Version: 0.6.5.
|
|
3
|
+
Version: 0.6.5.dev20241219104153
|
|
4
4
|
Summary: Create LLM agents with long-term memory and custom tools
|
|
5
5
|
License: Apache License
|
|
6
6
|
Author: Letta Team
|
|
@@ -23,8 +23,8 @@ Requires-Dist: alembic (>=1.13.3,<2.0.0)
|
|
|
23
23
|
Requires-Dist: autoflake (>=2.3.0,<3.0.0) ; extra == "dev" or extra == "all"
|
|
24
24
|
Requires-Dist: black[jupyter] (>=24.2.0,<25.0.0) ; extra == "dev" or extra == "all"
|
|
25
25
|
Requires-Dist: brotli (>=1.1.0,<2.0.0)
|
|
26
|
-
Requires-Dist: composio-core (>=0.
|
|
27
|
-
Requires-Dist: composio-langchain (>=0.
|
|
26
|
+
Requires-Dist: composio-core (>=0.6.3,<0.7.0)
|
|
27
|
+
Requires-Dist: composio-langchain (>=0.6.3,<0.7.0)
|
|
28
28
|
Requires-Dist: datasets (>=2.14.6,<3.0.0) ; extra == "dev" or extra == "all"
|
|
29
29
|
Requires-Dist: demjson3 (>=3.0.6,<4.0.0)
|
|
30
30
|
Requires-Dist: docker (>=7.1.0,<8.0.0) ; extra == "external-tools" or extra == "all"
|
{letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/agent.py
RENAMED
|
@@ -20,7 +20,7 @@ from letta.constants import (
|
|
|
20
20
|
REQ_HEARTBEAT_MESSAGE,
|
|
21
21
|
STRUCTURED_OUTPUT_MODELS,
|
|
22
22
|
)
|
|
23
|
-
from letta.errors import
|
|
23
|
+
from letta.errors import ContextWindowExceededError
|
|
24
24
|
from letta.helpers import ToolRulesSolver
|
|
25
25
|
from letta.interface import AgentInterface
|
|
26
26
|
from letta.llm_api.helpers import is_context_overflow_error
|
|
@@ -1094,6 +1094,7 @@ class Agent(BaseAgent):
|
|
|
1094
1094
|
|
|
1095
1095
|
# If we got a context alert, try trimming the messages length, then try again
|
|
1096
1096
|
if is_context_overflow_error(e):
|
|
1097
|
+
printd(f"context window exceeded with limit {self.agent_state.llm_config.context_window}, running summarizer to trim messages")
|
|
1097
1098
|
# A separate API call to run a summarizer
|
|
1098
1099
|
self.summarize_messages_inplace()
|
|
1099
1100
|
|
|
@@ -1169,8 +1170,13 @@ class Agent(BaseAgent):
|
|
|
1169
1170
|
|
|
1170
1171
|
# If at this point there's nothing to summarize, throw an error
|
|
1171
1172
|
if len(candidate_messages_to_summarize) == 0:
|
|
1172
|
-
raise
|
|
1173
|
-
|
|
1173
|
+
raise ContextWindowExceededError(
|
|
1174
|
+
"Not enough messages to compress for summarization",
|
|
1175
|
+
details={
|
|
1176
|
+
"num_candidate_messages": len(candidate_messages_to_summarize),
|
|
1177
|
+
"num_total_messages": len(self.messages),
|
|
1178
|
+
"preserve_N": MESSAGE_SUMMARY_TRUNC_KEEP_N_LAST,
|
|
1179
|
+
},
|
|
1174
1180
|
)
|
|
1175
1181
|
|
|
1176
1182
|
# Walk down the message buffer (front-to-back) until we hit the target token count
|
|
@@ -1204,8 +1210,13 @@ class Agent(BaseAgent):
|
|
|
1204
1210
|
message_sequence_to_summarize = self._messages[1:cutoff] # do NOT get rid of the system message
|
|
1205
1211
|
if len(message_sequence_to_summarize) <= 1:
|
|
1206
1212
|
# This prevents a potential infinite loop of summarizing the same message over and over
|
|
1207
|
-
raise
|
|
1208
|
-
|
|
1213
|
+
raise ContextWindowExceededError(
|
|
1214
|
+
"Not enough messages to compress for summarization after determining cutoff",
|
|
1215
|
+
details={
|
|
1216
|
+
"num_candidate_messages": len(message_sequence_to_summarize),
|
|
1217
|
+
"num_total_messages": len(self.messages),
|
|
1218
|
+
"preserve_N": MESSAGE_SUMMARY_TRUNC_KEEP_N_LAST,
|
|
1219
|
+
},
|
|
1209
1220
|
)
|
|
1210
1221
|
else:
|
|
1211
1222
|
printd(f"Attempting to summarize {len(message_sequence_to_summarize)} messages [1:{cutoff}] of {len(self._messages)}")
|
|
@@ -1218,6 +1229,7 @@ class Agent(BaseAgent):
|
|
|
1218
1229
|
self.agent_state.llm_config.context_window = (
|
|
1219
1230
|
LLM_MAX_TOKENS[self.model] if (self.model is not None and self.model in LLM_MAX_TOKENS) else LLM_MAX_TOKENS["DEFAULT"]
|
|
1220
1231
|
)
|
|
1232
|
+
|
|
1221
1233
|
summary = summarize_messages(agent_state=self.agent_state, message_sequence_to_summarize=message_sequence_to_summarize)
|
|
1222
1234
|
printd(f"Got summary: {summary}")
|
|
1223
1235
|
|
|
@@ -233,7 +233,7 @@ class AbstractClient(object):
|
|
|
233
233
|
def get_tool_id(self, name: str) -> Optional[str]:
|
|
234
234
|
raise NotImplementedError
|
|
235
235
|
|
|
236
|
-
def
|
|
236
|
+
def upsert_base_tools(self) -> List[Tool]:
|
|
237
237
|
raise NotImplementedError
|
|
238
238
|
|
|
239
239
|
def load_data(self, connector: DataConnector, source_name: str):
|
|
@@ -1466,7 +1466,7 @@ class RESTClient(AbstractClient):
|
|
|
1466
1466
|
raise ValueError(f"Failed to get tool: {response.text}")
|
|
1467
1467
|
return response.json()
|
|
1468
1468
|
|
|
1469
|
-
def
|
|
1469
|
+
def upsert_base_tools(self) -> List[Tool]:
|
|
1470
1470
|
response = requests.post(f"{self.base_url}/{self.api_prefix}/tools/add-base-tools/", headers=self.headers)
|
|
1471
1471
|
if response.status_code != 200:
|
|
1472
1472
|
raise ValueError(f"Failed to add base tools: {response.text}")
|
{letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/errors.py
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
+
from enum import Enum
|
|
2
3
|
from typing import TYPE_CHECKING, List, Optional, Union
|
|
3
4
|
|
|
4
5
|
# Avoid circular imports
|
|
@@ -6,9 +7,31 @@ if TYPE_CHECKING:
|
|
|
6
7
|
from letta.schemas.message import Message
|
|
7
8
|
|
|
8
9
|
|
|
10
|
+
class ErrorCode(Enum):
|
|
11
|
+
"""Enum for error codes used by client."""
|
|
12
|
+
|
|
13
|
+
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"
|
|
14
|
+
CONTEXT_WINDOW_EXCEEDED = "CONTEXT_WINDOW_EXCEEDED"
|
|
15
|
+
RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED"
|
|
16
|
+
|
|
17
|
+
|
|
9
18
|
class LettaError(Exception):
|
|
10
19
|
"""Base class for all Letta related errors."""
|
|
11
20
|
|
|
21
|
+
def __init__(self, message: str, code: Optional[ErrorCode] = None, details: dict = {}):
|
|
22
|
+
self.message = message
|
|
23
|
+
self.code = code
|
|
24
|
+
self.details = details
|
|
25
|
+
super().__init__(message)
|
|
26
|
+
|
|
27
|
+
def __str__(self) -> str:
|
|
28
|
+
if self.code:
|
|
29
|
+
return f"{self.code.value}: {self.message}"
|
|
30
|
+
return self.message
|
|
31
|
+
|
|
32
|
+
def __repr__(self) -> str:
|
|
33
|
+
return f"{self.__class__.__name__}(message='{self.message}', code='{self.code}', details={self.details})"
|
|
34
|
+
|
|
12
35
|
|
|
13
36
|
class LettaToolCreateError(LettaError):
|
|
14
37
|
"""Error raised when a tool cannot be created."""
|
|
@@ -16,10 +39,7 @@ class LettaToolCreateError(LettaError):
|
|
|
16
39
|
default_error_message = "Error creating tool."
|
|
17
40
|
|
|
18
41
|
def __init__(self, message=None):
|
|
19
|
-
|
|
20
|
-
message = self.default_error_message
|
|
21
|
-
self.message = message
|
|
22
|
-
super().__init__(self.message)
|
|
42
|
+
super().__init__(message=message or self.default_error_message)
|
|
23
43
|
|
|
24
44
|
|
|
25
45
|
class LettaConfigurationError(LettaError):
|
|
@@ -27,23 +47,17 @@ class LettaConfigurationError(LettaError):
|
|
|
27
47
|
|
|
28
48
|
def __init__(self, message: str, missing_fields: Optional[List[str]] = None):
|
|
29
49
|
self.missing_fields = missing_fields or []
|
|
30
|
-
super().__init__(message)
|
|
50
|
+
super().__init__(message=message, details={"missing_fields": self.missing_fields})
|
|
31
51
|
|
|
32
52
|
|
|
33
53
|
class LettaAgentNotFoundError(LettaError):
|
|
34
54
|
"""Error raised when an agent is not found."""
|
|
35
|
-
|
|
36
|
-
def __init__(self, message: str):
|
|
37
|
-
self.message = message
|
|
38
|
-
super().__init__(self.message)
|
|
55
|
+
pass
|
|
39
56
|
|
|
40
57
|
|
|
41
58
|
class LettaUserNotFoundError(LettaError):
|
|
42
59
|
"""Error raised when a user is not found."""
|
|
43
|
-
|
|
44
|
-
def __init__(self, message: str):
|
|
45
|
-
self.message = message
|
|
46
|
-
super().__init__(self.message)
|
|
60
|
+
pass
|
|
47
61
|
|
|
48
62
|
|
|
49
63
|
class LLMError(LettaError):
|
|
@@ -54,24 +68,45 @@ class LLMJSONParsingError(LettaError):
|
|
|
54
68
|
"""Exception raised for errors in the JSON parsing process."""
|
|
55
69
|
|
|
56
70
|
def __init__(self, message="Error parsing JSON generated by LLM"):
|
|
57
|
-
|
|
58
|
-
super().__init__(self.message)
|
|
71
|
+
super().__init__(message=message)
|
|
59
72
|
|
|
60
73
|
|
|
61
74
|
class LocalLLMError(LettaError):
|
|
62
75
|
"""Generic catch-all error for local LLM problems"""
|
|
63
76
|
|
|
64
77
|
def __init__(self, message="Encountered an error while running local LLM"):
|
|
65
|
-
|
|
66
|
-
super().__init__(self.message)
|
|
78
|
+
super().__init__(message=message)
|
|
67
79
|
|
|
68
80
|
|
|
69
81
|
class LocalLLMConnectionError(LettaError):
|
|
70
82
|
"""Error for when local LLM cannot be reached with provided IP/port"""
|
|
71
83
|
|
|
72
84
|
def __init__(self, message="Could not connect to local LLM"):
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
super().__init__(message=message)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class ContextWindowExceededError(LettaError):
|
|
89
|
+
"""Error raised when the context window is exceeded but further summarization fails."""
|
|
90
|
+
|
|
91
|
+
def __init__(self, message: str, details: dict = {}):
|
|
92
|
+
error_message = f"{message} ({details})"
|
|
93
|
+
super().__init__(
|
|
94
|
+
message=error_message,
|
|
95
|
+
code=ErrorCode.CONTEXT_WINDOW_EXCEEDED,
|
|
96
|
+
details=details,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class RateLimitExceededError(LettaError):
|
|
101
|
+
"""Error raised when the llm rate limiter throttles api requests."""
|
|
102
|
+
|
|
103
|
+
def __init__(self, message: str, max_retries: int):
|
|
104
|
+
error_message = f"{message} ({max_retries})"
|
|
105
|
+
super().__init__(
|
|
106
|
+
message=error_message,
|
|
107
|
+
code=ErrorCode.RATE_LIMIT_EXCEEDED,
|
|
108
|
+
details={"max_retries": max_retries},
|
|
109
|
+
)
|
|
75
110
|
|
|
76
111
|
|
|
77
112
|
class LettaMessageError(LettaError):
|
|
@@ -61,60 +61,6 @@ def conversation_search(self: "Agent", query: str, page: Optional[int] = 0) -> O
|
|
|
61
61
|
return results_str
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
def conversation_search_date(self: "Agent", start_date: str, end_date: str, page: Optional[int] = 0) -> Optional[str]:
|
|
65
|
-
"""
|
|
66
|
-
Search prior conversation history using a date range.
|
|
67
|
-
|
|
68
|
-
Args:
|
|
69
|
-
start_date (str): The start of the date range to search, in the format 'YYYY-MM-DD'.
|
|
70
|
-
end_date (str): The end of the date range to search, in the format 'YYYY-MM-DD'.
|
|
71
|
-
page (int): Allows you to page through results. Only use on a follow-up query. Defaults to 0 (first page).
|
|
72
|
-
|
|
73
|
-
Returns:
|
|
74
|
-
str: Query result string
|
|
75
|
-
"""
|
|
76
|
-
import math
|
|
77
|
-
from datetime import datetime
|
|
78
|
-
|
|
79
|
-
from letta.constants import RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
|
|
80
|
-
from letta.utils import json_dumps
|
|
81
|
-
|
|
82
|
-
if page is None or (isinstance(page, str) and page.lower().strip() == "none"):
|
|
83
|
-
page = 0
|
|
84
|
-
try:
|
|
85
|
-
page = int(page)
|
|
86
|
-
if page < 0:
|
|
87
|
-
raise ValueError
|
|
88
|
-
except:
|
|
89
|
-
raise ValueError(f"'page' argument must be an integer")
|
|
90
|
-
|
|
91
|
-
# Convert date strings to datetime objects
|
|
92
|
-
try:
|
|
93
|
-
start_datetime = datetime.strptime(start_date, "%Y-%m-%d").replace(hour=0, minute=0, second=0, microsecond=0)
|
|
94
|
-
end_datetime = datetime.strptime(end_date, "%Y-%m-%d").replace(hour=23, minute=59, second=59, microsecond=999999)
|
|
95
|
-
except ValueError:
|
|
96
|
-
raise ValueError("Dates must be in the format 'YYYY-MM-DD'")
|
|
97
|
-
|
|
98
|
-
count = RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
|
|
99
|
-
results = self.message_manager.list_user_messages_for_agent(
|
|
100
|
-
# TODO: add paging by page number. currently cursor only works with strings.
|
|
101
|
-
agent_id=self.agent_state.id,
|
|
102
|
-
actor=self.user,
|
|
103
|
-
start_date=start_datetime,
|
|
104
|
-
end_date=end_datetime,
|
|
105
|
-
limit=count,
|
|
106
|
-
)
|
|
107
|
-
total = len(results)
|
|
108
|
-
num_pages = math.ceil(total / count) - 1 # 0 index
|
|
109
|
-
if len(results) == 0:
|
|
110
|
-
results_str = f"No results found."
|
|
111
|
-
else:
|
|
112
|
-
results_pref = f"Showing {len(results)} of {total} results (page {page}/{num_pages}):"
|
|
113
|
-
results_formatted = [f"timestamp: {d['timestamp']}, {d['message']['role']} - {d['message']['content']}" for d in results]
|
|
114
|
-
results_str = f"{results_pref} {json_dumps(results_formatted)}"
|
|
115
|
-
return results_str
|
|
116
|
-
|
|
117
|
-
|
|
118
64
|
def archival_memory_insert(self: "Agent", content: str) -> Optional[str]:
|
|
119
65
|
"""
|
|
120
66
|
Add to archival memory. Make sure to phrase the memory contents such that it can be easily queried later.
|
|
@@ -5,7 +5,7 @@ from typing import List, Optional, Union
|
|
|
5
5
|
import requests
|
|
6
6
|
|
|
7
7
|
from letta.constants import CLI_WARNING_PREFIX
|
|
8
|
-
from letta.errors import LettaConfigurationError
|
|
8
|
+
from letta.errors import LettaConfigurationError, RateLimitExceededError
|
|
9
9
|
from letta.llm_api.anthropic import anthropic_chat_completions_request
|
|
10
10
|
from letta.llm_api.azure_openai import azure_openai_chat_completions_request
|
|
11
11
|
from letta.llm_api.google_ai import (
|
|
@@ -80,7 +80,7 @@ def retry_with_exponential_backoff(
|
|
|
80
80
|
|
|
81
81
|
# Check if max retries has been reached
|
|
82
82
|
if num_retries > max_retries:
|
|
83
|
-
raise
|
|
83
|
+
raise RateLimitExceededError("Maximum number of retries exceeded", max_retries=max_retries)
|
|
84
84
|
|
|
85
85
|
# Increment the delay
|
|
86
86
|
delay *= exponential_base * (1 + jitter * random.random())
|
{letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/message.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
|
|
3
|
+
from sqlalchemy import Index
|
|
3
4
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
4
5
|
|
|
5
6
|
from letta.orm.custom_columns import ToolCallColumn
|
|
@@ -13,7 +14,7 @@ class Message(SqlalchemyBase, OrganizationMixin, AgentMixin):
|
|
|
13
14
|
"""Defines data model for storing Message objects"""
|
|
14
15
|
|
|
15
16
|
__tablename__ = "messages"
|
|
16
|
-
__table_args__ =
|
|
17
|
+
__table_args__ = (Index("ix_messages_agent_created_at", "agent_id", "created_at"),)
|
|
17
18
|
__pydantic_model__ = PydanticMessage
|
|
18
19
|
|
|
19
20
|
id: Mapped[str] = mapped_column(primary_key=True, doc="Unique message identifier")
|
{letta_nightly-0.6.5.dev20241218104144 → letta_nightly-0.6.5.dev20241219104153}/letta/orm/passage.py
RENAMED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
from typing import TYPE_CHECKING
|
|
2
|
-
from sqlalchemy import Column, JSON, Index
|
|
3
|
-
from sqlalchemy.orm import Mapped, mapped_column, relationship, declared_attr
|
|
4
2
|
|
|
5
|
-
from
|
|
3
|
+
from sqlalchemy import JSON, Column, Index
|
|
4
|
+
from sqlalchemy.orm import Mapped, declared_attr, mapped_column, relationship
|
|
5
|
+
|
|
6
|
+
from letta.config import LettaConfig
|
|
7
|
+
from letta.constants import MAX_EMBEDDING_DIM
|
|
6
8
|
from letta.orm.custom_columns import CommonVector, EmbeddingConfigColumn
|
|
7
|
-
from letta.orm.sqlalchemy_base import SqlalchemyBase
|
|
8
9
|
from letta.orm.mixins import AgentMixin, FileMixin, OrganizationMixin, SourceMixin
|
|
10
|
+
from letta.orm.sqlalchemy_base import SqlalchemyBase
|
|
9
11
|
from letta.schemas.passage import Passage as PydanticPassage
|
|
10
12
|
from letta.settings import settings
|
|
11
13
|
|
|
12
|
-
from letta.config import LettaConfig
|
|
13
|
-
from letta.constants import MAX_EMBEDDING_DIM
|
|
14
|
-
|
|
15
14
|
config = LettaConfig()
|
|
16
15
|
|
|
17
16
|
if TYPE_CHECKING:
|
|
18
|
-
from letta.orm.organization import Organization
|
|
19
17
|
from letta.orm.agent import Agent
|
|
18
|
+
from letta.orm.organization import Organization
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
class BasePassage(SqlalchemyBase, OrganizationMixin):
|
|
23
22
|
"""Base class for all passage types with common fields"""
|
|
23
|
+
|
|
24
24
|
__abstract__ = True
|
|
25
25
|
__pydantic_model__ = PydanticPassage
|
|
26
26
|
|
|
@@ -45,17 +45,15 @@ class BasePassage(SqlalchemyBase, OrganizationMixin):
|
|
|
45
45
|
@declared_attr
|
|
46
46
|
def __table_args__(cls):
|
|
47
47
|
if settings.letta_pg_uri_no_default:
|
|
48
|
-
return (
|
|
49
|
-
Index(f'{cls.__tablename__}_org_idx', 'organization_id'),
|
|
50
|
-
{"extend_existing": True}
|
|
51
|
-
)
|
|
48
|
+
return (Index(f"{cls.__tablename__}_org_idx", "organization_id"), {"extend_existing": True})
|
|
52
49
|
return ({"extend_existing": True},)
|
|
53
50
|
|
|
54
51
|
|
|
55
52
|
class SourcePassage(BasePassage, FileMixin, SourceMixin):
|
|
56
53
|
"""Passages derived from external files/sources"""
|
|
54
|
+
|
|
57
55
|
__tablename__ = "source_passages"
|
|
58
|
-
|
|
56
|
+
|
|
59
57
|
@declared_attr
|
|
60
58
|
def file(cls) -> Mapped["FileMetadata"]:
|
|
61
59
|
"""Relationship to file"""
|
|
@@ -64,7 +62,7 @@ class SourcePassage(BasePassage, FileMixin, SourceMixin):
|
|
|
64
62
|
@declared_attr
|
|
65
63
|
def organization(cls) -> Mapped["Organization"]:
|
|
66
64
|
return relationship("Organization", back_populates="source_passages", lazy="selectin")
|
|
67
|
-
|
|
65
|
+
|
|
68
66
|
@declared_attr
|
|
69
67
|
def source(cls) -> Mapped["Source"]:
|
|
70
68
|
"""Relationship to source"""
|
|
@@ -73,8 +71,9 @@ class SourcePassage(BasePassage, FileMixin, SourceMixin):
|
|
|
73
71
|
|
|
74
72
|
class AgentPassage(BasePassage, AgentMixin):
|
|
75
73
|
"""Passages created by agents as archival memories"""
|
|
74
|
+
|
|
76
75
|
__tablename__ = "agent_passages"
|
|
77
|
-
|
|
76
|
+
|
|
78
77
|
@declared_attr
|
|
79
78
|
def organization(cls) -> Mapped["Organization"]:
|
|
80
79
|
return relationship("Organization", back_populates="agent_passages", lazy="selectin")
|
|
@@ -17,6 +17,7 @@ from fastapi.responses import JSONResponse, StreamingResponse
|
|
|
17
17
|
from pydantic import Field
|
|
18
18
|
|
|
19
19
|
from letta.constants import DEFAULT_MESSAGE_TOOL, DEFAULT_MESSAGE_TOOL_KWARG
|
|
20
|
+
from letta.log import get_logger
|
|
20
21
|
from letta.orm.errors import NoResultFound
|
|
21
22
|
from letta.schemas.agent import AgentState, CreateAgent, UpdateAgent
|
|
22
23
|
from letta.schemas.block import ( # , BlockLabelUpdate, BlockLimitUpdate
|
|
@@ -54,6 +55,8 @@ from letta.server.server import SyncServer
|
|
|
54
55
|
|
|
55
56
|
router = APIRouter(prefix="/agents", tags=["agents"])
|
|
56
57
|
|
|
58
|
+
logger = get_logger(__name__)
|
|
59
|
+
|
|
57
60
|
|
|
58
61
|
# TODO: This should be paginated
|
|
59
62
|
@router.get("/", response_model=List[AgentState], operation_id="list_agents")
|
|
@@ -453,6 +456,13 @@ def get_agent_messages(
|
|
|
453
456
|
"""
|
|
454
457
|
actor = server.user_manager.get_user_or_default(user_id=user_id)
|
|
455
458
|
|
|
459
|
+
# TODO: Temporary debugging logs for debugging very slow endpoint
|
|
460
|
+
import uuid
|
|
461
|
+
|
|
462
|
+
temp_rand_uuid = uuid.uuid4()
|
|
463
|
+
|
|
464
|
+
logger.info(f"[{temp_rand_uuid}] RECEIVED GET /messages for agent_id={agent_id} before={before} limit={limit}")
|
|
465
|
+
|
|
456
466
|
return server.get_agent_recall_cursor(
|
|
457
467
|
user_id=actor.id,
|
|
458
468
|
agent_id=agent_id,
|
|
@@ -462,6 +472,7 @@ def get_agent_messages(
|
|
|
462
472
|
return_message_object=msg_object,
|
|
463
473
|
assistant_message_tool_name=assistant_message_tool_name,
|
|
464
474
|
assistant_message_tool_kwarg=assistant_message_tool_kwarg,
|
|
475
|
+
temp_rand_uuid=temp_rand_uuid,
|
|
465
476
|
)
|
|
466
477
|
|
|
467
478
|
|
|
@@ -152,30 +152,15 @@ def update_tool(
|
|
|
152
152
|
|
|
153
153
|
|
|
154
154
|
@router.post("/add-base-tools", response_model=List[Tool], operation_id="add_base_tools")
|
|
155
|
-
def
|
|
155
|
+
def upsert_base_tools(
|
|
156
156
|
server: SyncServer = Depends(get_letta_server),
|
|
157
157
|
user_id: Optional[str] = Header(None, alias="user_id"), # Extract user_id from header, default to None if not present
|
|
158
158
|
):
|
|
159
159
|
"""
|
|
160
|
-
|
|
160
|
+
Upsert base tools
|
|
161
161
|
"""
|
|
162
162
|
actor = server.user_manager.get_user_or_default(user_id=user_id)
|
|
163
|
-
return server.tool_manager.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
# NOTE: can re-enable if needed
|
|
167
|
-
# @router.post("/{tool_id}/run", response_model=FunctionReturn, operation_id="run_tool")
|
|
168
|
-
# def run_tool(
|
|
169
|
-
# server: SyncServer = Depends(get_letta_server),
|
|
170
|
-
# request: ToolRun = Body(...),
|
|
171
|
-
# user_id: Optional[str] = Header(None, alias="user_id"), # Extract user_id from header, default to None if not present
|
|
172
|
-
# ):
|
|
173
|
-
# """
|
|
174
|
-
# Run an existing tool on provided arguments
|
|
175
|
-
# """
|
|
176
|
-
# actor = server.user_manager.get_user_or_default(user_id=user_id)
|
|
177
|
-
|
|
178
|
-
# return server.run_tool(tool_id=request.tool_id, tool_args=request.tool_args, user_id=actor.id)
|
|
163
|
+
return server.tool_manager.upsert_base_tools(actor=actor)
|
|
179
164
|
|
|
180
165
|
|
|
181
166
|
@router.post("/run", response_model=FunctionReturn, operation_id="run_tool_from_source")
|
|
@@ -8,6 +8,7 @@ from typing import AsyncGenerator, Optional, Union
|
|
|
8
8
|
from fastapi import Header
|
|
9
9
|
from pydantic import BaseModel
|
|
10
10
|
|
|
11
|
+
from letta.errors import ContextWindowExceededError, RateLimitExceededError
|
|
11
12
|
from letta.schemas.usage import LettaUsageStatistics
|
|
12
13
|
from letta.server.rest_api.interface import StreamingServerInterface
|
|
13
14
|
from letta.server.server import SyncServer
|
|
@@ -61,34 +62,21 @@ async def sse_async_generator(
|
|
|
61
62
|
if not isinstance(usage, LettaUsageStatistics):
|
|
62
63
|
raise ValueError(f"Expected LettaUsageStatistics, got {type(usage)}")
|
|
63
64
|
yield sse_formatter({"usage": usage.model_dump()})
|
|
64
|
-
except Exception as e:
|
|
65
|
-
import traceback
|
|
66
|
-
|
|
67
|
-
traceback.print_exc()
|
|
68
|
-
warnings.warn(f"SSE stream generator failed: {e}")
|
|
69
65
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
import sentry_sdk
|
|
66
|
+
except ContextWindowExceededError as e:
|
|
67
|
+
log_error_to_sentry(e)
|
|
68
|
+
yield sse_formatter({"error": f"Stream failed: {e}", "code": str(e.code.value) if e.code else None})
|
|
74
69
|
|
|
75
|
-
|
|
70
|
+
except RateLimitExceededError as e:
|
|
71
|
+
log_error_to_sentry(e)
|
|
72
|
+
yield sse_formatter({"error": f"Stream failed: {e}", "code": str(e.code.value) if e.code else None})
|
|
76
73
|
|
|
74
|
+
except Exception as e:
|
|
75
|
+
log_error_to_sentry(e)
|
|
77
76
|
yield sse_formatter({"error": f"Stream failed (internal error occured)"})
|
|
78
77
|
|
|
79
78
|
except Exception as e:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
traceback.print_exc()
|
|
83
|
-
warnings.warn(f"SSE stream generator failed: {e}")
|
|
84
|
-
|
|
85
|
-
# Log the error, since the exception handler upstack (in FastAPI) won't catch it, because this may be a 200 response
|
|
86
|
-
# Print the stack trace
|
|
87
|
-
if (os.getenv("SENTRY_DSN") is not None) and (os.getenv("SENTRY_DSN") != ""):
|
|
88
|
-
import sentry_sdk
|
|
89
|
-
|
|
90
|
-
sentry_sdk.capture_exception(e)
|
|
91
|
-
|
|
79
|
+
log_error_to_sentry(e)
|
|
92
80
|
yield sse_formatter({"error": "Stream failed (decoder encountered an error)"})
|
|
93
81
|
|
|
94
82
|
finally:
|
|
@@ -113,3 +101,16 @@ def get_user_id(user_id: Optional[str] = Header(None, alias="user_id")) -> Optio
|
|
|
113
101
|
|
|
114
102
|
def get_current_interface() -> StreamingServerInterface:
|
|
115
103
|
return StreamingServerInterface
|
|
104
|
+
|
|
105
|
+
def log_error_to_sentry(e):
|
|
106
|
+
import traceback
|
|
107
|
+
|
|
108
|
+
traceback.print_exc()
|
|
109
|
+
warnings.warn(f"SSE stream generator failed: {e}")
|
|
110
|
+
|
|
111
|
+
# Log the error, since the exception handler upstack (in FastAPI) won't catch it, because this may be a 200 response
|
|
112
|
+
# Print the stack trace
|
|
113
|
+
if (os.getenv("SENTRY_DSN") is not None) and (os.getenv("SENTRY_DSN") != ""):
|
|
114
|
+
import sentry_sdk
|
|
115
|
+
|
|
116
|
+
sentry_sdk.capture_exception(e)
|
|
@@ -301,7 +301,7 @@ class SyncServer(Server):
|
|
|
301
301
|
self.default_org = self.organization_manager.create_default_organization()
|
|
302
302
|
self.default_user = self.user_manager.create_default_user()
|
|
303
303
|
self.block_manager.add_default_blocks(actor=self.default_user)
|
|
304
|
-
self.tool_manager.
|
|
304
|
+
self.tool_manager.upsert_base_tools(actor=self.default_user)
|
|
305
305
|
|
|
306
306
|
# If there is a default org/user
|
|
307
307
|
# This logic may have to change in the future
|
|
@@ -979,16 +979,32 @@ class SyncServer(Server):
|
|
|
979
979
|
return_message_object: bool = True,
|
|
980
980
|
assistant_message_tool_name: str = constants.DEFAULT_MESSAGE_TOOL,
|
|
981
981
|
assistant_message_tool_kwarg: str = constants.DEFAULT_MESSAGE_TOOL_KWARG,
|
|
982
|
+
temp_rand_uuid: Optional[str] = None,
|
|
982
983
|
) -> Union[List[Message], List[LettaMessage]]:
|
|
983
984
|
# TODO: Thread actor directly through this function, since the top level caller most likely already retrieved the user
|
|
985
|
+
import datetime
|
|
986
|
+
|
|
987
|
+
start_time = datetime.datetime.utcnow()
|
|
988
|
+
|
|
989
|
+
logger.info(
|
|
990
|
+
f"[{temp_rand_uuid}] {datetime.datetime.utcnow()} - Fetching actor for user_id={user_id} (Elapsed: {(datetime.datetime.utcnow() - start_time).total_seconds()}s)"
|
|
991
|
+
)
|
|
984
992
|
actor = self.user_manager.get_user_or_default(user_id=user_id)
|
|
985
993
|
|
|
986
|
-
|
|
994
|
+
logger.info(
|
|
995
|
+
f"[{temp_rand_uuid}] {datetime.datetime.utcnow()} - Loading agent object for agent_id={agent_id} (Elapsed: {(datetime.datetime.utcnow() - start_time).total_seconds()}s)"
|
|
996
|
+
)
|
|
987
997
|
letta_agent = self.load_agent(agent_id=agent_id, actor=actor)
|
|
988
998
|
|
|
989
|
-
|
|
999
|
+
logger.info(
|
|
1000
|
+
f"[{temp_rand_uuid}] {datetime.datetime.utcnow()} - Resolving start_date and end_date for filtering messages (Elapsed: {(datetime.datetime.utcnow() - start_time).total_seconds()}s)"
|
|
1001
|
+
)
|
|
990
1002
|
start_date = self.message_manager.get_message_by_id(after, actor=actor).created_at if after else None
|
|
991
1003
|
end_date = self.message_manager.get_message_by_id(before, actor=actor).created_at if before else None
|
|
1004
|
+
|
|
1005
|
+
logger.info(
|
|
1006
|
+
f"[{temp_rand_uuid}] {datetime.datetime.utcnow()} - Fetching messages for agent_id={agent_id}, start_date={start_date}, end_date={end_date}, limit={limit}, reverse={reverse} (Elapsed: {(datetime.datetime.utcnow() - start_time).total_seconds()}s)"
|
|
1007
|
+
)
|
|
992
1008
|
records = letta_agent.message_manager.list_messages_for_agent(
|
|
993
1009
|
agent_id=agent_id,
|
|
994
1010
|
actor=actor,
|
|
@@ -998,10 +1014,15 @@ class SyncServer(Server):
|
|
|
998
1014
|
ascending=not reverse,
|
|
999
1015
|
)
|
|
1000
1016
|
|
|
1017
|
+
logger.info(
|
|
1018
|
+
f"[{temp_rand_uuid}] {datetime.datetime.utcnow()} - Validating message types (Elapsed: {(datetime.datetime.utcnow() - start_time).total_seconds()}s)"
|
|
1019
|
+
)
|
|
1001
1020
|
assert all(isinstance(m, Message) for m in records)
|
|
1002
1021
|
|
|
1003
1022
|
if not return_message_object:
|
|
1004
|
-
|
|
1023
|
+
logger.info(
|
|
1024
|
+
f"[{temp_rand_uuid}] {datetime.datetime.utcnow()} - Converting messages to LettaMessage objects (Elapsed: {(datetime.datetime.utcnow() - start_time).total_seconds()}s)"
|
|
1025
|
+
)
|
|
1005
1026
|
records = [
|
|
1006
1027
|
msg
|
|
1007
1028
|
for m in records
|
|
@@ -1012,8 +1033,14 @@ class SyncServer(Server):
|
|
|
1012
1033
|
]
|
|
1013
1034
|
|
|
1014
1035
|
if reverse:
|
|
1036
|
+
logger.info(
|
|
1037
|
+
f"[{temp_rand_uuid}] {datetime.datetime.utcnow()} - Reversing message order (Elapsed: {(datetime.datetime.utcnow() - start_time).total_seconds()}s)"
|
|
1038
|
+
)
|
|
1015
1039
|
records = records[::-1]
|
|
1016
1040
|
|
|
1041
|
+
logger.info(
|
|
1042
|
+
f"[{temp_rand_uuid}] {datetime.datetime.utcnow()} - Returning {len(records)} messages (Elapsed: {(datetime.datetime.utcnow() - start_time).total_seconds()}s)"
|
|
1043
|
+
)
|
|
1017
1044
|
return records
|
|
1018
1045
|
|
|
1019
1046
|
def get_server_config(self, include_defaults: bool = False) -> dict:
|