12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package dify
- type ChatReq struct {
- Query string `json:"query"`
- ConversationId string `json:"conversation_id"`
- User string `json:"user"`
- ResponseMode string `json:"response_mode"`
- Files []File `json:"files"`
- Inputs interface{} `json:"inputs"`
- }
- type File struct {
- Type string `json:"type"`
- TransferMethod string `json:"transfer_method"`
- Url string `json:"url"`
- }
- type ChatResp struct {
- Event string `json:"event"`
- ConversationId string `json:"conversation_id"`
- MessageId string `json:"message_id,omitempty,optional"`
- Id string `json:"id,omitempty,optional"`
- CreatedAt uint64 `json:"created_at"`
- TaskId string `json:"task_id"`
- Metadata Meta `json:"Metadata,omitempty,optional"`
- Answer string `json:"answer,optional"`
- }
- type Meta struct {
- Usage Usage `json:"usage"`
- }
- type Usage struct {
- PromptTokens uint64 `json:"prompt_tokens"`
- CompletionTokens uint64 `json:"completion_tokens"`
- TotalTokens uint64 `json:"total_tokens"`
- }
- type Metadata struct {
- }
- // GetChatUrl 请求地址
- func GetChatUrl() string {
- return "/chat-messages"
- }
- func GetBaseUrl() string {
- return "https://dify.gkscrm.com/v1"
- }
- func GetToken() string {
- return "app-NhSN24G0AQV804gWtPfDnFZx"
- }
|