|
@@ -1895,6 +1895,170 @@ type WxidReq struct {
|
|
Wxid string `json:"wxid"`
|
|
Wxid string `json:"wxid"`
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 以下是API请求类型
|
|
|
|
+// swagger:model CompApiReq
|
|
|
|
+type CompApiReq struct {
|
|
|
|
+ CompCtlReq
|
|
|
|
+ StdCompApiReq
|
|
|
|
+ FastGptSpecReq
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// FastGpt Completions请求信息
|
|
|
|
+// swagger:model FastGptApiReq
|
|
|
|
+type FastGptApiReq struct {
|
|
|
|
+ StdCompApiReq
|
|
|
|
+ FastGptSpecReq
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 标准Completions请求信息
|
|
|
|
+// swagger:model StdCompApiReq
|
|
|
|
+type StdCompApiReq struct {
|
|
|
|
+ //model,like 'gpt-4o'
|
|
|
|
+ Model string `json:"model,optional"`
|
|
|
|
+ //Message list
|
|
|
|
+ Messages []StdCompMessage `json:"messages"`
|
|
|
|
+ //Stream 是否流式输出
|
|
|
|
+ Stream bool `json:"stream,default=false"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 关于工作流配置的请求信息
|
|
|
|
+// swagger:model CompCtlReq
|
|
|
|
+type CompCtlReq struct {
|
|
|
|
+ //EventType事件类型
|
|
|
|
+ EventType string `json:"event_type,default=fastgpt"`
|
|
|
|
+ //WorkId工作流ID
|
|
|
|
+ WorkId string `json:"work_id"`
|
|
|
|
+ //IsBatch 是同步还是异步,默认及取值false表明同步
|
|
|
|
+ IsBatch bool `json:"is_batch,default=false"`
|
|
|
|
+ //异步回调地址
|
|
|
|
+ Callback string `json:"callback,optional"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// swagger:model FastGptSpecReq
|
|
|
|
+type FastGptSpecReq struct {
|
|
|
|
+ //ChatId
|
|
|
|
+ ChatId string `json:"chat_id,optional"`
|
|
|
|
+ //ResponseChatItemId
|
|
|
|
+ ResponseChatItemId string `json:"response_chat_item_id,optional"`
|
|
|
|
+ //Detail 详情开关
|
|
|
|
+ Detail bool `json:"detail,default=false"`
|
|
|
|
+ //Variables
|
|
|
|
+ Variables map[string]string `json:"variables,optional"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type StdCompMessage struct {
|
|
|
|
+ Role string `json:"role"`
|
|
|
|
+ Content string `json:"content"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 以下是API响应类型
|
|
|
|
+// swagger:model CompOpenApiResp
|
|
|
|
+type CompOpenApiResp struct {
|
|
|
|
+ StdCompApiResp
|
|
|
|
+ FastgptSpecResp
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// swagger:model StdCompApiResp
|
|
|
|
+type StdCompApiResp struct {
|
|
|
|
+ // A unique identifier for the chat completion.
|
|
|
|
+ ID string `json:"id"`
|
|
|
|
+ // A list of chat completion choices. Can be more than one if `n` is greater
|
|
|
|
+ // than 1.
|
|
|
|
+ Choices []ChatCompletionChoice `json:"choices"`
|
|
|
|
+ // The Unix timestamp (in seconds) of when the chat completion was created.
|
|
|
|
+ Created int64 `json:"created"`
|
|
|
|
+ // The model used for the chat completion.
|
|
|
|
+ Model string `json:"model"`
|
|
|
|
+ // The object type, which is always `chat.completion`.
|
|
|
|
+ Object string `json:"object"`
|
|
|
|
+ // The service tier used for processing the request.
|
|
|
|
+ ServiceTier string `json:"service_tier,omitempty"`
|
|
|
|
+ // This fingerprint represents the backend configuration that the model runs with.
|
|
|
|
+ //
|
|
|
|
+ // Can be used in conjunction with the `seed` request parameter to understand when
|
|
|
|
+ // backend changes have been made that might impact determinism.
|
|
|
|
+ SystemFingerprint string `json:"system_fingerprint"`
|
|
|
|
+ // Usage statistics for the completion request.
|
|
|
|
+ Usage CompletionUsage `json:"usage,omitempty"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// swagger:model FastgptSpecResp
|
|
|
|
+type FastgptSpecResp struct {
|
|
|
|
+ ResponseData []map[string]any `json:"responseData,omitempty"`
|
|
|
|
+ NewVariables map[string]any `json:"newVariables,omitempty"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type ChatCompletionAudio struct {
|
|
|
|
+ // Unique identifier for this audio response.
|
|
|
|
+ ID string `json:"id"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type ChatCompletionMessage struct {
|
|
|
|
+ // The contents of the message.
|
|
|
|
+ Content string `json:"content"`
|
|
|
|
+ //The contents of the reasoning message
|
|
|
|
+ ReasoningContent string `json:"reasoning_content,omitempty"`
|
|
|
|
+ // The refusal message generated by the model.
|
|
|
|
+ Refusal string `json:"refusal"`
|
|
|
|
+ // The role of the author of this message.
|
|
|
|
+ Role string `json:"role"`
|
|
|
|
+ // If the audio output modality is requested, this object contains data about the
|
|
|
|
+ // audio response from the model.
|
|
|
|
+ // [Learn more](https://platform.openai.com/docs/guides/audio).
|
|
|
|
+ Audio ChatCompletionAudio `json:"audio,omitempty"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type ChatCompletionChoice struct {
|
|
|
|
+ // The reason the model stopped generating tokens. This will be `stop` if the model
|
|
|
|
+ // hit a natural stop point or a provided stop sequence, `length` if the maximum
|
|
|
|
+ // number of tokens specified in the request was reached, `content_filter` if
|
|
|
|
+ // content was omitted due to a flag from our content filters, `tool_calls` if the
|
|
|
|
+ // model called a tool, or `function_call` (deprecated) if the model called a
|
|
|
|
+ // function.
|
|
|
|
+ FinishReason string `json:"finish_reason"`
|
|
|
|
+ // The index of the choice in the list of choices.
|
|
|
|
+ Index int64 `json:"index"`
|
|
|
|
+ // A chat completion message generated by the model.
|
|
|
|
+ Message ChatCompletionMessage `json:"message,omitempty"`
|
|
|
|
+ // A chat completion message generated by the model stream mode.
|
|
|
|
+ Delta ChatCompletionMessage `json:"delta,omitempty"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type CompletionUsageCompletionTokensDetails struct {
|
|
|
|
+ // When using Predicted Outputs, the number of tokens in the prediction that
|
|
|
|
+ // appeared in the completion.
|
|
|
|
+ AcceptedPredictionTokens int64 `json:"accepted_prediction_tokens"`
|
|
|
|
+ // Audio input tokens generated by the model.
|
|
|
|
+ AudioTokens int64 `json:"audio_tokens"`
|
|
|
|
+ // Tokens generated by the model for reasoning.
|
|
|
|
+ ReasoningTokens int64 `json:"reasoning_tokens"`
|
|
|
|
+ // When using Predicted Outputs, the number of tokens in the prediction that did
|
|
|
|
+ // not appear in the completion. However, like reasoning tokens, these tokens are
|
|
|
|
+ // still counted in the total completion tokens for purposes of billing, output,
|
|
|
|
+ // and context window limits.
|
|
|
|
+ RejectedPredictionTokens int64 `json:"rejected_prediction_tokens"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type CompletionUsagePromptTokensDetails struct {
|
|
|
|
+ // Audio input tokens present in the prompt.
|
|
|
|
+ AudioTokens int64 `json:"audio_tokens"`
|
|
|
|
+ // Cached tokens present in the prompt.
|
|
|
|
+ CachedTokens int64 `json:"cached_tokens"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type CompletionUsage struct {
|
|
|
|
+ // Number of tokens in the generated completion.
|
|
|
|
+ CompletionTokens int64 `json:"completion_tokens,required"`
|
|
|
|
+ // Number of tokens in the prompt.
|
|
|
|
+ PromptTokens int64 `json:"prompt_tokens,required"`
|
|
|
|
+ // Total number of tokens used in the request (prompt + completion).
|
|
|
|
+ TotalTokens int64 `json:"total_tokens,required"`
|
|
|
|
+ // Breakdown of tokens used in a completion.
|
|
|
|
+ CompletionTokensDetails CompletionUsageCompletionTokensDetails `json:"completion_tokens_details"`
|
|
|
|
+ // Breakdown of tokens used in the prompt.
|
|
|
|
+ PromptTokensDetails CompletionUsagePromptTokensDetails `json:"prompt_tokens_details"`
|
|
|
|
+}
|
|
|
|
+
|
|
// The data of batch msg information | BatchMsg信息
|
|
// The data of batch msg information | BatchMsg信息
|
|
// swagger:model BatchMsgInfo
|
|
// swagger:model BatchMsgInfo
|
|
type BatchMsgInfo struct {
|
|
type BatchMsgInfo struct {
|
|
@@ -4017,82 +4181,3 @@ type WhatsappChannelInfoResp struct {
|
|
// WhatsappChannel information | WhatsappChannel数据
|
|
// WhatsappChannel information | WhatsappChannel数据
|
|
Data WhatsappChannelInfo `json:"data"`
|
|
Data WhatsappChannelInfo `json:"data"`
|
|
}
|
|
}
|
|
-
|
|
|
|
-// swagger:model CreateInfo
|
|
|
|
-type CreateInfo struct {
|
|
|
|
- // Translated Name | 展示名称
|
|
|
|
- UserName string `json:"username"`
|
|
|
|
- // Name | 部门名称
|
|
|
|
- Title *string `json:"title"`
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// The response data of department information | 部门信息
|
|
|
|
-// swagger:model DepartmentInfo
|
|
|
|
-type DepartmentInfo struct {
|
|
|
|
- BaseIDInfo
|
|
|
|
- // Translated Name | 展示名称
|
|
|
|
- Trans string `json:"trans,optional"`
|
|
|
|
- // Status | 状态
|
|
|
|
- // max : 20
|
|
|
|
- Status *uint32 `json:"status,optional" validate:"omitempty,lt=20"`
|
|
|
|
- // Sort | 排序
|
|
|
|
- // max : 10000
|
|
|
|
- Sort *uint32 `json:"sort,optional" validate:"omitempty,lt=10000"`
|
|
|
|
- // Name | 部门名称
|
|
|
|
- // min length : 1
|
|
|
|
- // max length : 50
|
|
|
|
- Name *string `json:"name,optional" validate:"omitempty,min=1,max=50"`
|
|
|
|
- // Ancestors | 父级部门列表
|
|
|
|
- // max length : 200
|
|
|
|
- Ancestors *string `json:"ancestors,optional" validate:"omitempty,max=200"`
|
|
|
|
- // Leader | 部门负责人
|
|
|
|
- // max length : 20
|
|
|
|
- Leader *string `json:"leader,optional" validate:"omitempty,max=20"`
|
|
|
|
- // Phone | 电话号码
|
|
|
|
- // max length : 18
|
|
|
|
- Phone *string `json:"phone,optional" validate:"omitempty,max=18"`
|
|
|
|
- // Email | 邮箱
|
|
|
|
- // max length : 70
|
|
|
|
- Email *string `json:"email,optional" validate:"omitempty,max=70"`
|
|
|
|
- // Remark | 备注
|
|
|
|
- // max length : 200
|
|
|
|
- Remark *string `json:"remark,optional" validate:"omitempty,max=200"`
|
|
|
|
- // ParentId | 父级 ID
|
|
|
|
- ParentId *uint64 `json:"parentId,optional"`
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// The response data of department list | 部门列表数据
|
|
|
|
-// swagger:model DepartmentListResp
|
|
|
|
-type DepartmentListResp struct {
|
|
|
|
- BaseDataInfo
|
|
|
|
- // Department list data | 部门列表数据
|
|
|
|
- Data DepartmentListInfo `json:"data"`
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// Department list data | 部门列表数据
|
|
|
|
-// swagger:model DepartmentListInfo
|
|
|
|
-type DepartmentListInfo struct {
|
|
|
|
- BaseListInfo
|
|
|
|
- // The API list data | 部门列表数据
|
|
|
|
- Data []DepartmentInfo `json:"data"`
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// Get department list request params | 部门列表请求参数
|
|
|
|
-// swagger:model DepartmentListReq
|
|
|
|
-type DepartmentListReq struct {
|
|
|
|
- PageInfo
|
|
|
|
- // Name | 部门名称
|
|
|
|
- // max length : 50
|
|
|
|
- Name *string `json:"name,optional" validate:"omitempty,max=50"`
|
|
|
|
- // Leader | 部门负责人
|
|
|
|
- // max length : 20
|
|
|
|
- Leader *string `json:"leader,optional" validate:"omitempty,max=20"`
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// Department information response | 部门信息返回体
|
|
|
|
-// swagger:model DepartmentInfoResp
|
|
|
|
-type DepartmentInfoResp struct {
|
|
|
|
- BaseDataInfo
|
|
|
|
- // Department information | 部门数据
|
|
|
|
- Data DepartmentInfo `json:"data"`
|
|
|
|
-}
|
|
|