Documentation ¶
Index ¶
- Constants
- Variables
- func LoadEnvVar(key, defaultValue string) string
- type Chat
- func (c *Chat) Delete() error
- func (c *Chat) GetSession() Conversation
- func (c *Chat) LoadImage(file string) (*KBlob, error)
- func (c *Chat) LoadPlugins(names ...string) (plugins []string, err error)
- func (c *Chat) Reply(ctx context.Context, prompt string, image *KBlob, ...) (chan ChatResponse, error)
- type ChatError
- type ChatMessage
- type ChatResponse
- type Conversation
- type KBlob
- type Options
- func (opts *Options) KievAuth(kievRPSSecAuth, rwBf string) *Options
- func (opts *Options) Model(model string) *Options
- func (opts *Options) Notebook(flag bool) *Options
- func (opts *Options) Plugins(plugins ...string) *Options
- func (opts *Options) Proxies(proxies string) *Options
- func (opts *Options) Temperature(temperature float32) *Options
- func (opts *Options) TopicToE(flag bool) *Options
Constants ¶
View Source
const ( //DefaultCreate = "https://www.bing.com/turing/conversation/create" DefaultCreate = "https://copilot.microsoft.com/turing/conversation/create" DefaultChatHub = "wss://sydney.bing.com/sydney/ChatHub" ModelCreative = "Creative" ModelBalanced = "Balanced" ModelPrecise = "Precise" ModelSydney = "Sydney" PluginShop = "Shop" PluginInstacart = "Instacart" PluginOpenTable = "OpenTable" PluginKlarna = "Klarna" PluginSearch = "Search" PluginKayak = "Kayak" )
Variables ¶
View Source
var H = map[string]string{
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1 Edg/120.0.0.0",
}
View Source
var Version = "1.1694.0"
Functions ¶
func LoadEnvVar ¶ added in v1.0.3
Types ¶
type Chat ¶
type Chat struct { Options // contains filtered or unexported fields }
func (*Chat) GetSession ¶ added in v1.0.3
func (c *Chat) GetSession() Conversation
func (*Chat) LoadPlugins ¶ added in v1.0.3
获取bing插件ID。需要包含Search,否则无效。 可用插件 Shop 、Instacart、OpenTable、Klarna、Search、Kayak
func (*Chat) Reply ¶
func (c *Chat) Reply(ctx context.Context, prompt string, image *KBlob, previousMessages []ChatMessage) (chan ChatResponse, error)
对话并回复
ctx Context 控制器,promp string 当前对话,image KBlob 图片信息,previousMessages []map[string]string 历史记录
previousMessages:
[ { "author": "user", "text": "hi" }, { "author": "bot", "text": "Hello, this is Bing. I am a chat mode ..." } ]
type ChatMessage ¶ added in v1.0.3
type ChatResponse ¶ added in v1.0.3
type Conversation ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func NewDefaultOptions ¶ added in v1.0.2
func (*Options) Temperature ¶ added in v1.0.2
温度调节 0.0~1.0, Sydney 模式生效
Click to show internal directories.
Click to hide internal directories.