model

package
v0.0.0-...-fe41dbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Token  string `json:"access_token"`
	Expire int    `json:"expires_in"`
	Code   int    `json:"errcode"`
	Msg    string `json:"errmsg"` // 0 请求成功
}

type Choice

type Choice struct {
	Text         Message `json:"message"`
	Index        int64   `json:"index"`
	FinishReason string  `json:"finish_reason"`
}

type GptAnswer

type GptAnswer struct {
	ID      string   `json:"id"`
	Object  string   `json:"object"`
	Created int64    `json:"created"`
	Model   string   `json:"model"`
	Choices []Choice `json:"choices"`
	Usage   Usage    `json:"usage"`
}

type GptMessage

type GptMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type GptQuestion

type GptQuestion struct {
	Qst   []GptMessage `json:"messages"`
	Model string       `json:"model"`
}

type GptReq

type GptReq struct {
	Id  string `json:"id"`
	Qst string `json:"question"`
}

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type ServiceMessage

type ServiceMessage struct {
	ToUser  string             `json:"touser"`
	MsgType string             `json:"msgtype"`
	Text    ServiceMessageText `json:"text"`
}

type ServiceMessageText

type ServiceMessageText struct {
	Content string `json:"content"`
}

type TemplateMessage

type TemplateMessage struct {
	ToUser string `json:"touser"`
	TmpId  string `json:"template_id"`
}

type Usage

type Usage struct {
	PromptTokens     int64 `json:"prompt_tokens"`
	CompletionTokens int64 `json:"completion_tokens"`
	TotalTokens      int64 `json:"total_tokens"`
}

type User

type User struct {
	Id             string `json:"id"`              // id
	AvailableTimes int    `json:"available_times"` // 剩余请求次数
	Expired        int64  `json:"ttl"`             // vip过期时间
	Vip            bool   `json:"vip"`             // 是否vip用户
	RegisterTime   int64  `json:"register_time"`   // 注册时间
}

type UserInfo

type UserInfo struct {
	ToName     string   `xml:"ToUserName"`
	FromName   string   `xml:"FromUserName"`
	CreateTime int64    `xml:"CreateTime"`
	MsgType    string   `xml:"MsgType"`
	Content    string   `xml:"Content"`
	XMLName    xml.Name `xml:"xml"` // 若不标记XMLName, 则解析后的xml名为该结构体的名称
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL