chore: docstring not match the function parameter (#17162)
This commit is contained in:
parent
32527b26d5
commit
44f911a0a8
47 changed files with 60 additions and 95 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from typing import Optional
|
||||
|
||||
from pydantic import Field, NonNegativeInt, computed_field
|
||||
from pydantic import Field, NonNegativeInt
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
from typing import Optional
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from .apollo import ApolloSettingsSourceInfo
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ class DatasetApi(DatasetApiResource):
|
|||
Deletes a dataset given its ID.
|
||||
|
||||
Args:
|
||||
_: ignore
|
||||
dataset_id (UUID): The ID of the dataset to be deleted.
|
||||
|
||||
Returns:
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ class ModelConfigConverter:
|
|||
"""
|
||||
Convert app model config dict to entity.
|
||||
:param app_config: app config
|
||||
:param skip_check: skip check
|
||||
:raises ProviderTokenNotInitError: provider token not init error
|
||||
:return: app orchestration config entity
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class AdvancedChatAppGenerator(MessageBasedAppGenerator):
|
|||
:param user: account or end user
|
||||
:param args: request args
|
||||
:param invoke_from: invoke from source
|
||||
:param stream: is stream
|
||||
:param streaming: is stream
|
||||
"""
|
||||
if not args.get("query"):
|
||||
raise ValueError("query is required")
|
||||
|
|
@ -181,10 +181,10 @@ class AdvancedChatAppGenerator(MessageBasedAppGenerator):
|
|||
|
||||
:param app_model: App
|
||||
:param workflow: Workflow
|
||||
:param node_id: the node id
|
||||
:param user: account or end user
|
||||
:param args: request args
|
||||
:param invoke_from: invoke from source
|
||||
:param stream: is stream
|
||||
:param streaming: is streamed
|
||||
"""
|
||||
if not node_id:
|
||||
raise ValueError("node_id is required")
|
||||
|
|
@ -238,10 +238,10 @@ class AdvancedChatAppGenerator(MessageBasedAppGenerator):
|
|||
|
||||
:param app_model: App
|
||||
:param workflow: Workflow
|
||||
:param node_id: the node id
|
||||
:param user: account or end user
|
||||
:param args: request args
|
||||
:param invoke_from: invoke from source
|
||||
:param stream: is stream
|
||||
:param streaming: is stream
|
||||
"""
|
||||
if not node_id:
|
||||
raise ValueError("node_id is required")
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class AgentChatAppGenerator(MessageBasedAppGenerator):
|
|||
:param user: account or end user
|
||||
:param args: request args
|
||||
:param invoke_from: invoke from source
|
||||
:param stream: is stream
|
||||
:param streaming: is stream
|
||||
"""
|
||||
if not streaming:
|
||||
raise ValueError("Agent Chat App does not support blocking mode")
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ class AppRunner:
|
|||
:param files: files
|
||||
:param query: query
|
||||
:param memory: memory
|
||||
:param image_detail_config: the image quality config
|
||||
:return:
|
||||
"""
|
||||
# get prompt without memory and context
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class ChatAppGenerator(MessageBasedAppGenerator):
|
|||
:param user: account or end user
|
||||
:param args: request args
|
||||
:param invoke_from: invoke from source
|
||||
:param stream: is stream
|
||||
:param streaming: is stream
|
||||
"""
|
||||
if not args.get("query"):
|
||||
raise ValueError("query is required")
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class CompletionAppGenerator(MessageBasedAppGenerator):
|
|||
:param user: account or end user
|
||||
:param args: request args
|
||||
:param invoke_from: invoke from source
|
||||
:param stream: is stream
|
||||
:param streaming: is stream
|
||||
"""
|
||||
query = args["query"]
|
||||
if not isinstance(query, str):
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class WorkflowAppGenerator(BaseAppGenerator):
|
|||
:param user: account or end user
|
||||
:param application_generate_entity: application generate entity
|
||||
:param invoke_from: invoke from source
|
||||
:param stream: is stream
|
||||
:param streaming: is stream
|
||||
:param workflow_thread_pool_id: workflow thread pool id
|
||||
"""
|
||||
# init queue manager
|
||||
|
|
@ -208,10 +208,10 @@ class WorkflowAppGenerator(BaseAppGenerator):
|
|||
|
||||
:param app_model: App
|
||||
:param workflow: Workflow
|
||||
:param node_id: the node id
|
||||
:param user: account or end user
|
||||
:param args: request args
|
||||
:param invoke_from: invoke from source
|
||||
:param stream: is stream
|
||||
:param streaming: is streamed
|
||||
"""
|
||||
if not node_id:
|
||||
raise ValueError("node_id is required")
|
||||
|
|
@ -264,10 +264,10 @@ class WorkflowAppGenerator(BaseAppGenerator):
|
|||
|
||||
:param app_model: App
|
||||
:param workflow: Workflow
|
||||
:param node_id: the node id
|
||||
:param user: account or end user
|
||||
:param args: request args
|
||||
:param invoke_from: invoke from source
|
||||
:param stream: is stream
|
||||
:param streaming: is streamed
|
||||
"""
|
||||
if not node_id:
|
||||
raise ValueError("node_id is required")
|
||||
|
|
|
|||
|
|
@ -44,9 +44,6 @@ class WorkflowAppRunner(WorkflowBasedAppRunner):
|
|||
def run(self) -> None:
|
||||
"""
|
||||
Run application
|
||||
:param application_generate_entity: application generate entity
|
||||
:param queue_manager: application queue manager
|
||||
:return:
|
||||
"""
|
||||
app_config = self.application_generate_entity.app_config
|
||||
app_config = cast(WorkflowAppConfig, app_config)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class MessageCycleManage:
|
|||
def _generate_conversation_name(self, *, conversation_id: str, query: str) -> Optional[Thread]:
|
||||
"""
|
||||
Generate conversation name.
|
||||
:param conversation: conversation
|
||||
:param conversation_id: conversation id
|
||||
:param query: query
|
||||
:return: thread
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ class WorkflowCycleManage:
|
|||
) -> WorkflowRun:
|
||||
"""
|
||||
Workflow run success
|
||||
:param workflow_run: workflow run
|
||||
:param workflow_run_id: workflow run id
|
||||
:param start_at: start time
|
||||
:param total_tokens: total tokens
|
||||
:param total_steps: total steps
|
||||
|
|
@ -236,7 +236,7 @@ class WorkflowCycleManage:
|
|||
) -> WorkflowRun:
|
||||
"""
|
||||
Workflow run failed
|
||||
:param workflow_run: workflow run
|
||||
:param workflow_run_id: workflow run id
|
||||
:param start_at: start time
|
||||
:param total_tokens: total tokens
|
||||
:param total_steps: total steps
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class UploadFileParser:
|
|||
"""
|
||||
get signed url from upload file
|
||||
|
||||
:param upload_file: UploadFile object
|
||||
:param upload_file_id: the id of UploadFile object
|
||||
:return:
|
||||
"""
|
||||
base_url = dify_config.FILES_URL
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class CodeExecutor:
|
|||
"""
|
||||
Execute code
|
||||
:param language: code language
|
||||
:param preload: the preload script
|
||||
:param code: code
|
||||
:return:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ def pin_position_map(original_position_map: dict[str, int], pin_list: list[str])
|
|||
"""
|
||||
Pin the items in the pin list to the beginning of the position map.
|
||||
Overall logic: exclude > include > pin
|
||||
:param position_map: the position map to be sorted and filtered
|
||||
:param original_position_map: the position map to be sorted and filtered
|
||||
:param pin_list: the list of pins to be put at the beginning
|
||||
:return: the sorted position map
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -38,12 +38,7 @@ class ToolParameterCache:
|
|||
return None
|
||||
|
||||
def set(self, parameters: dict) -> None:
|
||||
"""
|
||||
Cache model provider credentials.
|
||||
|
||||
:param credentials: provider credentials
|
||||
:return:
|
||||
"""
|
||||
"""Cache model provider credentials."""
|
||||
redis_client.setex(self.cache_key, 86400, json.dumps(parameters))
|
||||
|
||||
def delete(self) -> None:
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ class TTSModel(AIModel):
|
|||
:param credentials: model credentials
|
||||
:param voice: model timbre
|
||||
:param content_text: text content to be translated
|
||||
:param streaming: output is streaming
|
||||
:param user: unique user id
|
||||
:return: translated audio file
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -177,7 +177,6 @@ class OpenGauss(BaseVector):
|
|||
Search the nearest neighbors to a vector.
|
||||
|
||||
:param query_vector: The input vector to search for similar items.
|
||||
:param top_k: The number of nearest neighbors to return, default is 5.
|
||||
:return: List of Documents that are nearest to the query vector.
|
||||
"""
|
||||
top_k = kwargs.get("top_k", 4)
|
||||
|
|
|
|||
|
|
@ -197,7 +197,6 @@ class OracleVector(BaseVector):
|
|||
Search the nearest neighbors to a vector.
|
||||
|
||||
:param query_vector: The input vector to search for similar items.
|
||||
:param top_k: The number of nearest neighbors to return, default is 5.
|
||||
:return: List of Documents that are nearest to the query vector.
|
||||
"""
|
||||
top_k = kwargs.get("top_k", 4)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue