Jelajahi Sumber

fix:message api doc (#15568)

Co-authored-by: mars <linjx2@by-health.com>
Mars 1 bulan lalu
induk
melakukan
1fab02c25a

+ 1 - 15
api/controllers/service_api/app/message.py

@@ -10,7 +10,7 @@ from controllers.service_api.app.error import NotChatAppError
 from controllers.service_api.wraps import FetchUserArg, WhereisUserArg, validate_app_token
 from core.app.entities.app_invoke_entities import InvokeFrom
 from fields.conversation_fields import message_file_fields
-from fields.message_fields import feedback_fields, retriever_resource_fields
+from fields.message_fields import agent_thought_fields, feedback_fields, retriever_resource_fields
 from fields.raws import FilesContainedField
 from libs.helper import TimestampField, uuid_value
 from models.model import App, AppMode, EndUser
@@ -19,20 +19,6 @@ from services.message_service import MessageService
 
 
 class MessageListApi(Resource):
-    agent_thought_fields = {
-        "id": fields.String,
-        "chain_id": fields.String,
-        "message_id": fields.String,
-        "position": fields.Integer,
-        "thought": fields.String,
-        "tool": fields.String,
-        "tool_labels": fields.Raw,
-        "tool_input": fields.String,
-        "created_at": TimestampField,
-        "observation": fields.String,
-        "message_files": fields.List(fields.Nested(message_file_fields)),
-    }
-
     message_fields = {
         "id": fields.String,
         "conversation_id": fields.String,

+ 2 - 2
web/app/components/develop/template/template_chat.en.mdx

@@ -641,7 +641,7 @@ Chat applications support session persistence, allowing previous chat history to
                         "tool_input": "{\"dalle2\": {\"prompt\": \"cat\"}}",
                         "created_at": 1705988186,
                         "observation": "image has been created and sent to user already, you should tell user to check it now.",
-                        "message_files": [
+                        "files": [
                             "976990d2-5294-47e6-8f14-7356ba9d2d76"
                         ]
                     },
@@ -655,7 +655,7 @@ Chat applications support session persistence, allowing previous chat history to
                         "tool_input": "",
                         "created_at": 1705988199,
                         "observation": "",
-                        "message_files": []
+                        "files": []
                     }
                 ]
             }

+ 2 - 2
web/app/components/develop/template/template_chat.ja.mdx

@@ -641,7 +641,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
                         "tool_input": "{\"dalle2\": {\"prompt\": \"cat\"}}",
                         "created_at": 1705988186,
                         "observation": "画像はすでに作成され、ユーザーに送信されました。今すぐユーザーに確認するように伝えてください。",
-                        "message_files": [
+                        "files": [
                             "976990d2-5294-47e6-8f14-7356ba9d2d76"
                         ]
                     },
@@ -655,7 +655,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
                         "tool_input": "",
                         "created_at": 1705988199,
                         "observation": "",
-                        "message_files": []
+                        "files": []
                     }
                 ]
             }

+ 2 - 2
web/app/components/develop/template/template_chat.zh.mdx

@@ -657,7 +657,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
                     "tool_input": "{\"dalle2\": {\"prompt\": \"cat\"}}",
                     "created_at": 1705988186,
                     "observation": "image has been created and sent to user already, you should tell user to check it now.",
-                    "message_files": [
+                    "files": [
                         "976990d2-5294-47e6-8f14-7356ba9d2d76"
                     ]
                 },
@@ -671,7 +671,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
                     "tool_input": "",
                     "created_at": 1705988199,
                     "observation": "",
-                    "message_files": []
+                    "files": []
                 }
             ]
         }