Versions in this module Expand all Collapse all v0 v0.0.3 Nov 19, 2024 Changes in this version + var D *sql.DB + func GetDittoTokensPerDollar(ctx context.Context) (int64, error) + func SearchExamples(ctx context.Context, em llm.Embedding, opts ...SearchOption) ([]llm.Example, error) + func Setup(ctx context.Context, shutdown *sync.WaitGroup) (err error) + type Purchase struct + Cents int64 + CreatedAt time.Time + ID int64 + PaymentID string + Tokens int64 + UserID int64 + func (p *Purchase) Insert(uid string) error + type Receipt struct + CallDurationSeconds float64 + DataProcessedBytes int64 + DataStoredBytes int64 + DittoTokenCost int64 + ID int64 + InputTokens int64 + Metadata json.RawMessage + NumAPICalls int64 + NumImages int64 + NumSearches int64 + OutputTokens int64 + ServiceID int64 + ServiceName llm.ServiceName + Timestamp time.Time + TotalTokens int64 + UserID int64 + func (r *Receipt) Insert(ctx context.Context) error + type SearchOption func(*opt) + func WithK(k int) SearchOption + type Service struct + BaseCostPerBatch float64 + BaseCostPerCall float64 + BaseCostPerGBProcessed float64 + BaseCostPerGBStored float64 + BaseCostPerImage float64 + BaseCostPerMillionInputTokens float64 + BaseCostPerMillionOutputTokens float64 + BaseCostPerMillionTokens float64 + BaseCostPerSearch float64 + BaseCostPerSecond float64 + BatchSizeLimit int64 + Currency string + Description string + ID int64 + IsActive bool + MaxInputTokens int64 + MaxOutputTokens int64 + MaxTotalTokens int64 + MinimumProfitAmount float64 + Name string + PeakHoursMultiplier float64 + ProfitMarginPercentage float64 + Provider string + RateLimitPerDay int64 + RateLimitPerMinute int64 + ServiceType string + SupportsBatching bool + Version string + VolumeDiscountPercentage float64 + VolumeDiscountThreshold int64 + func (s *Service) GetByName(ctx context.Context) error + type User struct + Balance int64 + ID int64 + LastAirdropAt time.Time + TotalTokensAirdrop int64 + UID string + func (u *User) Get(ctx context.Context) error + func (u *User) InitBalance(ctx context.Context) error + func (u *User) Insert(ctx context.Context) error v0.0.2 Oct 24, 2024