瀏覽代碼

add custom tool (#2157)

Seefs 4 月之前
父節點
當前提交
96a2b81aaa
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      dto/openai_request.go

+ 4 - 1
dto/openai_request.go

@@ -232,10 +232,13 @@ func (r *GeneralOpenAIRequest) GetSystemRoleName() string {
 	return "system"
 }
 
+const CustomType = "custom"
+
 type ToolCallRequest struct {
 	ID       string          `json:"id,omitempty"`
 	Type     string          `json:"type"`
-	Function FunctionRequest `json:"function"`
+	Function FunctionRequest `json:"function,omitempty"`
+	Custom   json.RawMessage `json:"custom,omitempty"`
 }
 
 type FunctionRequest struct {