Documentation
¶
Index ¶
- Constants
- func AccountPrefix(authUser string) string
- func BuildBody(prompt string, modelID, thinkMode int, fileRefs []string, extra map[int]any, ...) string
- func BuildURL(cfg config.Config, blOverride string) string
- func CleanText(text string, strip bool) string
- func ExtractResponseModel(raw string) string
- func ExtractResponseText(raw string) (string, error)
- func ExtractTextsFromLine(line string) []string
- func FetchLatestBL(client Requester) (string, error)
- func IsBardError(raw string) (string, bool)
- func SAPISIDHash(sapisid string) string
- func SniffImageMime(b []byte) string
- type Client
- func (c *Client) CurrentBL() string
- func (c *Client) Generate(prompt string, modelID, thinkMode int, fileRefs []string, extra map[int]any) (string, error)
- func (c *Client) GenerateImage(prompt string, modelID, thinkMode int, fileRefs []string, extra map[int]any) ([]ImageData, error)
- func (c *Client) GenerateStream(prompt string, modelID, thinkMode int, fileRefs []string, extra map[int]any, ...) error
- func (c *Client) GenerateStreamWithModel(prompt string, modelID, thinkMode int, fileRefs []string, extra map[int]any, ...) (string, error)
- func (c *Client) GenerateWithModel(prompt string, modelID, thinkMode int, fileRefs []string, extra map[int]any) (string, string, error)
- func (c *Client) SetBL(bl string)
- func (c *Client) UpdateBLIfNeeded() (string, bool, error)
- type CookieCache
- type CookieInfo
- type ImageData
- type Requester
- type StreamParser
- type UpstreamError
Constants ¶
View Source
const GeminiPayloadSize = 102
Variables ¶
This section is empty.
Functions ¶
func AccountPrefix ¶
func ExtractResponseModel ¶
ExtractResponseModel reads the upstream UI model label at payload index 42. It does not inspect generated text or infer identity from a requested selector.
func ExtractResponseText ¶
func ExtractTextsFromLine ¶
func FetchLatestBL ¶
func IsBardError ¶
func SAPISIDHash ¶
func SniffImageMime ¶
Types ¶
type Client ¶
type Client struct {
Cfg config.Config
HTTP Requester
Cookies *CookieCache
Logf func(format string, args ...any)
// contains filtered or unexported fields
}
func (*Client) GenerateImage ¶
func (*Client) GenerateStream ¶
func (*Client) GenerateStreamWithModel ¶
func (*Client) GenerateWithModel ¶
type CookieCache ¶
type CookieCache struct {
// contains filtered or unexported fields
}
func NewCookieCache ¶
func NewCookieCache(file string) *CookieCache
func (*CookieCache) Load ¶
func (c *CookieCache) Load() (CookieInfo, error)
type CookieInfo ¶
type ImageData ¶
type StreamParser ¶
type StreamParser struct {
// contains filtered or unexported fields
}
func NewStreamParser ¶
func NewStreamParser() *StreamParser
func (*StreamParser) Model ¶
func (p *StreamParser) Model() string
func (*StreamParser) ResetBuffer ¶
func (p *StreamParser) ResetBuffer()
type UpstreamError ¶
func (*UpstreamError) Error ¶
func (e *UpstreamError) Error() string
Click to show internal directories.
Click to hide internal directories.