You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.0 KiB
Python

from __future__ import annotations
from typing import Any, Callable, List, Optional, TypedDict
class ConfigSelectItem(TypedDict):
label: str
value: Any
class PluginConfigParam(TypedDict):
id: str
type: str
name: str
description: str
default: Any
required: bool
min: Optional[float]
max: Optional[float]
options: Optional[list[ConfigSelectItem]]
class HookInfo(TypedDict):
id: str
name: str
description: str
class_: Callable
class BaseMessage(TypedDict):
role: str
content: str
function_call: Optional[Any]
tool_calls: Optional[list]
tool_call_id: Optional[str]
class LLMFunctionInfo(TypedDict):
name_for_llm: str
name_for_human: str
description: str
params: dict
class LLMFunctionResponse(TypedDict):
response: str
"""The response text generated by the function."""
direct_return: bool
"""Directly return the response to the user, without further processing."""
OnProgressCallback = Callable[[int, int], Any]