FastAPIAdapter
fastagency.adapters.fastapi.FastAPIAdapter #
FastAPIAdapter(
provider: ProviderProtocol,
*,
initiate_workflow_path: str = "/fastagency/initiate_workflow",
discovery_path: str = "/fastagency/discovery",
ws_path: str = "/fastagency/ws",
get_user_id: Optional[
Callable[..., Optional[str]]
] = None
)
Bases: MessageProcessorMixin
, CreateWorkflowUIMixin
Provider for FastAPI.
PARAMETER | DESCRIPTION |
---|---|
provider | The provider. TYPE: |
initiate_workflow_path | The initiate workflow path. Defaults to "/fastagency/initiate_workflow". TYPE: |
discovery_path | The discovery path. Defaults to "/fastagency/discovery". TYPE: |
ws_path | The websocket path. Defaults to "/fastagency/ws". TYPE: |
get_user_id | The get user id. Defaults to None. |
Source code in fastagency/adapters/fastapi/base.py
create #
create_provider classmethod
#
create_provider(fastapi_url: str) -> ProviderProtocol
create_workflow_ui #
error #
error(
workflow_uuid: str,
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/messages.py
function_call_execution #
function_call_execution(
workflow_uuid: str,
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/messages.py
get_user_id_websocket async
#
Source code in fastagency/adapters/fastapi/base.py
keep_alive #
keep_alive(
workflow_uuid: str,
sender: Optional[str] = None,
recipient: Optional[str] = None,
auto_reply: bool = False,
uuid: Optional[str] = None,
) -> Optional[str]
Source code in fastagency/messages.py
multiple_choice #
multiple_choice(
workflow_uuid: str,
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/messages.py
process_message #
Source code in fastagency/messages.py
setup_routes #
Source code in fastagency/adapters/fastapi/base.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
start #
suggested_function_call #
suggested_function_call(
workflow_uuid: str,
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/messages.py
system_message #
system_message(
workflow_uuid: str,
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/messages.py
text_input #
text_input(
workflow_uuid: str,
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/messages.py
text_message #
text_message(
workflow_uuid: str,
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/messages.py
visit #
visit_default #
Source code in fastagency/adapters/fastapi/base.py
visit_error #
visit_function_call_execution #
visit_function_call_execution(
message: FunctionCallExecution,
) -> Optional[str]
visit_keep_alive #
visit_multiple_choice #
visit_multiple_choice(
message: MultipleChoice,
) -> Optional[str]
visit_suggested_function_call #
visit_suggested_function_call(
message: SuggestedFunctionCall,
) -> Optional[str]
visit_system_message #
visit_system_message(
message: SystemMessage,
) -> Optional[str]
visit_text_input #
visit_text_message #
visit_text_message(message: TextMessage) -> Optional[str]
visit_workflow_completed #
visit_workflow_completed(
message: WorkflowCompleted,
) -> Optional[str]
visit_workflow_started #
visit_workflow_started(
message: WorkflowStarted,
) -> Optional[str]
workflow_completed #
workflow_completed(
workflow_uuid: str,
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/messages.py
workflow_started #
workflow_started(
workflow_uuid: str,
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]