chatgpt

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

README

介绍

🔔 注意:以下[]符号内代表此处是需要填写内容,并且不需要[]符号

配置参数

  • 插件名:ChatGPT聊天,已支持GPT-3.5-turbo模型
  • 权限:所有好友和群聊
  • 数据来源:https://beta.openai.com
  • 注意:请先私聊机器人配置appKey,相关秘钥申请地址点上面链接
  • 指令:
    • set chatgpt apiKey [keys],(多个key用;符号隔开),设置ChatGPT的apiKey,apiKey可小写apikey
    • del chatgpt apiKey [keys],(多个key用;符号隔开), 删除ChatGPT的apiKey,apiKey可小写apikey
    • set chatgpt model [key=val]kv请参考下面表格,没做过多校验,请保证设置正确
    • set chatgpt model reset,重置GPT的模型配置
    • get chatgpt info 获取ChatGPT的信息
  • 附录:
    • kv可选值参考下面表格:
      k 可选值 v 类型 v 可选值
      ModelName string 默认:gpt-3.5-turbo
      可选:gpt-3.5-turbo gpt-3.5-turbo-0301
      MaxTokens int 默认:512
      Temperature float32 默认:0.9
      TopP float32 默认:1.0
      FrequencyPenalty float32 默认:0.0
      PresencePenalty float32 默认:0.6
      ImageSize string 默认:512x512
      可选:请参考 https://github.com/sashabaranov/go-gpt3/blob/master/image.go#L15

连续会话

  • 说明:发送 开始ChatGPT会话 开始会话即可进行连续会话,发送结束会话即可结束会话,或5分钟没新的提问自动结束
  • 指令:
    • 开始会话,在某个聊天室内开始会话
    • 结束会话,在某个聊天室内结束会话
    • 清空会话,清空上下文

单独提问

  • 指令:
    • 提问 [问题],即可进行单独提问

AI作画

  • 指令:
    • 作画 [描述],即可进行AI作画

预览:

img

img

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskChatGpt added in v1.2.10

func AskChatGpt(messages []gogpt.ChatCompletionMessage, delay ...time.Duration) (answer string, err error)

func AskChatGptWithImage added in v1.3.0

func AskChatGptWithImage(prompt string, delay ...time.Duration) (b64 string, err error)

Types

type ApiKey added in v1.0.11

type ApiKey struct {
	Key string `gorm:"column:key;index"`
}

ApiKey apikey表,存放openai key

type ChatRoom added in v1.4.7

type ChatRoom struct {
	// contains filtered or unexported fields
}

type GptModel added in v1.2.10

type GptModel struct {
	Model            string  `gorm:"column:model"`
	MaxTokens        int     `gorm:"column:max_tokens"`
	Temperature      float64 `gorm:"column:temperature"`
	TopP             float64 `gorm:"column:top_p"`
	PresencePenalty  float64 `gorm:"column:presence_penalty"`
	FrequencyPenalty float64 `gorm:"column:frequency_penalty"`
	ImageSize        string  `gorm:"column:image_size"`
}

GptModel gptmodel表,存放gpt模型相关配置参数

Jump to

Keyboard shortcuts

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