chore: update docstrings (#7343)

This commit is contained in:
Nam Vu
2024-08-16 13:19:01 +07:00
committed by GitHub
parent 9e6b755f62
commit dbc1ae45de
10 changed files with 34 additions and 7 deletions

View File

@@ -64,15 +64,19 @@ class BaseAgentRunner(AppRunner):
""" """
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

View File

@@ -292,6 +292,8 @@ class CotAgentRunner(BaseAgentRunner, ABC):
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

View File

@@ -256,6 +256,7 @@ class AppRunner:
: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:
@@ -278,6 +279,7 @@ class AppRunner:
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(
@@ -293,6 +295,7 @@ class AppRunner:
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

View File

@@ -138,6 +138,7 @@ class MessageBasedAppGenerator(BaseAppGenerator):
""" """
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

View File

@@ -271,9 +271,8 @@ class ModelInstance:
: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):
@@ -401,6 +400,10 @@ class LBModelManager:
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__
""" """

View File

@@ -811,7 +811,7 @@ class ProviderManager:
-> 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:

View File

@@ -21,6 +21,7 @@ Dify支持`文本` `链接` `图片` `文件BLOB` `JSON` 等多种消息类型
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
""" """
``` ```
@@ -34,6 +35,7 @@ Dify支持`文本` `链接` `图片` `文件BLOB` `JSON` 等多种消息类型
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
""" """
``` ```
@@ -47,6 +49,7 @@ Dify支持`文本` `链接` `图片` `文件BLOB` `JSON` 等多种消息类型
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
""" """
``` ```
@@ -63,6 +66,8 @@ Dify支持`文本` `链接` `图片` `文件BLOB` `JSON` 等多种消息类型
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
""" """
``` ```

View File

@@ -32,6 +32,7 @@ class WorkflowToolManageService:
: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)
@@ -92,7 +93,14 @@ class WorkflowToolManageService:
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)

View File

@@ -589,6 +589,7 @@ class WorkflowConverter:
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:

View File

@@ -21,8 +21,8 @@ def batch_import_annotations_task(job_id: str, content_list: list[dict], app_id:
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
""" """