Documentation ¶
Index ¶
- Variables
- func StableDiffusionImage(prompt string) (io.ReadCloser, error)
- func TextGeneration(c chan Result, query TextQuery, model string)
- type Cmd
- type FileUpload
- type Fun
- type ImgPrompt
- type Input
- type Message
- type PMessage
- type Payload
- type QueryMessage
- type Response
- type Result
- type TextQuery
- type TwitchGQLBaseResponse
- type TwitchGQLPayload
- type TwitchMsg
- type TwitchSendMsgResponse
- type TwitchUser
- type TwitchUserResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var Client = twitch.NewAnonymousClient()
View Source
var F = Fun{}
View Source
var GenericUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0"
View Source
var QuoteEscaper = strings.NewReplacer("\\", "\\\\", `"`, "\\\"")
Functions ¶
func StableDiffusionImage ¶
func StableDiffusionImage(prompt string) (io.ReadCloser, error)
func TextGeneration ¶
Types ¶
type FileUpload ¶
type FileUpload struct { ID string `json:"id"` Ext string `json:"ext"` Type string `json:"type"` Checksum string `json:"checksum"` Key string `json:"key"` Link string `json:"link"` Delete string `json:"delete"` }
func UploadFile ¶
func UploadFile(rc io.ReadCloser, fileName string, contentType string) (upload FileUpload, err error)
type QueryMessage ¶
type Response ¶
type Response struct { ID string `json:"id"` Type string `json:"object"` Timestamp int `json:"created"` Model string `json:"model"` Choices []struct { Index int `json:"index"` Message Message `json:"message"` FinishReason string `json:"finish_reason"` } `json:"choices"` Usage struct { PromptTokens int `json:"prompt_tokens"` CompletionTokens int `json:"completion_tokens"` TotalTokens int `json:"total_tokens"` } `json:"usage"` Fingerprint string `json:"system_fingerprint"` }
type TextQuery ¶
type TextQuery struct { Stream bool `json:"stream"` Messages []QueryMessage `json:"messages"` }
type TwitchGQLBaseResponse ¶
type TwitchGQLPayload ¶
type TwitchSendMsgResponse ¶
type TwitchSendMsgResponse struct { *TwitchGQLBaseResponse Data struct { Mutation struct { DropReason *string `json:"dropReason"` // nullable hence pointer Message struct { ID string `json:"id"` } `json:"message"` } `json:"sendChatMessage"` } `json:"data"` }
type TwitchUser ¶
type TwitchUserResponse ¶
type TwitchUserResponse struct { *TwitchGQLBaseResponse Data struct { User TwitchUser `json:"user"` } `json:"data"` }
Click to show internal directories.
Click to hide internal directories.