Documentation ¶
Index ¶
Constants ¶
View Source
const ( StyleCreative = "h3imaginative,clgalileo,gencontentv3" StyleBalanced = "galileo" StylePrecise = "h3precise,clgalileo" DelimiterByte = uint8(30) Delimiter = "\x1e" MaxMessageSizeGPT3 = 2000 MaxMessageSizeGPT4 = 4000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conversation ¶
type Conversation struct { ConversationId string `json:"conversationId,omitempty"` ClientId string `json:"clientId,omitempty"` ConversationSignature string `json:"conversationSignature,omitempty"` Result struct { Value null.String `json:"value"` Message null.String `json:"message"` } `json:"result"` }
type GPT ¶
type GPT struct { Config *config.GPT Conversation *Conversation ExpiredAt time.Time Hub *Hub // contains filtered or unexported fields }
func (*GPT) AskAsync ¶
func (g *GPT) AskAsync(style, message string) (*responses.MessageWrapper, error)
AskAsync getting answer async: Example:
gpt, err := EdgeGPT.NewGPT(conf) //create service if err != nil { log.Fatalln(err) } mw, err := gpt.AskAsync("Привет, ты живой?") // send ask to gpt if err != nil { log.Fatalln(err) } go mw.Worker() // Run reading websocket messages for _ = range mw.Chan { // update answer log.Println(mw.Answer.GetAnswer()) }
type Hub ¶
type Hub struct { InvocationId int // contains filtered or unexported fields }
func (*Hub) CheckAndReconnect ¶
CheckAndReconnect check active connection and reconnect
Click to show internal directories.
Click to hide internal directories.