mirror of
https://github.com/langgenius/dify.git
synced 2026-06-26 14:51:13 +08:00
Merge 55ae9e2aef into 4f4ac27de2
This commit is contained in:
commit
ef960510c7
@ -112,7 +112,7 @@ class DatasetUpdatePayload(BaseModel):
|
||||
external_knowledge_id: str | None = None
|
||||
external_knowledge_api_id: str | None = None
|
||||
icon_info: dict[str, Any] | None = Field(default=None)
|
||||
is_multimodal: bool | None = False
|
||||
is_multimodal: bool = False
|
||||
|
||||
@field_validator("indexing_technique")
|
||||
@classmethod
|
||||
|
||||
@ -77,7 +77,7 @@ class CreateSnippetPayload(BaseModel):
|
||||
type: Literal["node", "group"] = "node"
|
||||
icon_info: IconInfo | None = None
|
||||
graph: dict[str, Any] | None = Field(default=None)
|
||||
input_fields: list[InputFieldDefinition] | None = Field(default_factory=list)
|
||||
input_fields: list[InputFieldDefinition] = Field(default_factory=list)
|
||||
|
||||
|
||||
class UpdateSnippetPayload(BaseModel):
|
||||
|
||||
@ -141,7 +141,7 @@ class WorkflowToolBasePayload(BaseModel):
|
||||
description: str
|
||||
icon: dict[str, Any]
|
||||
parameters: list[WorkflowToolParameterConfiguration] = Field(default_factory=list)
|
||||
privacy_policy: str | None = ""
|
||||
privacy_policy: str = ""
|
||||
labels: list[str] | None = None
|
||||
|
||||
@field_validator("name")
|
||||
|
||||
@ -34,7 +34,7 @@ def print_text(text: str, color: str | None = None, end: str = "", file: TextIO
|
||||
class DifyAgentCallbackHandler(BaseModel):
|
||||
"""Callback Handler that prints to std out."""
|
||||
|
||||
color: str | None = ""
|
||||
color: str = ""
|
||||
current_loop: int = 1
|
||||
|
||||
def __init__(self, color: str | None = None):
|
||||
|
||||
@ -49,8 +49,8 @@ class DatasourceProviderApiEntity(BaseModel):
|
||||
original_credentials: dict[str, Any] | None = None
|
||||
is_team_authorization: bool = False
|
||||
allow_delete: bool = True
|
||||
plugin_id: str | None = Field(default="", description="The plugin id of the datasource")
|
||||
plugin_unique_identifier: str | None = Field(default="", description="The unique identifier of the datasource")
|
||||
plugin_id: str = Field(default="", description="The plugin id of the datasource")
|
||||
plugin_unique_identifier: str = Field(default="", description="The unique identifier of the datasource")
|
||||
datasources: list[DatasourceApiEntity] = Field(default_factory=list)
|
||||
labels: list[str] = Field(default_factory=list)
|
||||
|
||||
|
||||
@ -318,8 +318,8 @@ class WebSiteInfo(BaseModel):
|
||||
|
||||
status: str | None = Field(..., description="crawl job status")
|
||||
web_info_list: list[WebSiteInfoDetail] | None = []
|
||||
total: int | None = Field(default=0, description="The total number of websites")
|
||||
completed: int | None = Field(default=0, description="The number of completed websites")
|
||||
total: int = Field(default=0, description="The total number of websites")
|
||||
completed: int = Field(default=0, description="The number of completed websites")
|
||||
|
||||
|
||||
class WebsiteCrawlMessage(BaseModel):
|
||||
|
||||
@ -24,7 +24,7 @@ class EndpointProviderDeclaration(BaseModel):
|
||||
"""
|
||||
|
||||
settings: list[ProviderConfig] = Field(default_factory=list)
|
||||
endpoints: list[EndpointDeclaration] | None = Field(default_factory=list[EndpointDeclaration])
|
||||
endpoints: list[EndpointDeclaration] = Field(default_factory=list[EndpointDeclaration])
|
||||
|
||||
|
||||
class EndpointEntity(BasePluginEntity):
|
||||
|
||||
@ -28,25 +28,25 @@ class PluginResourceRequirements(BaseModel):
|
||||
|
||||
class Permission(BaseModel):
|
||||
class Tool(BaseModel):
|
||||
enabled: bool | None = Field(default=False)
|
||||
enabled: bool = Field(default=False)
|
||||
|
||||
class Model(BaseModel):
|
||||
enabled: bool | None = Field(default=False)
|
||||
llm: bool | None = Field(default=False)
|
||||
text_embedding: bool | None = Field(default=False)
|
||||
rerank: bool | None = Field(default=False)
|
||||
tts: bool | None = Field(default=False)
|
||||
speech2text: bool | None = Field(default=False)
|
||||
moderation: bool | None = Field(default=False)
|
||||
enabled: bool = Field(default=False)
|
||||
llm: bool = Field(default=False)
|
||||
text_embedding: bool = Field(default=False)
|
||||
rerank: bool = Field(default=False)
|
||||
tts: bool = Field(default=False)
|
||||
speech2text: bool = Field(default=False)
|
||||
moderation: bool = Field(default=False)
|
||||
|
||||
class Node(BaseModel):
|
||||
enabled: bool | None = Field(default=False)
|
||||
enabled: bool = Field(default=False)
|
||||
|
||||
class Endpoint(BaseModel):
|
||||
enabled: bool | None = Field(default=False)
|
||||
enabled: bool = Field(default=False)
|
||||
|
||||
class Storage(BaseModel):
|
||||
enabled: bool | None = Field(default=False)
|
||||
enabled: bool = Field(default=False)
|
||||
size: int = Field(ge=1024, le=1073741824, default=1048576)
|
||||
|
||||
tool: Tool | None = Field(default=None)
|
||||
@ -69,11 +69,11 @@ class PluginCategory(StrEnum):
|
||||
|
||||
class PluginDeclaration(BaseModel):
|
||||
class Plugins(BaseModel):
|
||||
tools: list[str] | None = Field(default_factory=list[str])
|
||||
models: list[str] | None = Field(default_factory=list[str])
|
||||
endpoints: list[str] | None = Field(default_factory=list[str])
|
||||
datasources: list[str] | None = Field(default_factory=list[str])
|
||||
triggers: list[str] | None = Field(default_factory=list[str])
|
||||
tools: list[str] = Field(default_factory=list[str])
|
||||
models: list[str] = Field(default_factory=list[str])
|
||||
endpoints: list[str] = Field(default_factory=list[str])
|
||||
datasources: list[str] = Field(default_factory=list[str])
|
||||
triggers: list[str] = Field(default_factory=list[str])
|
||||
|
||||
class Meta(BaseModel):
|
||||
minimum_dify_version: str | None = Field(default=None)
|
||||
|
||||
@ -27,9 +27,9 @@ class DatasourceErrorEvent(BaseDatasourceEvent):
|
||||
class DatasourceCompletedEvent(BaseDatasourceEvent):
|
||||
event: DatasourceStreamEvent = DatasourceStreamEvent.COMPLETED
|
||||
data: Mapping[str, Any] | list = Field(..., description="result")
|
||||
total: int | None = Field(default=0, description="total")
|
||||
completed: int | None = Field(default=0, description="completed")
|
||||
time_consuming: float | None = Field(default=0.0, description="time consuming")
|
||||
total: int = Field(default=0, description="total")
|
||||
completed: int = Field(default=0, description="completed")
|
||||
time_consuming: float = Field(default=0.0, description="time consuming")
|
||||
|
||||
|
||||
class DatasourceProcessingEvent(BaseDatasourceEvent):
|
||||
|
||||
@ -10,7 +10,7 @@ class NotionInfo(BaseModel):
|
||||
"""
|
||||
|
||||
credential_id: str | None = None
|
||||
notion_workspace_id: str | None = ""
|
||||
notion_workspace_id: str = ""
|
||||
notion_obj_id: str
|
||||
notion_page_type: str
|
||||
document: Document | None = None
|
||||
|
||||
@ -38,14 +38,14 @@ class ToolProviderApiEntity(BaseModel):
|
||||
original_credentials: Mapping[str, object] = Field(default_factory=dict)
|
||||
is_team_authorization: bool = False
|
||||
allow_delete: bool = True
|
||||
plugin_id: str | None = Field(default="", description="The plugin id of the tool")
|
||||
plugin_unique_identifier: str | None = Field(default="", description="The unique identifier of the tool")
|
||||
plugin_id: str = Field(default="", description="The plugin id of the tool")
|
||||
plugin_unique_identifier: str = Field(default="", description="The unique identifier of the tool")
|
||||
tools: list[ToolApiEntity] = Field(default_factory=list[ToolApiEntity])
|
||||
labels: list[str] = Field(default_factory=list)
|
||||
# MCP
|
||||
server_url: str | None = Field(default="", description="The server url of the tool")
|
||||
server_url: str = Field(default="", description="The server url of the tool")
|
||||
updated_at: int = Field(default_factory=lambda: int(datetime.now().timestamp()))
|
||||
server_identifier: str | None = Field(default="", description="The server identifier of the MCP tool")
|
||||
server_identifier: str = Field(default="", description="The server identifier of the MCP tool")
|
||||
|
||||
masked_headers: dict[str, str] | None = Field(default=None, description="The masked headers of the MCP tool")
|
||||
original_headers: dict[str, str] | None = Field(default=None, description="The original headers of the MCP tool")
|
||||
|
||||
@ -43,8 +43,8 @@ class TriggerProviderApiEntity(BaseModel):
|
||||
icon_dark: str | None = Field(default=None, description="The dark icon of the trigger provider")
|
||||
tags: list[str] = Field(default_factory=list, description="The tags of the trigger provider")
|
||||
|
||||
plugin_id: str | None = Field(default="", description="The plugin id of the tool")
|
||||
plugin_unique_identifier: str | None = Field(default="", description="The unique identifier of the tool")
|
||||
plugin_id: str = Field(default="", description="The plugin id of the tool")
|
||||
plugin_unique_identifier: str = Field(default="", description="The unique identifier of the tool")
|
||||
|
||||
supported_creation_methods: list[TriggerCreationMethod] = Field(
|
||||
default_factory=list,
|
||||
|
||||
@ -31,12 +31,12 @@ class SourceMetadata(BaseModel):
|
||||
retriever_from: str = Field(default="workflow", description="Retriever source context")
|
||||
score: float = Field(default=0.0, description="Retrieval relevance score")
|
||||
child_chunks: list[SourceChildChunk] = Field(default_factory=list, description="List of child chunks")
|
||||
segment_hit_count: int | None = Field(default=0, description="Number of times segment was retrieved")
|
||||
segment_word_count: int | None = Field(default=0, description="Word count of the segment")
|
||||
segment_position: int | None = Field(default=0, description="Position of segment in document")
|
||||
segment_hit_count: int = Field(default=0, description="Number of times segment was retrieved")
|
||||
segment_word_count: int = Field(default=0, description="Word count of the segment")
|
||||
segment_position: int = Field(default=0, description="Position of segment in document")
|
||||
segment_index_node_hash: str | None = Field(default=None, description="Hash of index node for the segment")
|
||||
doc_metadata: dict[str, Any] | None = Field(default=None, description="Additional document metadata")
|
||||
position: int | None = Field(default=0, description="Position of the document in the dataset")
|
||||
position: int = Field(default=0, description="Position of the document in the dataset")
|
||||
|
||||
class Config:
|
||||
populate_by_name = True
|
||||
|
||||
@ -36,10 +36,10 @@ class VisualConfig(BaseModel):
|
||||
"""Visual configuration for schedule trigger"""
|
||||
|
||||
# For hourly frequency
|
||||
on_minute: int | None = Field(default=0, ge=0, le=59, description="Minute of the hour (0-59)")
|
||||
on_minute: int = Field(default=0, ge=0, le=59, description="Minute of the hour (0-59)")
|
||||
|
||||
# For daily, weekly, monthly frequencies
|
||||
time: str | None = Field(default="12:00 AM", description="Time in 12-hour format (e.g., '2:30 PM')")
|
||||
time: str = Field(default="12:00 AM", description="Time in 12-hour format (e.g., '2:30 PM')")
|
||||
|
||||
# For weekly frequency
|
||||
weekdays: list[Literal["sun", "mon", "tue", "wed", "thu", "fri", "sat"]] | None = Field(
|
||||
|
||||
@ -811,7 +811,7 @@ class AccountService:
|
||||
account: Account | None = None,
|
||||
email: str | None = None,
|
||||
language: str = "en-US",
|
||||
workspace_name: str | None = "",
|
||||
workspace_name: str = "",
|
||||
):
|
||||
account_email = account.email if account else email
|
||||
if account_email is None:
|
||||
@ -840,7 +840,7 @@ class AccountService:
|
||||
account: Account | None = None,
|
||||
email: str | None = None,
|
||||
language: str = "en-US",
|
||||
workspace_name: str | None = "",
|
||||
workspace_name: str = "",
|
||||
new_owner_email: str = "",
|
||||
):
|
||||
account_email = account.email if account else email
|
||||
@ -861,7 +861,7 @@ class AccountService:
|
||||
account: Account | None = None,
|
||||
email: str | None = None,
|
||||
language: str = "en-US",
|
||||
workspace_name: str | None = "",
|
||||
workspace_name: str = "",
|
||||
):
|
||||
account_email = account.email if account else email
|
||||
if account_email is None:
|
||||
|
||||
@ -11,8 +11,8 @@ class RerankingModelConfig(BaseModel):
|
||||
Reranking Model Config.
|
||||
"""
|
||||
|
||||
reranking_provider_name: str | None = ""
|
||||
reranking_model_name: str | None = ""
|
||||
reranking_provider_name: str = ""
|
||||
reranking_model_name: str = ""
|
||||
|
||||
|
||||
class WeightedScoreConfig(BaseModel):
|
||||
|
||||
@ -298,7 +298,7 @@ export type DatasetUpdatePayload = {
|
||||
[key: string]: unknown
|
||||
} | null
|
||||
indexing_technique?: string | null
|
||||
is_multimodal?: boolean | null
|
||||
is_multimodal?: boolean
|
||||
name?: string | null
|
||||
partial_member_list?: Array<{
|
||||
[key: string]: string
|
||||
|
||||
@ -332,7 +332,7 @@ export const zDatasetUpdatePayload = z.object({
|
||||
external_retrieval_model: z.record(z.string(), z.unknown()).nullish(),
|
||||
icon_info: z.record(z.string(), z.unknown()).nullish(),
|
||||
indexing_technique: z.string().nullish(),
|
||||
is_multimodal: z.boolean().nullish().default(false),
|
||||
is_multimodal: z.boolean().optional().default(false),
|
||||
name: z.string().min(1).max(40).nullish(),
|
||||
partial_member_list: z.array(z.record(z.string(), z.string())).nullish(),
|
||||
permission: zPermissionEnum.nullish(),
|
||||
|
||||
@ -45,7 +45,7 @@ export type CreateSnippetPayload = {
|
||||
[key: string]: unknown
|
||||
} | null
|
||||
icon_info?: IconInfo | null
|
||||
input_fields?: Array<InputFieldDefinition> | null
|
||||
input_fields?: Array<InputFieldDefinition>
|
||||
name: string
|
||||
type?: 'group' | 'node'
|
||||
}
|
||||
@ -760,7 +760,7 @@ export type WorkflowToolCreatePayload = {
|
||||
labels?: Array<string> | null
|
||||
name: string
|
||||
parameters?: Array<WorkflowToolParameterConfiguration>
|
||||
privacy_policy?: string | null
|
||||
privacy_policy?: string
|
||||
workflow_app_id: string
|
||||
}
|
||||
|
||||
@ -777,7 +777,7 @@ export type WorkflowToolUpdatePayload = {
|
||||
labels?: Array<string> | null
|
||||
name: string
|
||||
parameters?: Array<WorkflowToolParameterConfiguration>
|
||||
privacy_policy?: string | null
|
||||
privacy_policy?: string
|
||||
workflow_tool_id: string
|
||||
}
|
||||
|
||||
|
||||
@ -796,7 +796,7 @@ export const zCreateSnippetPayload = z.object({
|
||||
description: z.string().max(2000).nullish(),
|
||||
graph: z.record(z.string(), z.unknown()).nullish(),
|
||||
icon_info: zIconInfo.nullish(),
|
||||
input_fields: z.array(zInputFieldDefinition).nullish(),
|
||||
input_fields: z.array(zInputFieldDefinition).optional(),
|
||||
name: z.string().min(1).max(255),
|
||||
type: z.enum(['group', 'node']).optional().default('node'),
|
||||
})
|
||||
@ -1774,7 +1774,7 @@ export const zWorkflowToolCreatePayload = z.object({
|
||||
labels: z.array(z.string()).nullish(),
|
||||
name: z.string(),
|
||||
parameters: z.array(zWorkflowToolParameterConfiguration).optional(),
|
||||
privacy_policy: z.string().nullish().default(''),
|
||||
privacy_policy: z.string().optional().default(''),
|
||||
workflow_app_id: z.string(),
|
||||
})
|
||||
|
||||
@ -1788,7 +1788,7 @@ export const zWorkflowToolUpdatePayload = z.object({
|
||||
labels: z.array(z.string()).nullish(),
|
||||
name: z.string(),
|
||||
parameters: z.array(zWorkflowToolParameterConfiguration).optional(),
|
||||
privacy_policy: z.string().nullish().default(''),
|
||||
privacy_policy: z.string().optional().default(''),
|
||||
workflow_tool_id: z.string(),
|
||||
})
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user