Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGatewayTokenReviewer ¶ added in v0.8.0
func NewGatewayTokenReviewer(gatewayClient *client.Client, gptClient *gptscript.GPTScript, dispatcher *dispatcher.Dispatcher) authenticator.Request
Types ¶
type APIKeyAuthenticator ¶ added in v0.16.0
type APIKeyAuthenticator struct {
// contains filtered or unexported fields
}
APIKeyAuthenticator authenticates requests using API keys. API key users have restricted access - they only get GroupAPIKey, not the full authenticated user groups.
func NewAPIKeyAuthenticator ¶ added in v0.16.0
func NewAPIKeyAuthenticator(client *client.Client) *APIKeyAuthenticator
NewAPIKeyAuthenticator creates a new API key authenticator.
func (*APIKeyAuthenticator) AuthenticateRequest ¶ added in v0.16.0
func (a *APIKeyAuthenticator) AuthenticateRequest(req *http.Request) (*authenticator.Response, bool, error)
AuthenticateRequest implements authenticator.Request.
type Options ¶
type Options struct {
Hostname string
UIHostname string `name:"ui-hostname" env:"OBOT_SERVER_UI_HOSTNAME"`
GatewayDebug bool
DailyUserPromptTokenLimit int `usage:"The maximum number of daily user prompt/input token to allow, <= 0 disables the limit" default:"10000000"` // default is 10 million
DailyUserCompletionTokenLimit int `usage:"The maximum number of daily user completion/output tokens to allow, <= 0 disables the limit" default:"100000"` // default is 100 thousand
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, db *db.DB, tokenService *persistent.TokenService, modelProviderDispatcher *dispatcher.Dispatcher, acrHelper *accesscontrolrule.Helper, mapHelper *modelaccesspolicy.Helper, opts Options) (*Server, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.