Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultDBPath() (string, error)
- func DefaultStorePath() (string, error)
- type Config
- type Store
- func (s *Store) Close() error
- func (s *Store) CycleClientConfig(ctx context.Context) error
- func (s *Store) DBPath() string
- func (s *Store) DropConversation(ctx context.Context) error
- func (s *Store) GetClientConfig(ctx context.Context) (query.ClientConfig, error)
- func (s *Store) GetConfig(ctx context.Context) (Config, error)
- func (s *Store) GetConfigInt(ctx context.Context, name string, defaultValue int) (int, error)
- func (s *Store) GetCredential(ctx context.Context, name string) (string, error)
- func (s *Store) GetLastMessages(ctx context.Context, count int) ([]query.Message, error)
- func (s *Store) GetPreviousMessageForRole(ctx context.Context, role string, offset int) (query.Message, error)
- func (s *Store) GetTotalUsage(ctx context.Context) (res query.Usage, err error)
- func (s *Store) NextConversation(ctx context.Context) error
- func (s *Store) PreviousConversation(ctx context.Context) error
- func (s *Store) SaveRequest(ctx context.Context, req openai.ChatCompletionRequest) error
- func (s *Store) SaveRequestResponse(ctx context.Context, req openai.ChatCompletionRequest, ...) error
- func (s *Store) SaveStreamResults(ctx context.Context, text string, usage openai.Usage, failure error) error
- func (s *Store) SetConfigInt(ctx context.Context, name string, value int) error
- func (s *Store) SetCredential(ctx context.Context, name string, value string) error
- func (s *Store) UpdateClientConfig(ctx context.Context, messageContext int64) error
- type StoreOpt
Constants ¶
View Source
const ( DBName = "gpterm.db" ConfigChatMessageContext = "chat.message-context" CredentialAPIKey = "api_key" CredentialGithubToken = "github_token" )
Variables ¶
View Source
var ErrNoMoreConversations = errors.New("no more conversations")
Functions ¶
func DefaultDBPath ¶
func DefaultStorePath ¶
Types ¶
type Store ¶
func (*Store) GetClientConfig ¶
func (*Store) GetConfigInt ¶
func (*Store) GetCredential ¶
func (*Store) GetLastMessages ¶
func (*Store) GetPreviousMessageForRole ¶
func (*Store) GetTotalUsage ¶
func (*Store) PreviousConversation ¶
func (*Store) SaveRequest ¶
func (*Store) SaveRequestResponse ¶
func (*Store) SaveStreamResults ¶
func (*Store) SetConfigInt ¶
func (*Store) SetCredential ¶
Click to show internal directories.
Click to hide internal directories.