Skip to content

UI

fastagency.UI #

UI(uibase: UIBase, workflow_uuid: str)
Source code in fastagency/base.py
def __init__(self, uibase: UIBase, workflow_uuid: str) -> None:
    if workflow_uuid is None:
        logger.error("workflow_uuid must be provided")
        raise ValueError("workflow_uuid must be provided")
    self._ui_base = uibase
    self._workflow_uuid = workflow_uuid

ui_base property #

ui_base: UIBase

workflow_uuid property #

workflow_uuid: str

error #

error(
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    short: Optional[str] = None,
    long: Optional[str] = None,
) -> Optional[str]
Source code in fastagency/base.py
def error(
    self,
    # common parameters for all messages
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    # error specific parameters
    short: Optional[str] = None,
    long: Optional[str] = None,
) -> Optional[str]:
    return self._ui_base.error(
        workflow_uuid=self.workflow_uuid,
        sender=sender,
        recipient=recipient,
        auto_reply=auto_reply,
        uuid=uuid,
        short=short,
        long=long,
    )

function_call_execution #

function_call_execution(
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    function_name: Optional[str] = None,
    call_id: Optional[str] = None,
    retval: Any = None,
) -> Optional[str]
Source code in fastagency/base.py
def function_call_execution(
    self,
    # common parameters for all messages
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    # function_call_execution specific parameters
    function_name: Optional[str] = None,
    call_id: Optional[str] = None,
    retval: Any = None,
) -> Optional[str]:
    return self._ui_base.function_call_execution(
        workflow_uuid=self.workflow_uuid,
        sender=sender,
        recipient=recipient,
        auto_reply=auto_reply,
        uuid=uuid,
        function_name=function_name,
        call_id=call_id,
        retval=retval,
    )

keep_alive #

keep_alive(
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
) -> Optional[str]
Source code in fastagency/base.py
def keep_alive(
    self,
    # common parameters for all messages
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
) -> Optional[str]:
    return self._ui_base.keep_alive(
        workflow_uuid=self.workflow_uuid,
        sender=sender,
        recipient=recipient,
        auto_reply=auto_reply,
        uuid=uuid,
    )

multiple_choice #

multiple_choice(
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    prompt: Optional[str] = None,
    choices: Optional[list[str]] = None,
    default: Optional[str] = None,
    single: bool = True,
) -> Optional[str]
Source code in fastagency/base.py
def multiple_choice(
    self,
    # common parameters for all messages
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    # multiple_choice specific parameters
    prompt: Optional[str] = None,
    choices: Optional[list[str]] = None,
    default: Optional[str] = None,
    single: bool = True,
) -> Optional[str]:
    return self._ui_base.multiple_choice(
        workflow_uuid=self.workflow_uuid,
        sender=sender,
        recipient=recipient,
        auto_reply=auto_reply,
        uuid=uuid,
        prompt=prompt,
        choices=choices,
        default=default,
        single=single,
    )

process_message #

process_message(message: IOMessage) -> Optional[str]
Source code in fastagency/base.py
def process_message(self, message: IOMessage) -> Optional[str]:
    return self._ui_base.process_message(message)

suggested_function_call #

suggested_function_call(
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    function_name: Optional[str] = None,
    call_id: Optional[str] = None,
    arguments: Optional[dict[str, Any]] = None,
) -> Optional[str]
Source code in fastagency/base.py
def suggested_function_call(
    self,
    # common parameters for all messages
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    # suggested_function_call specific parameters
    function_name: Optional[str] = None,
    call_id: Optional[str] = None,
    arguments: Optional[dict[str, Any]] = None,
) -> Optional[str]:
    return self._ui_base.suggested_function_call(
        workflow_uuid=self.workflow_uuid,
        sender=sender,
        recipient=recipient,
        auto_reply=auto_reply,
        uuid=uuid,
        function_name=function_name,
        call_id=call_id,
        arguments=arguments,
    )

system_message #

system_message(
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    message: Optional[dict[str, Any]] = None,
) -> Optional[str]
Source code in fastagency/base.py
def system_message(
    self,
    # common parameters for all messages
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    # system_message specific parameters
    message: Optional[dict[str, Any]] = None,
) -> Optional[str]:
    return self._ui_base.system_message(
        workflow_uuid=self.workflow_uuid,
        sender=sender,
        recipient=recipient,
        auto_reply=auto_reply,
        uuid=uuid,
        message=message,
    )

text_input #

text_input(
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    prompt: Optional[str] = None,
    suggestions: Optional[list[str]] = None,
    password: bool = False,
) -> Optional[str]
Source code in fastagency/base.py
def text_input(
    self,
    # common parameters for all messages
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    # text_input specific parameters
    prompt: Optional[str] = None,
    suggestions: Optional[list[str]] = None,
    password: bool = False,
) -> Optional[str]:
    return self._ui_base.text_input(
        workflow_uuid=self.workflow_uuid,
        sender=sender,
        recipient=recipient,
        auto_reply=auto_reply,
        uuid=uuid,
        prompt=prompt,
        suggestions=suggestions,
        password=password,
    )

text_message #

text_message(
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    body: Optional[str] = None,
) -> Optional[str]
Source code in fastagency/base.py
def text_message(
    self,
    # common parameters for all messages
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    # text_message specific parameters
    body: Optional[str] = None,
) -> Optional[str]:
    return self._ui_base.text_message(
        workflow_uuid=self.workflow_uuid,
        sender=sender,
        recipient=recipient,
        auto_reply=auto_reply,
        uuid=uuid,
        body=body,
    )

workflow_completed #

workflow_completed(
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    result: Optional[str] = None,
) -> Optional[str]
Source code in fastagency/base.py
def workflow_completed(
    self,
    # common parameters for all messages
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    # workflow_completed specific parameters
    result: Optional[str] = None,
) -> Optional[str]:
    return self._ui_base.workflow_completed(
        workflow_uuid=self.workflow_uuid,
        sender=sender,
        recipient=recipient,
        auto_reply=auto_reply,
        uuid=uuid,
        result=result,
    )

workflow_started #

workflow_started(
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    name: Optional[str] = None,
    description: Optional[str] = None,
    params: Optional[dict[str, Any]] = None,
) -> Optional[str]
Source code in fastagency/base.py
def workflow_started(
    self,
    # common parameters for all messages
    sender: Optional[str] = None,
    recipient: Optional[str] = None,
    auto_reply: bool = False,
    uuid: Optional[str] = None,
    # workflow_started specific parameters
    name: Optional[str] = None,
    description: Optional[str] = None,
    params: Optional[dict[str, Any]] = None,
) -> Optional[str]:
    return self._ui_base.workflow_started(
        workflow_uuid=self.workflow_uuid,
        sender=sender,
        recipient=recipient,
        auto_reply=auto_reply,
        uuid=uuid,
        name=name,
        description=description,
        params=params,
    )