Documentation ¶
Index ¶
- Variables
- func Complete(ctx context.Context, text string, writer writer_structs.ChloeWriter) error
- func Forget(ctx context.Context, all bool) error
- func Generate(ctx context.Context, text string, writer writer_structs.ChloeWriter) error
- func Handle(ctx context.Context) error
- func Start(ctx context.Context)
- func TTS(ctx context.Context, text string, writer writer_structs.ChloeWriter) error
- type ActionCmd
- type AddExternalIDCmd
- type CLIWriter
- func (w *CLIWriter) Close() error
- func (w *CLIWriter) Flush()
- func (w *CLIWriter) GetObjects() []*response_object_structs.ResponseObject
- func (w *CLIWriter) Header() http.Header
- func (w *CLIWriter) SetPreWriteCallback(fn func())
- func (w *CLIWriter) Write(p []byte) (n int, err error)
- func (w *CLIWriter) WriteHeader(int)
- func (w *CLIWriter) WriteObject(obj *response_object_structs.ResponseObject) error
- type CompleteCmd
- type CountTokensCmd
- type CreateAPIKeyCmd
- type CreateUserCmd
- type DeleteExternalIDCmd
- type DeleteUserCmd
- type FileWriter
- func (w *FileWriter) Close() error
- func (w *FileWriter) Flush()
- func (w *FileWriter) GetObjects() []*response_object_structs.ResponseObject
- func (w *FileWriter) Header() http.Header
- func (w *FileWriter) SetPreWriteCallback(fn func())
- func (w *FileWriter) Write(p []byte) (n int, err error)
- func (w *FileWriter) WriteHeader(int)
- func (w *FileWriter) WriteObject(obj *response_object_structs.ResponseObject) error
- type ForgetCmd
- type GenerateCmd
- type Globals
- type ListMessagesCmd
- type ListUsersCmd
- type MergeUsersCmd
- type TTSCmd
- type VersionFlag
Constants ¶
This section is empty.
Variables ¶
View Source
var Flags struct { Version VersionFlag `name:"version" help:"Print version information and quit"` Complete CompleteCmd `cmd:"complete" short:"c" help:"Complete a prompt"` Generate GenerateCmd `cmd:"generate" short:"g" help:"Generate an prompt"` TTS TTSCmd `cmd:"tts" short:"t" help:"Generate an audio from a prompt"` Action ActionCmd `cmd:"" help:"Performs an action"` Forget ForgetCmd `cmd:"forget" short:"f" help:"Forget all users"` CountTokens CountTokensCmd `cmd:"count-tokens" help:"Count tokens"` CreateUser CreateUserCmd `cmd:"create-user" help:"Create a new user"` DeleteUser DeleteUserCmd `cmd:"delete-user" help:"Delete a user"` ListUsers ListUsersCmd `cmd:"list-users" help:"List users"` MergeUsers MergeUsersCmd `cmd:"merge-users" help:"Merge users"` AddExternalID AddExternalIDCmd `cmd:"add-external-id" help:"Add external ID to user"` DeleteExternalID DeleteExternalIDCmd `cmd:"delete-external-id" help:"Delete external ID from user"` ListMessages ListMessagesCmd `cmd:"list-messages" help:"List messages"` CreateAPIKey CreateAPIKeyCmd `cmd:"create-api-key" help:"Create an API key for use with the HTTP interface"` }
Functions ¶
func Complete ¶
func Complete(ctx context.Context, text string, writer writer_structs.ChloeWriter) error
func Generate ¶
func Generate(ctx context.Context, text string, writer writer_structs.ChloeWriter) error
func TTS ¶
func TTS(ctx context.Context, text string, writer writer_structs.ChloeWriter) error
Types ¶
type ActionCmd ¶
type AddExternalIDCmd ¶
type AddExternalIDCmd struct { UserID uint `short:"u" long:"user-id" description:"User ID"` ExternalID string `short:"e" long:"external-id" description:"External ID"` Interface string `short:"i" long:"interface" description:"Interface"` }
func (*AddExternalIDCmd) Run ¶
func (c *AddExternalIDCmd) Run(globals *Globals) error
type CLIWriter ¶
type CLIWriter struct {
// contains filtered or unexported fields
}
func NewCLIWriter ¶
func NewCLIWriter() *CLIWriter
func (*CLIWriter) GetObjects ¶
func (w *CLIWriter) GetObjects() []*response_object_structs.ResponseObject
func (*CLIWriter) SetPreWriteCallback ¶
func (w *CLIWriter) SetPreWriteCallback(fn func())
func (*CLIWriter) WriteHeader ¶
func (*CLIWriter) WriteObject ¶
func (w *CLIWriter) WriteObject(obj *response_object_structs.ResponseObject) error
type CompleteCmd ¶
type CompleteCmd struct { Prompt []string `arg:"" optional:"" help:"Prompt to complete"` Model string `short:"m" long:"model" help:"Model to use for completion" default:"gpt-3.5-turbo"` }
func (*CompleteCmd) Run ¶
func (c *CompleteCmd) Run(globals *Globals) error
type CountTokensCmd ¶
type CountTokensCmd struct { Prompt []string `arg:"" help:"Prompt to generate"` Model string `help:"Model to use" default:"gpt-3.5-turbo"` }
func (*CountTokensCmd) Run ¶
func (c *CountTokensCmd) Run(globals *Globals) error
type CreateAPIKeyCmd ¶
type CreateAPIKeyCmd struct {
UserID uint `arg:"" short:"u" long:"user-id" description:"User ID"`
}
func (*CreateAPIKeyCmd) Run ¶
func (c *CreateAPIKeyCmd) Run(globals *Globals) error
type CreateUserCmd ¶
type CreateUserCmd struct { Username string `short:"u" long:"username" description:"Username"` FirstName string `short:"f" long:"first-name" description:"First name"` LastName string `short:"l" long:"last-name" description:"Last name"` }
func (*CreateUserCmd) Run ¶
func (c *CreateUserCmd) Run(globals *Globals) error
type DeleteExternalIDCmd ¶
type DeleteExternalIDCmd struct { UserID uint `short:"u" long:"user-id" description:"User ID"` ExternalID string `short:"e" long:"external-id" description:"External ID"` Interface string `short:"i" long:"interface" description:"Interface"` }
func (*DeleteExternalIDCmd) Run ¶
func (c *DeleteExternalIDCmd) Run(globals *Globals) error
type DeleteUserCmd ¶
type DeleteUserCmd struct {
UserID uint `short:"u" long:"user-id" description:"User ID"`
}
func (*DeleteUserCmd) Run ¶
func (c *DeleteUserCmd) Run(globals *Globals) error
type FileWriter ¶
type FileWriter struct { Path string // contains filtered or unexported fields }
func NewFileWriter ¶
func NewFileWriter(path string) *FileWriter
func (*FileWriter) Close ¶
func (w *FileWriter) Close() error
func (*FileWriter) Flush ¶
func (w *FileWriter) Flush()
func (*FileWriter) GetObjects ¶
func (w *FileWriter) GetObjects() []*response_object_structs.ResponseObject
func (*FileWriter) Header ¶
func (w *FileWriter) Header() http.Header
func (*FileWriter) SetPreWriteCallback ¶
func (w *FileWriter) SetPreWriteCallback(fn func())
func (*FileWriter) WriteHeader ¶
func (w *FileWriter) WriteHeader(int)
func (*FileWriter) WriteObject ¶
func (w *FileWriter) WriteObject(obj *response_object_structs.ResponseObject) error
type ForgetCmd ¶
type ForgetCmd struct {
All bool `help:"Forget all users, not just the CLI user"`
}
type GenerateCmd ¶
type GenerateCmd struct { Prompt []string `arg:"" help:"Prompt to generate"` OutputPath string `` /* 136-byte string literal not displayed */ }
func (*GenerateCmd) Run ¶
func (c *GenerateCmd) Run(globals *Globals) error
type ListMessagesCmd ¶
type ListMessagesCmd struct { UserID uint `arg:"" short:"u" long:"user-id" description:"User ID"` Format string `help:"Output format, one of: table, markdown" default:"table"` }
func (*ListMessagesCmd) Run ¶
func (c *ListMessagesCmd) Run(globals *Globals) error
type ListUsersCmd ¶
type ListUsersCmd struct {
Format string `help:"Output format, one of: table, markdown" default:"table"`
}
func (*ListUsersCmd) Run ¶
func (c *ListUsersCmd) Run(globals *Globals) error
type MergeUsersCmd ¶
type MergeUsersCmd struct {
Users []uint `arg:"" help:"Users to merge"`
}
func (*MergeUsersCmd) Run ¶
func (c *MergeUsersCmd) Run(globals *Globals) error
type TTSCmd ¶
type VersionFlag ¶
type VersionFlag string
func (VersionFlag) BeforeApply ¶
func (VersionFlag) Decode ¶
func (v VersionFlag) Decode(ctx *kong.DecodeContext) error
func (VersionFlag) IsBool ¶
func (v VersionFlag) IsBool() bool
Source Files ¶
- audio.go
- cli.go
- commands.go
- commands_action.go
- commands_add_external_id.go
- commands_complete.go
- commands_count_tokens.go
- commands_create_api_key.go
- commands_create_user.go
- commands_delete_external_id.go
- commands_delete_user.go
- commands_forget.go
- commands_generate.go
- commands_list_messages.go
- commands_list_users.go
- commands_merge_users.go
- commands_tts.go
- image.go
- text.go
- user.go
- utils.go
- version.go
- writer_cli.go
- writer_file.go
Click to show internal directories.
Click to hide internal directories.