client

package
v0.0.0-...-bbf8f27 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FakeUASlice = []string{
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.3",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Safari/605.1.1",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.3",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.",
}
View Source
var HTTP = &http.Client{
	Timeout: 30 * time.Second,
}
View Source
var RedisDB = redis.NewClient(&redis.Options{
	Addr:     "localhost:6379",
	Password: "",
	DB:       9,
})

Functions

func GetFakeUA

func GetFakeUA() string

func StableDiffusionImage

func StableDiffusionImage(prompt string) (io.ReadCloser, error)

func TextGeneration

func TextGeneration(c chan Result, query TextQuery, model string)

Types

type ImgPrompt

type ImgPrompt struct {
	Prompt string `json:"prompt"`
	Steps  int    `json:"num_steps"`
}

type QueryMessage

type QueryMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type Result

type Result struct {
	Response string `json:"response"`
	Error    error
}

type TextQuery

type TextQuery struct {
	Stream   bool           `json:"stream"`
	Messages []QueryMessage `json:"messages"`
}

type TwitchBanStatusResponse

type TwitchBanStatusResponse struct {
	*TwitchGQLBaseResponse
	Data struct {
		BanStatus struct {
			BannedUser TwitchUser `json:"bannedUser"`
			Moderator  TwitchUser `json:"moderator"`
			CreatedAt  string     `json:"createdAt"`
			ExpiresAt  string     `json:"expiresAt"`
			Permanent  bool       `json:"isPermanent"`
		} `json:"chatRoomBanStatus"`
	} `json:"data"`
}

func GetTwitchBan

func GetTwitchBan(channelID string, userID string) (TwitchBanStatusResponse, error)

type TwitchGQLBaseResponse

type TwitchGQLBaseResponse struct {
	Extensions struct {
		Duration      json.Number `json:"durationMilliseconds"`
		OperationName string      `json:"operationName"`
		RequestID     string      `json:"requestID"`
	} `json:"extensions"`
}

type TwitchGQLPayload

type TwitchGQLPayload struct {
	OperationName string `json:"operationName"`
	Query         string `json:"query"`
	Variables     any    `json:"variables"`
}

type TwitchUser

type TwitchUser struct {
	ID          string `json:"id,omitempty"`
	Login       string `json:"login,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
}

func GetTwitchUser

func GetTwitchUser(login string, id string) (TwitchUser, error)

type TwitchUserResponse

type TwitchUserResponse struct {
	*TwitchGQLBaseResponse
	Data struct {
		User TwitchUser `json:"user"`
	} `json:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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