Documentation
¶
Index ¶
- Variables
- func ClientHandler(ctx context.Context, targetID, quoteID, authorID string, args ...string) (err error)
- func ClientHandlerStream(ctx context.Context, targetID, quoteID, authorID string, args ...string) (err error)
- func ClientHandlerStreamUpdate(ctx context.Context, targetID, quoteID, authorID, msgID, msg string) (err error)
- func CreateChatCompletion(ctx context.Context, msg, authorID string) (message string, err error)
- func CreateChatCompletionStream(ctx context.Context, input, authorID string)
- func ModerationCheck(ctx context.Context, content string) (res []string)
- type AsyncMapValue
- type GPTClient
- type Message
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorMaxToken = fmt.Errorf(
` 你的会话token数量已经达到了GPT-3.5-turbo的4096 token上限, 请使用指令` + "`" + ".gpt RESET" + "`" + `或点击按钮来重置会话并重试。
请注意: 为了保护你的隐私,
***目前***我们不会保存你与ChatGPT交流的历史会话。在后续BetaGo上线OAuth鉴权后, 你可能需要同意[EULA协议]来允许我们保存你的历史会话。
`,
)
View Source
var GPTAsyncMap = make(map[string]AsyncMapValue)
GPTAsyncMap 异步map
View Source
var (
ParsedProxyURL *url.URL
)
View Source
var TraceUserMap = make(map[string]string)
TraceUserMap 1
Functions ¶
func ClientHandler ¶
func ClientHandler(ctx context.Context, targetID, quoteID, authorID string, args ...string) (err error)
ClientHandler 1 ! deprecated @param targetID 目标ID @param quoteID 引用ID @param authorID 发送者ID @return err 错误信息
func ClientHandlerStream ¶
func ClientHandlerStream(ctx context.Context, targetID, quoteID, authorID string, args ...string) (err error)
ClientHandlerStream 1
@param ctx @param targetID @param quoteID @param authorID @param args @return err
func ClientHandlerStreamUpdate ¶
func ClientHandlerStreamUpdate(ctx context.Context, targetID, quoteID, authorID, msgID, msg string) (err error)
ClientHandlerStreamUpdate 1
@param ctx @param targetID @param quoteID @param authorID @param args @return err
Types ¶
type AsyncMapValue ¶
type GPTClient ¶
type GPTClient struct { Model string `json:"model"` Messages []Message `json:"messages"` Stream bool `json:"stream,omitempty"` AsyncChan chan string `json:"-"` StopChan chan string `json:"-"` StopAuthor string `json:"-"` }
GPTClient GPT的请求体
func (*GPTClient) PostWithStream ¶
PostWithStream 流式请求
@receiver g @param ctx @return executeMsg @return err
Click to show internal directories.
Click to hide internal directories.