package fastgpt type ChatReq struct { ChatId string `json:"chatId"` Stream bool `json:"stream"` Detail bool `json:"detail"` Variables Variables `json:"variables"` Messages []Message `json:"messages"` } type ChatResp struct { Id string `json:"id"` Object string `json:"object"` Created uint64 `json:"created"` Model string `json:"model"` Choices []Choice `json:"choices"` } type ChatNoStreamResp struct { Id string `json:"id"` Model string `json:"model"` Usage Usage `json:"usage"` Choices []NoStreamChoice `json:"choices"` } type NoStreamChoice struct { Message Delta `json:"message"` FinishReason string `json:"finish_reason,optional"` Index uint64 `json:"index"` } type Usage struct { PromptTokens int `json:"prompt_tokens"` CompletionTokens int `json:"completion_tokens"` TotalTokens int `json:"total_tokens"` } type Choice struct { Delta Delta `json:"delta"` FinishReason string `json:"finish_reason,optional"` Index uint64 `json:"index"` } type Delta struct { Content string `json:"content"` Role string `json:"role"` } type Variables struct { Uid string `json:"uid"` Name string `json:"name"` } type Message struct { Content string `json:"content"` Role string `json:"role"` } type ChatResponse struct { Id string `json:"id"` Object string `json:"object"` Created uint64 `json:"created"` Model string `json:"model"` Choices []Choice `json:"choices"` } // GetChatUrl 请求地址 func GetChatUrl() string { return "/v1/chat/completions" } func GetChatToken() string { return "fastgpt-eEvIvCz2ccEmgbp4nUEbUDHLoCN2wz4BnpI3ucxECFRbG9xiNBOfjd797vIkT" }