libaiac

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChatGPTHost           = "chat.openai.com"
	DefaultUserAgent      = "Mozilla/5.0 (Windows NT 10.0; rv:107.0) Gecko/20100101 Firefox/107.0"
	SessionTokenCookie    = "__Secure-next-auth.session-token"
	CloudflareTokenCookie = "cf_clearance"
	CloudflareBmCookie    = "__cf_bm"
	CallbackURLCookie     = "__Secure-next-auth.callback-url"
)

Variables

View Source
var ErrNoCode = errors.New("no code generated")

Functions

This section is empty.

Types

type AIACClientInput

type AIACClientInput struct {
	ChatGPT             bool
	Token               string
	CloudflareClearance string
	CloudflareBm        string
	UserAgent           string
}

type CacheFile

type CacheFile struct {
	AccessToken string `json:"accessToken"`
	Expiry      int64  `json:"expiry"`
}

type Client

type Client struct {
	*requests.HTTPClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(input *AIACClientInput) *Client

func (*Client) Ask

func (client *Client) Ask(
	ctx context.Context,
	prompt string,
	shouldRetry bool,
	shouldQuit bool,
	outputPath string,
	readmePath string,
) (err error)

Jump to

Keyboard shortcuts

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