Browse Source

将 content 类型改为 interface{}

boweniac 1 month ago
parent
commit
a565f60f7b
2 changed files with 7 additions and 7 deletions
  1. 3 3
      desc/openapi/chat.api
  2. 4 4
      internal/types/types.go

+ 3 - 3
desc/openapi/chat.api

@@ -53,7 +53,7 @@ type (
 	
 	StdCompMessage {
         Role string `json:"role"`
-        Content string `json:"content"`
+        Content interface{} `json:"content"`
     }
 
     //以下是API响应类型
@@ -86,8 +86,8 @@ type (
     }
 
 	FastgptSpecResp {
-		ResponseData []map[string]any `json:"responseData,omitempty"`
-		NewVariables map[string]any `json:"newVariables,omitempty"`
+		ResponseData []map[string]interface{} `json:"responseData,omitempty"`
+		NewVariables map[string]interface{} `json:"newVariables,omitempty"`
 	}
 	
 	ChatCompletionAudio {

+ 4 - 4
internal/types/types.go

@@ -1949,8 +1949,8 @@ type FastGptSpecReq struct {
 }
 
 type StdCompMessage struct {
-	Role    string `json:"role"`
-	Content string `json:"content"`
+	Role    string      `json:"role"`
+	Content interface{} `json:"content"`
 }
 
 // 以下是API响应类型
@@ -1986,8 +1986,8 @@ type StdCompApiResp struct {
 
 // swagger:model FastgptSpecResp
 type FastgptSpecResp struct {
-	ResponseData []map[string]any `json:"responseData,omitempty"`
-	NewVariables map[string]any   `json:"newVariables,omitempty"`
+	ResponseData []map[string]interface{} `json:"responseData,omitempty"`
+	NewVariables map[string]interface{}   `json:"newVariables,omitempty"`
 }
 
 type ChatCompletionAudio struct {