feat: API docs for service api (#24425)

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN-
2025-08-25 09:26:54 +08:00
committed by GitHub
parent 846b6bd14e
commit b7466f8b65
31 changed files with 1724 additions and 627 deletions

View File

@@ -1,11 +1,19 @@
from flask_restx import fields
from flask_restx import Api, Namespace, fields
from fields.conversation_fields import message_file_fields
from libs.helper import TimestampField
from .raws import FilesContainedField
feedback_fields = {"rating": fields.String}
feedback_fields = {
"rating": fields.String,
}
def build_feedback_model(api_or_ns: Api | Namespace):
"""Build the feedback model for the API or Namespace."""
return api_or_ns.model("Feedback", feedback_fields)
agent_thought_fields = {
"id": fields.String,
@@ -21,6 +29,12 @@ agent_thought_fields = {
"files": fields.List(fields.String),
}
def build_agent_thought_model(api_or_ns: Api | Namespace):
"""Build the agent thought model for the API or Namespace."""
return api_or_ns.model("AgentThought", agent_thought_fields)
retriever_resource_fields = {
"id": fields.String,
"message_id": fields.String,