letta-nightly 0.6.33.dev20250226104113__tar.gz → 0.6.34.dev20250227200331__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.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/PKG-INFO +1 -1
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/__init__.py +1 -1
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/agent.py +12 -2
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/llm_api_tools.py +58 -1
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/openai.py +19 -7
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/sqlalchemy_base.py +5 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/llm_config.py +2 -1
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/providers.py +67 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/chat_completions_interface.py +6 -26
- letta_nightly-0.6.34.dev20250227200331/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +142 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/__init__.py +2 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/agents.py +1 -1
- letta_nightly-0.6.33.dev20250226104113/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py → letta_nightly-0.6.34.dev20250227200331/letta/server/rest_api/routers/v1/voice.py +27 -137
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/utils.py +72 -19
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/server.py +5 -1
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/identity_manager.py +2 -2
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/settings.py +3 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/pyproject.toml +1 -1
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/LICENSE +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/README.md +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/__main__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/benchmark/benchmark.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/benchmark/constants.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/chat_only_agent.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/cli/cli.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/cli/cli_config.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/cli/cli_load.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/client/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/client/client.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/client/streaming.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/client/utils.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/config.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/constants.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/data_sources/connectors.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/data_sources/connectors_helper.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/embeddings.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/errors.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/functions/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/functions/ast_parsers.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/functions/function_sets/base.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/functions/function_sets/extras.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/functions/function_sets/multi_agent.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/functions/functions.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/functions/helpers.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/functions/interface.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/functions/schema_generator.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/helpers/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/helpers/composio_helpers.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/helpers/converters.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/helpers/datetime_helpers.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/helpers/json_helpers.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/helpers/tool_execution_helper.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/helpers/tool_rule_solver.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/humans/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/humans/examples/basic.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/humans/examples/cs_phd.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/interface.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/anthropic.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/aws_bedrock.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/azure_openai.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/azure_openai_constants.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/cohere.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/deepseek.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/google_ai.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/google_constants.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/google_vertex.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/helpers.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/llm_api/mistral.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/README.md +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/chat_completion_proxy.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/constants.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/function_parser.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/grammars/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/grammars/json.gbnf +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/json_parser.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/koboldcpp/api.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/koboldcpp/settings.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llamacpp/api.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llamacpp/settings.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/lmstudio/api.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/lmstudio/settings.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/ollama/api.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/ollama/settings.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/settings/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/settings/settings.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/settings/simple.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/utils.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/vllm/api.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/webui/api.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/webui/legacy_api.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/webui/legacy_settings.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/local_llm/webui/settings.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/log.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/main.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/memory.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/offline_memory_agent.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/openai_backcompat/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/openai_backcompat/openai_object.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/__all__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/agent.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/agents_tags.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/base.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/block.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/blocks_agents.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/custom_columns.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/enums.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/errors.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/file.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/identities_agents.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/identity.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/job.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/job_messages.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/message.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/mixins.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/organization.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/passage.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/provider.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/sandbox_config.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/source.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/sources_agents.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/sqlite_functions.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/step.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/tool.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/tools_agents.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/orm/user.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/examples/anna_pa.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/examples/google_search_persona.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/examples/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/examples/memgpt_starter.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/examples/o1_persona.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/examples/offline_memory_persona.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/examples/sam.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/examples/sam_pov.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/personas/examples/sqldb/test.db +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/gpt_summarize.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/gpt_system.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_base.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_chat.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_convo_only.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/pytest.ini +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/agent.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/block.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/embedding_config.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/embedding_config_overrides.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/enums.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/environment_variables.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/file.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/health.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/identity.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/job.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/letta_base.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/letta_message.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/letta_request.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/letta_response.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/llm_config_overrides.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/memory.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/message.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/openai/chat_completion_request.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/openai/chat_completion_response.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/openai/chat_completions.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/openai/embedding_response.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/openai/openai.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/organization.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/passage.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/run.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/sandbox_config.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/source.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/step.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/tool.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/tool_rule.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/usage.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/schemas/user.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/serialize_schemas/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/serialize_schemas/agent.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/serialize_schemas/base.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/serialize_schemas/custom_fields.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/serialize_schemas/message.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/constants.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/db.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/generate_openapi_schema.sh +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/app.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/auth/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/auth/index.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/auth_token.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/interface.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/optimistic_json_parser.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/blocks.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/health.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/identities.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/jobs.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/llms.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/organizations.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/providers.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/runs.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/sources.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/steps.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/tags.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/tools.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/routers/v1/users.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/rest_api/static_files.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/startup.sh +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/static_files/assets/index-048c9598.js +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/static_files/assets/index-0e31b727.css +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/static_files/favicon.ico +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/static_files/index.html +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/utils.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/ws_api/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/ws_api/example_client.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/ws_api/interface.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/ws_api/protocol.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/server/ws_api/server.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/__init__.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/agent_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/block_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/helpers/agent_manager_helper.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/helpers/tool_execution_helper.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/job_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/message_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/organization_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/passage_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/per_agent_lock_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/provider_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/sandbox_config_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/source_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/step_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/tool_execution_sandbox.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/tool_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/services/user_manager.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/streaming_interface.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/streaming_utils.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/system.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/tracing.py +0 -0
- {letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/utils.py +0 -0
{letta_nightly-0.6.33.dev20250226104113 → letta_nightly-0.6.34.dev20250227200331}/letta/agent.py
RENAMED
|
@@ -832,7 +832,7 @@ class Agent(BaseAgent):
|
|
|
832
832
|
)
|
|
833
833
|
|
|
834
834
|
if current_total_tokens > summarizer_settings.memory_warning_threshold * int(self.agent_state.llm_config.context_window):
|
|
835
|
-
|
|
835
|
+
logger.warning(
|
|
836
836
|
f"{CLI_WARNING_PREFIX}last response total_tokens ({current_total_tokens}) > {summarizer_settings.memory_warning_threshold * int(self.agent_state.llm_config.context_window)}"
|
|
837
837
|
)
|
|
838
838
|
|
|
@@ -842,7 +842,7 @@ class Agent(BaseAgent):
|
|
|
842
842
|
self.agent_alerted_about_memory_pressure = True # it's up to the outer loop to handle this
|
|
843
843
|
|
|
844
844
|
else:
|
|
845
|
-
|
|
845
|
+
logger.info(
|
|
846
846
|
f"last response total_tokens ({current_total_tokens}) < {summarizer_settings.memory_warning_threshold * int(self.agent_state.llm_config.context_window)}"
|
|
847
847
|
)
|
|
848
848
|
|
|
@@ -892,6 +892,16 @@ class Agent(BaseAgent):
|
|
|
892
892
|
if is_context_overflow_error(e):
|
|
893
893
|
in_context_messages = self.agent_manager.get_in_context_messages(agent_id=self.agent_state.id, actor=self.user)
|
|
894
894
|
|
|
895
|
+
# TODO: this is a patch to resolve immediate issues, should be removed once the summarizer is fixes
|
|
896
|
+
if self.agent_state.message_buffer_autoclear:
|
|
897
|
+
# no calling the summarizer in this case
|
|
898
|
+
logger.error(
|
|
899
|
+
f"step() failed with an exception that looks like a context window overflow, but message buffer is set to autoclear, so skipping: '{str(e)}'"
|
|
900
|
+
)
|
|
901
|
+
raise e
|
|
902
|
+
|
|
903
|
+
summarize_attempt_count += 1
|
|
904
|
+
|
|
895
905
|
if summarize_attempt_count <= summarizer_settings.max_summarizer_retries:
|
|
896
906
|
logger.warning(
|
|
897
907
|
f"context window exceeded with limit {self.agent_state.llm_config.context_window}, attempting to summarize ({summarize_attempt_count}/{summarizer_settings.max_summarizer_retries}"
|
|
@@ -187,8 +187,65 @@ def create(
|
|
|
187
187
|
function_call = "required"
|
|
188
188
|
|
|
189
189
|
data = build_openai_chat_completions_request(
|
|
190
|
-
llm_config,
|
|
190
|
+
llm_config,
|
|
191
|
+
messages,
|
|
192
|
+
user_id,
|
|
193
|
+
functions,
|
|
194
|
+
function_call,
|
|
195
|
+
use_tool_naming,
|
|
196
|
+
put_inner_thoughts_first=put_inner_thoughts_first,
|
|
197
|
+
use_structured_output=True, # NOTE: turn on all the time for OpenAI API
|
|
191
198
|
)
|
|
199
|
+
|
|
200
|
+
if stream: # Client requested token streaming
|
|
201
|
+
data.stream = True
|
|
202
|
+
assert isinstance(stream_interface, AgentChunkStreamingInterface) or isinstance(
|
|
203
|
+
stream_interface, AgentRefreshStreamingInterface
|
|
204
|
+
), type(stream_interface)
|
|
205
|
+
response = openai_chat_completions_process_stream(
|
|
206
|
+
url=llm_config.model_endpoint,
|
|
207
|
+
api_key=api_key,
|
|
208
|
+
chat_completion_request=data,
|
|
209
|
+
stream_interface=stream_interface,
|
|
210
|
+
)
|
|
211
|
+
else: # Client did not request token streaming (expect a blocking backend response)
|
|
212
|
+
data.stream = False
|
|
213
|
+
if isinstance(stream_interface, AgentChunkStreamingInterface):
|
|
214
|
+
stream_interface.stream_start()
|
|
215
|
+
try:
|
|
216
|
+
response = openai_chat_completions_request(
|
|
217
|
+
url=llm_config.model_endpoint,
|
|
218
|
+
api_key=api_key,
|
|
219
|
+
chat_completion_request=data,
|
|
220
|
+
)
|
|
221
|
+
finally:
|
|
222
|
+
if isinstance(stream_interface, AgentChunkStreamingInterface):
|
|
223
|
+
stream_interface.stream_end()
|
|
224
|
+
|
|
225
|
+
if llm_config.put_inner_thoughts_in_kwargs:
|
|
226
|
+
response = unpack_all_inner_thoughts_from_kwargs(response=response, inner_thoughts_key=INNER_THOUGHTS_KWARG)
|
|
227
|
+
|
|
228
|
+
return response
|
|
229
|
+
|
|
230
|
+
elif llm_config.model_endpoint_type == "xai":
|
|
231
|
+
|
|
232
|
+
api_key = model_settings.xai_api_key
|
|
233
|
+
|
|
234
|
+
if function_call is None and functions is not None and len(functions) > 0:
|
|
235
|
+
# force function calling for reliability, see https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice
|
|
236
|
+
function_call = "required"
|
|
237
|
+
|
|
238
|
+
data = build_openai_chat_completions_request(
|
|
239
|
+
llm_config,
|
|
240
|
+
messages,
|
|
241
|
+
user_id,
|
|
242
|
+
functions,
|
|
243
|
+
function_call,
|
|
244
|
+
use_tool_naming,
|
|
245
|
+
put_inner_thoughts_first=put_inner_thoughts_first,
|
|
246
|
+
use_structured_output=False, # NOTE: not supported atm for xAI
|
|
247
|
+
)
|
|
248
|
+
|
|
192
249
|
if stream: # Client requested token streaming
|
|
193
250
|
data.stream = True
|
|
194
251
|
assert isinstance(stream_interface, AgentChunkStreamingInterface) or isinstance(
|
|
@@ -13,7 +13,7 @@ from letta.schemas.message import Message as _Message
|
|
|
13
13
|
from letta.schemas.message import MessageRole as _MessageRole
|
|
14
14
|
from letta.schemas.openai.chat_completion_request import ChatCompletionRequest
|
|
15
15
|
from letta.schemas.openai.chat_completion_request import FunctionCall as ToolFunctionChoiceFunctionCall
|
|
16
|
-
from letta.schemas.openai.chat_completion_request import Tool, ToolFunctionChoice, cast_message_to_subtype
|
|
16
|
+
from letta.schemas.openai.chat_completion_request import FunctionSchema, Tool, ToolFunctionChoice, cast_message_to_subtype
|
|
17
17
|
from letta.schemas.openai.chat_completion_response import (
|
|
18
18
|
ChatCompletionChunkResponse,
|
|
19
19
|
ChatCompletionResponse,
|
|
@@ -95,6 +95,7 @@ def build_openai_chat_completions_request(
|
|
|
95
95
|
function_call: Optional[str],
|
|
96
96
|
use_tool_naming: bool,
|
|
97
97
|
put_inner_thoughts_first: bool = True,
|
|
98
|
+
use_structured_output: bool = True,
|
|
98
99
|
) -> ChatCompletionRequest:
|
|
99
100
|
if functions and llm_config.put_inner_thoughts_in_kwargs:
|
|
100
101
|
# Special case for LM Studio backend since it needs extra guidance to force out the thoughts first
|
|
@@ -157,6 +158,16 @@ def build_openai_chat_completions_request(
|
|
|
157
158
|
data.user = str(uuid.UUID(int=0))
|
|
158
159
|
data.model = "memgpt-openai"
|
|
159
160
|
|
|
161
|
+
if use_structured_output and data.tools is not None and len(data.tools) > 0:
|
|
162
|
+
# Convert to structured output style (which has 'strict' and no optionals)
|
|
163
|
+
for tool in data.tools:
|
|
164
|
+
try:
|
|
165
|
+
# tool["function"] = convert_to_structured_output(tool["function"])
|
|
166
|
+
structured_output_version = convert_to_structured_output(tool.function.model_dump())
|
|
167
|
+
tool.function = FunctionSchema(**structured_output_version)
|
|
168
|
+
except ValueError as e:
|
|
169
|
+
warnings.warn(f"Failed to convert tool function to structured output, tool={tool}, error={e}")
|
|
170
|
+
|
|
160
171
|
return data
|
|
161
172
|
|
|
162
173
|
|
|
@@ -455,11 +466,12 @@ def prepare_openai_payload(chat_completion_request: ChatCompletionRequest):
|
|
|
455
466
|
data.pop("tools")
|
|
456
467
|
data.pop("tool_choice", None) # extra safe, should exist always (default="auto")
|
|
457
468
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
469
|
+
# # NOTE: move this out to wherever the ChatCompletionRequest is created
|
|
470
|
+
# if "tools" in data:
|
|
471
|
+
# for tool in data["tools"]:
|
|
472
|
+
# try:
|
|
473
|
+
# tool["function"] = convert_to_structured_output(tool["function"])
|
|
474
|
+
# except ValueError as e:
|
|
475
|
+
# warnings.warn(f"Failed to convert tool function to structured output, tool={tool}, error={e}")
|
|
464
476
|
|
|
465
477
|
return data
|
|
@@ -69,6 +69,7 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
|
69
69
|
join_model: Optional[Base] = None,
|
|
70
70
|
join_conditions: Optional[Union[Tuple, List]] = None,
|
|
71
71
|
identifier_keys: Optional[List[str]] = None,
|
|
72
|
+
identifier_id: Optional[str] = None,
|
|
72
73
|
**kwargs,
|
|
73
74
|
) -> List["SqlalchemyBase"]:
|
|
74
75
|
"""
|
|
@@ -147,6 +148,10 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
|
147
148
|
if identifier_keys and hasattr(cls, "identities"):
|
|
148
149
|
query = query.join(cls.identities).filter(cls.identities.property.mapper.class_.identifier_key.in_(identifier_keys))
|
|
149
150
|
|
|
151
|
+
# given the identifier_id, we can find within the agents table any agents that have the identifier_id in their identity_ids
|
|
152
|
+
if identifier_id and hasattr(cls, "identities"):
|
|
153
|
+
query = query.join(cls.identities).filter(cls.identities.property.mapper.class_.id == identifier_id)
|
|
154
|
+
|
|
150
155
|
# Apply filtering logic from kwargs
|
|
151
156
|
for key, value in kwargs.items():
|
|
152
157
|
if "." in key:
|
|
@@ -42,6 +42,7 @@ class LLMConfig(BaseModel):
|
|
|
42
42
|
"together", # completions endpoint
|
|
43
43
|
"bedrock",
|
|
44
44
|
"deepseek",
|
|
45
|
+
"xai",
|
|
45
46
|
] = Field(..., description="The endpoint type for the model.")
|
|
46
47
|
model_endpoint: Optional[str] = Field(None, description="The endpoint for the model.")
|
|
47
48
|
model_wrapper: Optional[str] = Field(None, description="The wrapper for the model.")
|
|
@@ -56,7 +57,7 @@ class LLMConfig(BaseModel):
|
|
|
56
57
|
description="The temperature to use when generating text with the model. A higher temperature will result in more random text.",
|
|
57
58
|
)
|
|
58
59
|
max_tokens: Optional[int] = Field(
|
|
59
|
-
|
|
60
|
+
4096,
|
|
60
61
|
description="The maximum number of tokens to generate. If not set, the model will use its default value.",
|
|
61
62
|
)
|
|
62
63
|
|
|
@@ -211,6 +211,63 @@ class OpenAIProvider(Provider):
|
|
|
211
211
|
return None
|
|
212
212
|
|
|
213
213
|
|
|
214
|
+
class xAIProvider(OpenAIProvider):
|
|
215
|
+
"""https://docs.x.ai/docs/api-reference"""
|
|
216
|
+
|
|
217
|
+
name: str = "xai"
|
|
218
|
+
api_key: str = Field(..., description="API key for the xAI/Grok API.")
|
|
219
|
+
base_url: str = Field("https://api.x.ai/v1", description="Base URL for the xAI/Grok API.")
|
|
220
|
+
|
|
221
|
+
def get_model_context_window_size(self, model_name: str) -> Optional[int]:
|
|
222
|
+
# xAI doesn't return context window in the model listing,
|
|
223
|
+
# so these are hardcoded from their website
|
|
224
|
+
if model_name == "grok-2-1212":
|
|
225
|
+
return 131072
|
|
226
|
+
else:
|
|
227
|
+
return None
|
|
228
|
+
|
|
229
|
+
def list_llm_models(self) -> List[LLMConfig]:
|
|
230
|
+
from letta.llm_api.openai import openai_get_model_list
|
|
231
|
+
|
|
232
|
+
response = openai_get_model_list(self.base_url, api_key=self.api_key)
|
|
233
|
+
|
|
234
|
+
if "data" in response:
|
|
235
|
+
data = response["data"]
|
|
236
|
+
else:
|
|
237
|
+
data = response
|
|
238
|
+
|
|
239
|
+
configs = []
|
|
240
|
+
for model in data:
|
|
241
|
+
assert "id" in model, f"xAI/Grok model missing 'id' field: {model}"
|
|
242
|
+
model_name = model["id"]
|
|
243
|
+
|
|
244
|
+
# In case xAI starts supporting it in the future:
|
|
245
|
+
if "context_length" in model:
|
|
246
|
+
context_window_size = model["context_length"]
|
|
247
|
+
else:
|
|
248
|
+
context_window_size = self.get_model_context_window_size(model_name)
|
|
249
|
+
|
|
250
|
+
if not context_window_size:
|
|
251
|
+
warnings.warn(f"Couldn't find context window size for model {model_name}")
|
|
252
|
+
continue
|
|
253
|
+
|
|
254
|
+
configs.append(
|
|
255
|
+
LLMConfig(
|
|
256
|
+
model=model_name,
|
|
257
|
+
model_endpoint_type="xai",
|
|
258
|
+
model_endpoint=self.base_url,
|
|
259
|
+
context_window=context_window_size,
|
|
260
|
+
handle=self.get_handle(model_name),
|
|
261
|
+
)
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
return configs
|
|
265
|
+
|
|
266
|
+
def list_embedding_models(self) -> List[EmbeddingConfig]:
|
|
267
|
+
# No embeddings supported
|
|
268
|
+
return []
|
|
269
|
+
|
|
270
|
+
|
|
214
271
|
class DeepSeekProvider(OpenAIProvider):
|
|
215
272
|
"""
|
|
216
273
|
DeepSeek ChatCompletions API is similar to OpenAI's reasoning API,
|
|
@@ -456,6 +513,13 @@ class AnthropicProvider(Provider):
|
|
|
456
513
|
warnings.warn(f"Couldn't find context window size for model {model['id']}, defaulting to 200,000")
|
|
457
514
|
model["context_window"] = 200000
|
|
458
515
|
|
|
516
|
+
max_tokens = 8192
|
|
517
|
+
if "claude-3-opus" in model["id"]:
|
|
518
|
+
max_tokens = 4096
|
|
519
|
+
if "claude-3-haiku" in model["id"]:
|
|
520
|
+
max_tokens = 4096
|
|
521
|
+
# TODO: set for 3-7 extended thinking mode
|
|
522
|
+
|
|
459
523
|
# We set this to false by default, because Anthropic can
|
|
460
524
|
# natively support <thinking> tags inside of content fields
|
|
461
525
|
# However, putting COT inside of tool calls can make it more
|
|
@@ -472,6 +536,7 @@ class AnthropicProvider(Provider):
|
|
|
472
536
|
context_window=model["context_window"],
|
|
473
537
|
handle=self.get_handle(model["id"]),
|
|
474
538
|
put_inner_thoughts_in_kwargs=inner_thoughts_in_kwargs,
|
|
539
|
+
max_tokens=max_tokens,
|
|
475
540
|
)
|
|
476
541
|
)
|
|
477
542
|
return configs
|
|
@@ -811,6 +876,7 @@ class GoogleAIProvider(Provider):
|
|
|
811
876
|
model_endpoint=self.base_url,
|
|
812
877
|
context_window=self.get_model_context_window(model),
|
|
813
878
|
handle=self.get_handle(model),
|
|
879
|
+
max_tokens=8192,
|
|
814
880
|
)
|
|
815
881
|
)
|
|
816
882
|
return configs
|
|
@@ -862,6 +928,7 @@ class GoogleVertexProvider(Provider):
|
|
|
862
928
|
model_endpoint=f"https://{self.google_cloud_location}-aiplatform.googleapis.com/v1/projects/{self.google_cloud_project}/locations/{self.google_cloud_location}",
|
|
863
929
|
context_window=context_length,
|
|
864
930
|
handle=self.get_handle(model),
|
|
931
|
+
max_tokens=8192,
|
|
865
932
|
)
|
|
866
933
|
)
|
|
867
934
|
return configs
|
|
@@ -225,10 +225,10 @@ class ChatCompletionsStreamingInterface(AgentChunkStreamingInterface):
|
|
|
225
225
|
combined_args = "".join(self.current_function_arguments)
|
|
226
226
|
parsed_args = OptimisticJSONParser().parse(combined_args)
|
|
227
227
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
self.
|
|
228
|
+
if parsed_args.get(self.assistant_message_tool_kwarg) and parsed_args.get(
|
|
229
|
+
self.assistant_message_tool_kwarg
|
|
230
|
+
) != self.current_json_parse_result.get(self.assistant_message_tool_kwarg):
|
|
231
|
+
self.current_json_parse_result = parsed_args
|
|
232
232
|
return ChatCompletionChunk(
|
|
233
233
|
id=chunk.id,
|
|
234
234
|
object=chunk.object,
|
|
@@ -237,31 +237,11 @@ class ChatCompletionsStreamingInterface(AgentChunkStreamingInterface):
|
|
|
237
237
|
choices=[
|
|
238
238
|
Choice(
|
|
239
239
|
index=choice.index,
|
|
240
|
-
delta=ChoiceDelta(),
|
|
241
|
-
finish_reason=
|
|
240
|
+
delta=ChoiceDelta(content=self.current_function_arguments[-1], role=self.ASSISTANT_STR),
|
|
241
|
+
finish_reason=None,
|
|
242
242
|
)
|
|
243
243
|
],
|
|
244
244
|
)
|
|
245
|
-
else:
|
|
246
|
-
# If the parsed result is different
|
|
247
|
-
# This is an edge case we need to consider. E.g. if the last streamed token is '}', we shouldn't stream that out
|
|
248
|
-
if parsed_args != self.current_json_parse_result:
|
|
249
|
-
self.current_json_parse_result = parsed_args
|
|
250
|
-
# If we can see a "message" field, return it as partial content
|
|
251
|
-
if self.assistant_message_tool_kwarg in parsed_args and parsed_args[self.assistant_message_tool_kwarg]:
|
|
252
|
-
return ChatCompletionChunk(
|
|
253
|
-
id=chunk.id,
|
|
254
|
-
object=chunk.object,
|
|
255
|
-
created=chunk.created.timestamp(),
|
|
256
|
-
model=chunk.model,
|
|
257
|
-
choices=[
|
|
258
|
-
Choice(
|
|
259
|
-
index=choice.index,
|
|
260
|
-
delta=ChoiceDelta(content=self.current_function_arguments[-1], role=self.ASSISTANT_STR),
|
|
261
|
-
finish_reason=None,
|
|
262
|
-
)
|
|
263
|
-
],
|
|
264
|
-
)
|
|
265
245
|
|
|
266
246
|
# If there's a finish reason, pass that along
|
|
267
247
|
if choice.finish_reason is not None:
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
from typing import TYPE_CHECKING, List, Optional, Union
|
|
3
|
+
|
|
4
|
+
from fastapi import APIRouter, Body, Depends, Header, HTTPException
|
|
5
|
+
from fastapi.responses import StreamingResponse
|
|
6
|
+
from openai.types.chat.completion_create_params import CompletionCreateParams
|
|
7
|
+
|
|
8
|
+
from letta.agent import Agent
|
|
9
|
+
from letta.constants import DEFAULT_MESSAGE_TOOL, DEFAULT_MESSAGE_TOOL_KWARG
|
|
10
|
+
from letta.log import get_logger
|
|
11
|
+
from letta.schemas.message import Message, MessageCreate
|
|
12
|
+
from letta.schemas.user import User
|
|
13
|
+
from letta.server.rest_api.chat_completions_interface import ChatCompletionsStreamingInterface
|
|
14
|
+
|
|
15
|
+
# TODO this belongs in a controller!
|
|
16
|
+
from letta.server.rest_api.utils import get_letta_server, get_messages_from_completion_request, sse_async_generator
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
from letta.server.server import SyncServer
|
|
20
|
+
|
|
21
|
+
router = APIRouter(prefix="/v1", tags=["chat_completions"])
|
|
22
|
+
|
|
23
|
+
logger = get_logger(__name__)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@router.post(
|
|
27
|
+
"/chat/completions",
|
|
28
|
+
response_model=None,
|
|
29
|
+
operation_id="create_chat_completions",
|
|
30
|
+
responses={
|
|
31
|
+
200: {
|
|
32
|
+
"description": "Successful response",
|
|
33
|
+
"content": {
|
|
34
|
+
"text/event-stream": {"description": "Server-Sent Events stream"},
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
)
|
|
39
|
+
async def create_chat_completions(
|
|
40
|
+
completion_request: CompletionCreateParams = Body(...),
|
|
41
|
+
server: "SyncServer" = Depends(get_letta_server),
|
|
42
|
+
user_id: Optional[str] = Header(None, alias="user_id"),
|
|
43
|
+
):
|
|
44
|
+
# Validate and process fields
|
|
45
|
+
messages = get_messages_from_completion_request(completion_request)
|
|
46
|
+
input_message = messages[-1]
|
|
47
|
+
|
|
48
|
+
# Process remaining fields
|
|
49
|
+
if not completion_request["stream"]:
|
|
50
|
+
raise HTTPException(status_code=400, detail="Must be streaming request: `stream` was set to `False` in the request.")
|
|
51
|
+
|
|
52
|
+
actor = server.user_manager.get_user_or_default(user_id=user_id)
|
|
53
|
+
|
|
54
|
+
agent_id = str(completion_request.get("user", None))
|
|
55
|
+
if agent_id is None:
|
|
56
|
+
error_msg = "Must pass agent_id in the 'user' field"
|
|
57
|
+
logger.error(error_msg)
|
|
58
|
+
raise HTTPException(status_code=400, detail=error_msg)
|
|
59
|
+
|
|
60
|
+
letta_agent = server.load_agent(agent_id=agent_id, actor=actor)
|
|
61
|
+
llm_config = letta_agent.agent_state.llm_config
|
|
62
|
+
if llm_config.model_endpoint_type != "openai" or "inference.memgpt.ai" in llm_config.model_endpoint:
|
|
63
|
+
error_msg = f"You can only use models with type 'openai' for chat completions. This agent {agent_id} has llm_config: \n{llm_config.model_dump_json(indent=4)}"
|
|
64
|
+
logger.error(error_msg)
|
|
65
|
+
raise HTTPException(status_code=400, detail=error_msg)
|
|
66
|
+
|
|
67
|
+
model = completion_request.get("model")
|
|
68
|
+
if model != llm_config.model:
|
|
69
|
+
warning_msg = f"The requested model {model} is different from the model specified in this agent's ({agent_id}) llm_config: \n{llm_config.model_dump_json(indent=4)}"
|
|
70
|
+
logger.warning(f"Defaulting to {llm_config.model}...")
|
|
71
|
+
logger.warning(warning_msg)
|
|
72
|
+
|
|
73
|
+
logger.info(f"Received input message: {input_message}")
|
|
74
|
+
|
|
75
|
+
return await send_message_to_agent_chat_completions(
|
|
76
|
+
server=server,
|
|
77
|
+
letta_agent=letta_agent,
|
|
78
|
+
actor=actor,
|
|
79
|
+
messages=[MessageCreate(role=input_message["role"], content=input_message["content"])],
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
async def send_message_to_agent_chat_completions(
|
|
84
|
+
server: "SyncServer",
|
|
85
|
+
letta_agent: Agent,
|
|
86
|
+
actor: User,
|
|
87
|
+
messages: Union[List[Message], List[MessageCreate]],
|
|
88
|
+
assistant_message_tool_name: str = DEFAULT_MESSAGE_TOOL,
|
|
89
|
+
assistant_message_tool_kwarg: str = DEFAULT_MESSAGE_TOOL_KWARG,
|
|
90
|
+
) -> StreamingResponse:
|
|
91
|
+
"""Split off into a separate function so that it can be imported in the /chat/completion proxy."""
|
|
92
|
+
# For streaming response
|
|
93
|
+
try:
|
|
94
|
+
# TODO: cleanup this logic
|
|
95
|
+
llm_config = letta_agent.agent_state.llm_config
|
|
96
|
+
|
|
97
|
+
# Create a new interface per request
|
|
98
|
+
letta_agent.interface = ChatCompletionsStreamingInterface()
|
|
99
|
+
streaming_interface = letta_agent.interface
|
|
100
|
+
if not isinstance(streaming_interface, ChatCompletionsStreamingInterface):
|
|
101
|
+
raise ValueError(f"Agent has wrong type of interface: {type(streaming_interface)}")
|
|
102
|
+
|
|
103
|
+
# Allow AssistantMessage is desired by client
|
|
104
|
+
streaming_interface.assistant_message_tool_name = assistant_message_tool_name
|
|
105
|
+
streaming_interface.assistant_message_tool_kwarg = assistant_message_tool_kwarg
|
|
106
|
+
|
|
107
|
+
# Related to JSON buffer reader
|
|
108
|
+
streaming_interface.inner_thoughts_in_kwargs = (
|
|
109
|
+
llm_config.put_inner_thoughts_in_kwargs if llm_config.put_inner_thoughts_in_kwargs is not None else False
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
# Offload the synchronous message_func to a separate thread
|
|
113
|
+
streaming_interface.stream_start()
|
|
114
|
+
asyncio.create_task(
|
|
115
|
+
asyncio.to_thread(
|
|
116
|
+
server.send_messages,
|
|
117
|
+
actor=actor,
|
|
118
|
+
agent_id=letta_agent.agent_state.id,
|
|
119
|
+
messages=messages,
|
|
120
|
+
interface=streaming_interface,
|
|
121
|
+
put_inner_thoughts_first=False,
|
|
122
|
+
)
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
# return a stream
|
|
126
|
+
return StreamingResponse(
|
|
127
|
+
sse_async_generator(
|
|
128
|
+
streaming_interface.get_generator(),
|
|
129
|
+
usage_task=None,
|
|
130
|
+
finish_message=True,
|
|
131
|
+
),
|
|
132
|
+
media_type="text/event-stream",
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
except HTTPException:
|
|
136
|
+
raise
|
|
137
|
+
except Exception as e:
|
|
138
|
+
print(e)
|
|
139
|
+
import traceback
|
|
140
|
+
|
|
141
|
+
traceback.print_exc()
|
|
142
|
+
raise HTTPException(status_code=500, detail=f"{e}")
|
|
@@ -11,6 +11,7 @@ from letta.server.rest_api.routers.v1.sources import router as sources_router
|
|
|
11
11
|
from letta.server.rest_api.routers.v1.steps import router as steps_router
|
|
12
12
|
from letta.server.rest_api.routers.v1.tags import router as tags_router
|
|
13
13
|
from letta.server.rest_api.routers.v1.tools import router as tools_router
|
|
14
|
+
from letta.server.rest_api.routers.v1.voice import router as voice_router
|
|
14
15
|
|
|
15
16
|
ROUTERS = [
|
|
16
17
|
tools_router,
|
|
@@ -26,4 +27,5 @@ ROUTERS = [
|
|
|
26
27
|
runs_router,
|
|
27
28
|
steps_router,
|
|
28
29
|
tags_router,
|
|
30
|
+
voice_router,
|
|
29
31
|
]
|
|
@@ -69,7 +69,6 @@ def list_agents(
|
|
|
69
69
|
"project_id": project_id,
|
|
70
70
|
"template_id": template_id,
|
|
71
71
|
"base_template_id": base_template_id,
|
|
72
|
-
"identifier_id": identifier_id,
|
|
73
72
|
}.items()
|
|
74
73
|
if value is not None
|
|
75
74
|
}
|
|
@@ -84,6 +83,7 @@ def list_agents(
|
|
|
84
83
|
tags=tags,
|
|
85
84
|
match_all_tags=match_all_tags,
|
|
86
85
|
identifier_keys=identifier_keys,
|
|
86
|
+
identifier_id=identifier_id,
|
|
87
87
|
**kwargs,
|
|
88
88
|
)
|
|
89
89
|
return agents
|