NewOpenAIProvider constructs the provider. The SDK reads OPENAI_API_KEY from the environment by default; pass option.WithAPIKey if you need to override.
(model, system string, maxTokens int64)
| 32 | // from the environment by default; pass option.WithAPIKey if you need to |
| 33 | // override. |
| 34 | func NewOpenAIProvider(model, system string, maxTokens int64) *OpenAIProvider { |
| 35 | return &OpenAIProvider{ |
| 36 | client: openai.NewClient(), |
| 37 | model: model, |
| 38 | system: system, |
| 39 | maxTokens: maxTokens, |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | func (p *OpenAIProvider) Model() string { |
| 44 | p.mu.Lock() |