Versions in this module Expand all Collapse all v0 v0.2.1 Jan 31, 2025 v0.2.0 Jan 9, 2025 v0.1.9 Jan 9, 2025 v0.1.8 Jan 9, 2025 Changes in this version + func PrintModelMenu(p *util.Printer, title string, models []string, defaultModels []string) + type APITester interface + PrintResults func([]TestResult) error + TestAllApis func([]*Channel) []TestResult + TestAllChannels func(context.Context, []*TestConfig) []TestResult + TestChannel func(context.Context, *TestConfig) TestResult + func NewApiTest(maxConcurrency int, opts ...ChannelTestOption) APITester + type Channel struct + Key string + TestModel []string + Type ChannelType + URL string + type ChannelTest struct + func NewChannelTest(maxConcurrency int, w io.Writer) *ChannelTest + func (ct *ChannelTest) PrintResults(results []TestResult) error + func (ct *ChannelTest) TestAllApis(channels []*Channel) []TestResult + func (ct *ChannelTest) TestAllChannels(ctx context.Context, configs []*TestConfig) []TestResult + func (ct *ChannelTest) TestChannel(ctx context.Context, cfg *TestConfig) TestResult + type ChannelTestConfig struct + MaxConcurrency int + ResultBuffer int + Timeout time.Duration + func DefaultConfig() *ChannelTestConfig + type ChannelTestOption func(*ChannelTest) + func WithClient(client HTTPClient) ChannelTestOption + func WithConfig(config *ChannelTestConfig) ChannelTestOption + func WithPrinter(printer *util.Printer) ChannelTestOption + func WithRequestBuilder(builder RequestBuilder) ChannelTestOption + func WithResultProcessor(processor ResultProcessor) ChannelTestOption + type ChannelType int + const ChannelTypeGemini + const ChannelTypeOpenAI + type DefaultRequestBuilder struct + func NewRequestBuilder() *DefaultRequestBuilder + func (b *DefaultRequestBuilder) BuildRequest(ctx context.Context, cfg *TestConfig) (*http.Request, error) + type DefaultResultProcessor struct + func (p *DefaultResultProcessor) ProcessResponse(resp *http.Response) TestResult + type GeminiError struct + Error struct{ ... } + type HTTPClient interface + Do func(*http.Request) (*http.Response, error) + type Message struct + Content string + Role string + type OpenAIError struct + Error struct{ ... } + type OpenAIRequest struct + MaxCompletionTokens int + MaxTokens int + Messages []Message + Model string + Stream bool + type OpenAIResponse struct + Usage *Usage + type RequestBuilder interface + BuildRequest func(context.Context, *TestConfig) (*http.Request, error) + type RequestOptions struct + MaxTokens int + Stream bool + Temperature float64 + TopK int + TopP float64 + type ResultProcessor interface + ProcessResponse func(*http.Response) TestResult + func NewResultProcessor(key, model string) ResultProcessor + type TestConfig struct + Channel *Channel + IsGemini bool + Model string + RequestOpts RequestOptions + type TestResult struct + Channel *Channel + Error error + Latency float64 + Model string + Response interface{} + Success bool + type Usage struct + CompletionTokens int + PromptTokens int + TotalTokens int