LLMIFY THIS MOFO
CI / Test (push) Successful in 44s

This commit is contained in:
2026-09-01 01:49:40 -04:00
parent dad09d1109
commit 4426af63cb
19 changed files with 388 additions and 56 deletions
+6
View File
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log"
"strings"
"time"
"github.com/sashabaranov/go-openai"
@@ -17,6 +18,11 @@ type OpenAIAdapter struct {
// NewOpenAIAdapter creates a new OpenAI LLM adapter
func NewOpenAIAdapter(cfg Config) *OpenAIAdapter {
if cfg.BaseURL != "" {
clientConfig := openai.DefaultConfig(cfg.APIKey)
clientConfig.BaseURL = strings.TrimRight(cfg.BaseURL, "/") + "/v1"
return &OpenAIAdapter{client: openai.NewClientWithConfig(clientConfig), config: cfg}
}
return &OpenAIAdapter{
client: openai.NewClient(cfg.APIKey),
config: cfg,