| """ | """ | ||||
| Agent runner | Agent runner | ||||
| :param tenant_id: tenant id | :param tenant_id: tenant id | ||||
| :param application_generate_entity: application generate entity | |||||
| :param conversation: conversation | |||||
| :param app_config: app generate entity | :param app_config: app generate entity | ||||
| :param model_config: model config | :param model_config: model config | ||||
| :param config: dataset config | :param config: dataset config | ||||
| :param queue_manager: queue manager | :param queue_manager: queue manager | ||||
| :param message: message | :param message: message | ||||
| :param user_id: user id | :param user_id: user id | ||||
| :param agent_llm_callback: agent llm callback | |||||
| :param callback: callback | |||||
| :param memory: memory | :param memory: memory | ||||
| :param prompt_messages: prompt messages | |||||
| :param variables_pool: variables pool | |||||
| :param db_variables: db variables | |||||
| :param model_instance: model instance | |||||
| """ | """ | ||||
| self.tenant_id = tenant_id | self.tenant_id = tenant_id | ||||
| self.application_generate_entity = application_generate_entity | self.application_generate_entity = application_generate_entity |
| handle invoke action | handle invoke action | ||||
| :param action: action | :param action: action | ||||
| :param tool_instances: tool instances | :param tool_instances: tool instances | ||||
| :param message_file_ids: message file ids | |||||
| :param trace_manager: trace manager | |||||
| :return: observation, meta | :return: observation, meta | ||||
| """ | """ | ||||
| # action is tool call, invoke tool | # action is tool call, invoke tool |
| :param invoke_result: invoke result | :param invoke_result: invoke result | ||||
| :param queue_manager: application queue manager | :param queue_manager: application queue manager | ||||
| :param stream: stream | :param stream: stream | ||||
| :param agent: agent | |||||
| :return: | :return: | ||||
| """ | """ | ||||
| if not stream: | if not stream: | ||||
| Handle invoke result direct | Handle invoke result direct | ||||
| :param invoke_result: invoke result | :param invoke_result: invoke result | ||||
| :param queue_manager: application queue manager | :param queue_manager: application queue manager | ||||
| :param agent: agent | |||||
| :return: | :return: | ||||
| """ | """ | ||||
| queue_manager.publish( | queue_manager.publish( | ||||
| Handle invoke result | Handle invoke result | ||||
| :param invoke_result: invoke result | :param invoke_result: invoke result | ||||
| :param queue_manager: application queue manager | :param queue_manager: application queue manager | ||||
| :param agent: agent | |||||
| :return: | :return: | ||||
| """ | """ | ||||
| model = None | model = None |
| """ | """ | ||||
| Initialize generate records | Initialize generate records | ||||
| :param application_generate_entity: application generate entity | :param application_generate_entity: application generate entity | ||||
| :conversation conversation | |||||
| :return: | :return: | ||||
| """ | """ | ||||
| app_config = application_generate_entity.app_config | app_config = application_generate_entity.app_config |
| :param content_text: text content to be translated | :param content_text: text content to be translated | ||||
| :param tenant_id: user tenant id | :param tenant_id: user tenant id | ||||
| :param user: unique user id | |||||
| :param voice: model timbre | :param voice: model timbre | ||||
| :param streaming: output is streaming | |||||
| :param user: unique user id | |||||
| :return: text for given audio file | :return: text for given audio file | ||||
| """ | """ | ||||
| if not isinstance(self.model_type_instance, TTSModel): | if not isinstance(self.model_type_instance, TTSModel): | ||||
| managed_credentials: Optional[dict] = None) -> None: | managed_credentials: Optional[dict] = None) -> None: | ||||
| """ | """ | ||||
| Load balancing model manager | Load balancing model manager | ||||
| :param tenant_id: tenant_id | |||||
| :param provider: provider | |||||
| :param model_type: model_type | |||||
| :param model: model name | |||||
| :param load_balancing_configs: all load balancing configurations | :param load_balancing_configs: all load balancing configurations | ||||
| :param managed_credentials: credentials if load balancing configuration name is __inherit__ | :param managed_credentials: credentials if load balancing configuration name is __inherit__ | ||||
| """ | """ |
| -> list[ModelSettings]: | -> list[ModelSettings]: | ||||
| """ | """ | ||||
| Convert to model settings. | Convert to model settings. | ||||
| :param provider_entity: provider entity | |||||
| :param provider_model_settings: provider model settings include enabled, load balancing enabled | :param provider_model_settings: provider model settings include enabled, load balancing enabled | ||||
| :param load_balancing_model_configs: load balancing model configs | :param load_balancing_model_configs: load balancing model configs | ||||
| :return: | :return: |
| create an image message | create an image message | ||||
| :param image: the url of the image | :param image: the url of the image | ||||
| :param save_as: save as | |||||
| :return: the image message | :return: the image message | ||||
| """ | """ | ||||
| ``` | ``` | ||||
| create a link message | create a link message | ||||
| :param link: the url of the link | :param link: the url of the link | ||||
| :param save_as: save as | |||||
| :return: the link message | :return: the link message | ||||
| """ | """ | ||||
| ``` | ``` | ||||
| create a text message | create a text message | ||||
| :param text: the text of the message | :param text: the text of the message | ||||
| :param save_as: save as | |||||
| :return: the text message | :return: the text message | ||||
| """ | """ | ||||
| ``` | ``` | ||||
| create a blob message | create a blob message | ||||
| :param blob: the blob | :param blob: the blob | ||||
| :param meta: meta | |||||
| :param save_as: save as | |||||
| :return: the blob message | :return: the blob message | ||||
| """ | """ | ||||
| ``` | ``` |
| :param description: the description | :param description: the description | ||||
| :param parameters: the parameters | :param parameters: the parameters | ||||
| :param privacy_policy: the privacy policy | :param privacy_policy: the privacy policy | ||||
| :param labels: labels | |||||
| :return: the created tool | :return: the created tool | ||||
| """ | """ | ||||
| WorkflowToolConfigurationUtils.check_parameter_configurations(parameters) | WorkflowToolConfigurationUtils.check_parameter_configurations(parameters) | ||||
| Update a workflow tool. | Update a workflow tool. | ||||
| :param user_id: the user id | :param user_id: the user id | ||||
| :param tenant_id: the tenant id | :param tenant_id: the tenant id | ||||
| :param tool: the tool | |||||
| :param workflow_tool_id: workflow tool id | |||||
| :param name: name | |||||
| :param label: label | |||||
| :param icon: icon | |||||
| :param description: description | |||||
| :param parameters: parameters | |||||
| :param privacy_policy: privacy policy | |||||
| :param labels: labels | |||||
| :return: the updated tool | :return: the updated tool | ||||
| """ | """ | ||||
| WorkflowToolConfigurationUtils.check_parameter_configurations(parameters) | WorkflowToolConfigurationUtils.check_parameter_configurations(parameters) |
| Replace Template Variables | Replace Template Variables | ||||
| :param template: template | :param template: template | ||||
| :param variables: list of variables | :param variables: list of variables | ||||
| :param external_data_variable_node_mapping: external data variable node mapping | |||||
| :return: | :return: | ||||
| """ | """ | ||||
| for v in variables: | for v in variables: |
| Add annotation to index. | Add annotation to index. | ||||
| :param job_id: job_id | :param job_id: job_id | ||||
| :param content_list: content list | :param content_list: content list | ||||
| :param tenant_id: tenant id | |||||
| :param app_id: app id | :param app_id: app id | ||||
| :param tenant_id: tenant id | |||||
| :param user_id: user_id | :param user_id: user_id | ||||
| """ | """ |