package main
import (
"context"
"fmt"
"log"
"github.com/curaious/uno/pkg/gateway"
"github.com/curaious/uno/pkg/llm"
"github.com/curaious/uno/pkg/sdk"
)
func main() {
// Define multiple API keys for OpenAI with different weights
openAIConfig := &gateway.ProviderConfig{
ProviderName: llm.ProviderNameOpenAI,
ApiKeys: []*gateway.APIKeyConfig{
{
APIKey: "sk-openai-key-1",
Weight: 70, // This key will be used ~70% of the time
},
{
APIKey: "sk-openai-key-2",
Weight: 30, // This key will be used ~30% of the time
},
},
}
// Initialize the config store
configStore := sdk.NewInMemoryConfigStore([]*gateway.ProviderConfig{openAIConfig})
// Create the Uno client
uno, err := sdk.New(&sdk.ClientOptions{
LLMConfigs: configStore,
})
if err != nil {
log.Fatalf("failed to create uno client: %v", err)
}
}