createGroqProvider function

GroqProvider createGroqProvider({
  1. required String apiKey,
  2. String? model,
  3. String? baseUrl,
  4. int? maxTokens,
  5. double? temperature,
  6. String? systemPrompt,
  7. Duration? timeout,
  8. bool? stream,
  9. double? topP,
  10. int? topK,
  11. List<Tool>? tools,
  12. ToolChoice? toolChoice,
})

Create a Groq provider with default configuration

Implementation

GroqProvider createGroqProvider({
  required String apiKey,
  String? model,
  String? baseUrl,
  int? maxTokens,
  double? temperature,
  String? systemPrompt,
  Duration? timeout,
  bool? stream,
  double? topP,
  int? topK,
  List<Tool>? tools,
  ToolChoice? toolChoice,
}) {
  final config = GroqConfig(
    apiKey: apiKey,
    model: model ?? 'llama-3.3-70b-versatile',
    baseUrl: baseUrl ?? 'https://api.groq.com/openai/v1/',
    maxTokens: maxTokens,
    temperature: temperature,
    systemPrompt: systemPrompt,
    timeout: timeout,
    topP: topP,
    topK: topK,
    tools: tools,
    toolChoice: toolChoice,
  );

  return GroqProvider(config);
}