repository

package
v0.0.0-...-9ae7e58 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationRepository

type AuthenticationRepository struct {
	DB          *gorm.DB
	APIKeyCache sync.Map
	// contains filtered or unexported fields
}

func NewAuthenticationRepository

func NewAuthenticationRepository(db *gorm.DB, r Repository) *AuthenticationRepository

func (*AuthenticationRepository) ChatCompletion

func (*AuthenticationRepository) IsValidAPIKey

func (ar *AuthenticationRepository) IsValidAPIKey(apiKey string) bool

func (*AuthenticationRepository) ProxyRequest

func (ar *AuthenticationRepository) ProxyRequest(r *requests.ProxyRequest) error

type DatabaseRepository

type DatabaseRepository struct {
	DB          *gorm.DB
	APIKeyCache sync.Map
	// contains filtered or unexported fields
}

func NewDatabaseRepository

func NewDatabaseRepository(db *gorm.DB, r Repository) *DatabaseRepository

func (*DatabaseRepository) ChatCompletion

func (*DatabaseRepository) ProxyRequest

func (dr *DatabaseRepository) ProxyRequest(r *requests.ProxyRequest) error

func (*DatabaseRepository) SaveQueryRecord

type ModelRepository

type ModelRepository struct {
	DB         *gorm.DB
	ModelCache sync.Map
	// contains filtered or unexported fields
}

func NewModelRepository

func NewModelRepository(db *gorm.DB, r Repository) *ModelRepository

func (*ModelRepository) ChatCompletion

func (*ModelRepository) ProxyRequest

func (ar *ModelRepository) ProxyRequest(r *requests.ProxyRequest) error

type ProxyRepository

type ProxyRepository struct {
	Config *config.Config
	Client *http.Client
	DB     *gorm.DB
}

func NewProxyRepository

func NewProxyRepository(Config *config.Config, db *gorm.DB) *ProxyRepository

func (*ProxyRepository) ChatCompletion

func (*ProxyRepository) ProxyClaude

func (*ProxyRepository) ProxyRequest

func (pr *ProxyRepository) ProxyRequest(r *requests.ProxyRequest) error

func (*ProxyRepository) RunInBackground

func (pr *ProxyRepository) RunInBackground(r *requests.CompletionRequest, req *http.Request)

type Repository

type Repository interface {
	ProxyRequest(r *requests.ProxyRequest) error
	ChatCompletion(r *requests.CompletionRequest) (*requests.CompletionResponse, error)
}

type ValidationRepository

type ValidationRepository struct {
	// contains filtered or unexported fields
}

func NewValidationRepository

func NewValidationRepository(repo Repository) *ValidationRepository

func (*ValidationRepository) ChatCompletion

func (*ValidationRepository) ProxyRequest

func (vr *ValidationRepository) ProxyRequest(r *requests.ProxyRequest) error

Jump to

Keyboard shortcuts

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