Files
dify/api/controllers/common/fields.py
T
+21 0e320290e1 feat: evaluation (#35353)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: jyong <[email protected]>
Co-authored-by: Yansong Zhang <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: hj24 <[email protected]>
Co-authored-by: hj24 <[email protected]>
Co-authored-by: Joel <[email protected]>
Co-authored-by: Stephen Zhou <[email protected]>
Co-authored-by: CodingOnStar <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: 非法操作 <[email protected]>
Co-authored-by: Ayush Baluni <[email protected]>
Co-authored-by: yyh <[email protected]>
Co-authored-by: jimcody1995 <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: Yunlu Wen <[email protected]>
Co-authored-by: Stephen Zhou <[email protected]>
Co-authored-by: Coding On Star <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jerryzai <[email protected]>
Co-authored-by: NVIDIAN <[email protected]>
Co-authored-by: ai-hpc <[email protected]>
Co-authored-by: Asuka Minato <[email protected]>
Co-authored-by: Junghwan <[email protected]>
Co-authored-by: HeYinKazune <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: yyh <[email protected]>
Co-authored-by: Jingyi <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: sxxtony <[email protected]>
2026-04-17 16:37:21 +08:00

60 lines
1.7 KiB
Python

from __future__ import annotations
from typing import Any
from pydantic import BaseModel, ConfigDict, computed_field
from graphon.file import helpers as file_helpers
from models.model import IconType
type JSONValue = str | int | float | bool | None | dict[str, Any] | list[Any]
type JSONObject = dict[str, Any]
class SystemParameters(BaseModel):
image_file_size_limit: int
video_file_size_limit: int
audio_file_size_limit: int
file_size_limit: int
workflow_file_upload_limit: int
class Parameters(BaseModel):
opening_statement: str | None = None
suggested_questions: list[str]
suggested_questions_after_answer: JSONObject
speech_to_text: JSONObject
text_to_speech: JSONObject
retriever_resource: JSONObject
annotation_reply: JSONObject
more_like_this: JSONObject
user_input_form: list[JSONObject]
sensitive_word_avoidance: JSONObject
file_upload: JSONObject
system_parameters: SystemParameters
class Site(BaseModel):
model_config = ConfigDict(from_attributes=True)
title: str
chat_color_theme: str | None = None
chat_color_theme_inverted: bool
icon_type: str | None = None
icon: str | None = None
icon_background: str | None = None
description: str | None = None
copyright: str | None = None
privacy_policy: str | None = None
custom_disclaimer: str | None = None
default_language: str
show_workflow_steps: bool
use_icon_as_answer_icon: bool
@computed_field(return_type=str | None) # type: ignore
@property
def icon_url(self) -> str | None:
if self.icon and self.icon_type == IconType.IMAGE:
return file_helpers.get_signed_file_url(self.icon)
return None