GetClient returns the generative client based on the platform
(ctx context.Context, p core.Platform)
| 198 | |
| 199 | // GetClient returns the generative client based on the platform |
| 200 | func GetClient(ctx context.Context, p core.Platform) (core.Generative, error) { |
| 201 | switch p { |
| 202 | case core.Gemini: |
| 203 | return NewGemini(ctx) |
| 204 | case core.OpenAI, core.Azure: |
| 205 | return NewOpenAI(ctx) |
| 206 | case core.Anthropic: |
| 207 | return NewAnthropic(ctx) |
| 208 | } |
| 209 | return nil, errors.New("invalid provider") |
| 210 | } |
no test coverage detected