Documentation
¶
Index ¶
- func RefreshToken(tokenIdentifier string) (string, error)
- func RunOAuthFlow(tokenIdentifier string) (token string, err error)
- type Client
- func (an *Client) IsConfigured() bool
- func (an *Client) ListModels() (ret []string, err error)
- func (an *Client) NeedsRawMode(modelName string) bool
- func (an *Client) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage, ...) (ret string, err error)
- func (an *Client) SendStream(msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions, ...) (err error)
- func (an *Client) Setup() (err error)
- type OAuthTransport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RefreshToken ¶
RefreshToken refreshes an expired OAuth token using the refresh token
func RunOAuthFlow ¶
RunOAuthFlow executes the complete OAuth authorization flow
Types ¶
type Client ¶
type Client struct {
*plugins.PluginBase
ApiBaseURL *plugins.SetupQuestion
ApiKey *plugins.SetupQuestion
UseOAuth *plugins.SetupQuestion
// contains filtered or unexported fields
}
func (*Client) IsConfigured ¶
IsConfigured returns true if either the API key or OAuth is configured
func (*Client) ListModels ¶
func (*Client) NeedsRawMode ¶
func (*Client) Send ¶
func (an *Client) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions) ( ret string, err error)
func (*Client) SendStream ¶
func (an *Client) SendStream( msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions, channel chan string, ) (err error)
type OAuthTransport ¶
type OAuthTransport struct {
// contains filtered or unexported fields
}
OAuthTransport is a custom HTTP transport that adds OAuth Bearer token and beta header
func NewOAuthTransport ¶
func NewOAuthTransport(client *Client, base http.RoundTripper) *OAuthTransport
NewOAuthTransport creates a new OAuth transport for the given client
Click to show internal directories.
Click to hide internal directories.