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, mode ConnectionMode) error
- type ConnectionMode
- type Purchase
- type Receipt
- type SearchOption
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var D *sql.DB
Functions ¶
func SearchExamples ¶
Types ¶
type ConnectionMode ¶ added in v0.0.4
type ConnectionMode string
const ( ModeCloud ConnectionMode = "cloud" ModeReplica ConnectionMode = "replica" )
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 }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.