Documentation ¶
Index ¶
- Variables
- 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
- type Receipt
- type SearchOption
- type Service
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var D *sql.DB
Functions ¶
func SearchExamples ¶
Types ¶
type Purchase ¶
type Receipt ¶
type Receipt struct { ID int64 UserID int64 // ServiceName is the name of the service used for this receipt. // It is not in this DB table, but is used for internal logic. ServiceName llm.ServiceName ServiceID int64 Timestamp time.Time InputTokens int64 OutputTokens int64 TotalTokens int64 CallDurationSeconds float64 DataProcessedBytes int64 DataStoredBytes int64 NumImages int64 NumSearches int64 NumAPICalls int64 DittoTokenCost int64 Metadata json.RawMessage }
type Service ¶
type Service struct { ID int64 Name string Description string Version string ServiceType string Provider string BaseCostPerCall float64 BaseCostPerMillionTokens float64 BaseCostPerMillionInputTokens float64 BaseCostPerMillionOutputTokens float64 BaseCostPerImage float64 BaseCostPerSearch float64 MaxInputTokens int64 MaxOutputTokens int64 MaxTotalTokens int64 BaseCostPerSecond float64 BaseCostPerGBProcessed float64 BaseCostPerGBStored float64 SupportsBatching bool BatchSizeLimit int64 BaseCostPerBatch float64 RateLimitPerMinute int64 RateLimitPerDay int64 ProfitMarginPercentage float64 MinimumProfitAmount float64 PeakHoursMultiplier float64 VolumeDiscountThreshold int64 VolumeDiscountPercentage float64 Currency string IsActive bool }
type User ¶
type User struct { ID int64 UID string Balance int64 LastAirdropAt time.Time TotalTokensAirdrop int64 }
func (*User) InitBalance ¶
Init sets the user's balance to the given value. If the user does not exist, it creates a new user.
Click to show internal directories.
Click to hide internal directories.