feat: Composio tools execute on-the-fly (#999)

This commit is contained in:
Matthew Zhou
2025-02-13 16:13:29 -08:00
committed by GitHub
parent 32f864d6f9
commit 8d765f286e
48 changed files with 335 additions and 295 deletions

View File

@@ -6,6 +6,8 @@ import requests
from letta.constants import CLI_WARNING_PREFIX
from letta.errors import LocalLLMConnectionError, LocalLLMError
from letta.helpers.datetime_helpers import get_utc_time
from letta.helpers.json_helpers import json_dumps
from letta.local_llm.constants import DEFAULT_WRAPPER
from letta.local_llm.function_parser import patch_function
from letta.local_llm.grammars.gbnf_grammar_generator import create_dynamic_model_from_function, generate_gbnf_grammar_and_documentation
@@ -20,7 +22,7 @@ from letta.local_llm.webui.api import get_webui_completion
from letta.local_llm.webui.legacy_api import get_webui_completion as get_webui_completion_legacy
from letta.prompts.gpt_summarize import SYSTEM as SUMMARIZE_SYSTEM_MESSAGE
from letta.schemas.openai.chat_completion_response import ChatCompletionResponse, Choice, Message, ToolCall, UsageStatistics
from letta.utils import get_tool_call_id, get_utc_time, json_dumps
from letta.utils import get_tool_call_id
has_shown_warning = False
grammar_supported_backends = ["koboldcpp", "llamacpp", "webui", "webui-legacy"]

View File

@@ -1,7 +1,7 @@
import copy
import json
from letta.utils import json_dumps, json_loads
from letta.helpers.json_helpers import json_dumps, json_loads
NO_HEARTBEAT_FUNCS = ["send_message"]

View File

@@ -10,7 +10,7 @@ from typing import Any, Callable, List, Optional, Tuple, Type, Union, _GenericAl
from docstring_parser import parse
from pydantic import BaseModel, create_model
from letta.utils import json_dumps
from letta.helpers.json_helpers import json_dumps
class PydanticDataType(Enum):

View File

@@ -2,7 +2,7 @@ import json
import re
from letta.errors import LLMJSONParsingError
from letta.utils import json_loads
from letta.helpers.json_helpers import json_loads
def clean_json_string_extra_backslash(s):

View File

@@ -1,6 +1,5 @@
from letta.utils import json_dumps, json_loads
from ...errors import LLMJSONParsingError
from ...helpers.json_helpers import json_dumps, json_loads
from ..json_parser import clean_json
from .wrapper_base import LLMChatCompletionWrapper

View File

@@ -1,8 +1,8 @@
from letta.errors import LLMJSONParsingError
from letta.helpers.json_helpers import json_dumps, json_loads
from letta.local_llm.json_parser import clean_json
from letta.local_llm.llm_chat_completion_wrappers.wrapper_base import LLMChatCompletionWrapper
from letta.schemas.enums import MessageRole
from letta.utils import json_dumps, json_loads
PREFIX_HINT = """# Reminders:
# Important information about yourself and the user is stored in (limited) core memory

View File

@@ -1,8 +1,7 @@
import yaml
from letta.utils import json_dumps, json_loads
from ...errors import LLMJSONParsingError
from ...helpers.json_helpers import json_dumps, json_loads
from ..json_parser import clean_json
from .wrapper_base import LLMChatCompletionWrapper

View File

@@ -1,6 +1,5 @@
from letta.utils import json_dumps, json_loads
from ...errors import LLMJSONParsingError
from ...helpers.json_helpers import json_dumps, json_loads
from ..json_parser import clean_json
from .wrapper_base import LLMChatCompletionWrapper

View File

@@ -1,7 +1,7 @@
from letta.errors import LLMJSONParsingError
from letta.helpers.json_helpers import json_dumps, json_loads
from letta.local_llm.json_parser import clean_json
from letta.local_llm.llm_chat_completion_wrappers.wrapper_base import LLMChatCompletionWrapper
from letta.utils import json_dumps, json_loads
PREFIX_HINT = """# Reminders:
# Important information about yourself and the user is stored in (limited) core memory

View File

@@ -1,5 +1,4 @@
from letta.utils import json_dumps, json_loads
from ...helpers.json_helpers import json_dumps, json_loads
from .wrapper_base import LLMChatCompletionWrapper

View File

@@ -1,6 +1,5 @@
from letta.utils import json_dumps, json_loads
from ...errors import LLMJSONParsingError
from ...helpers.json_helpers import json_dumps, json_loads
from ..json_parser import clean_json
from .wrapper_base import LLMChatCompletionWrapper