feat: API docs for service api (#24425)
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user