groq.go

 1// Package groq provides a Fantasy provider for the Groq API.
 2package groq
 3
 4import (
 5	"charm.land/fantasy"
 6	"charm.land/fantasy/providers/openaicompat"
 7)
 8
 9const (
10	// Name is the provider identifier for Groq.
11	Name = "groq"
12	// BaseURL is the default Groq API base URL.
13	BaseURL = "https://api.groq.com/openai/v1"
14)
15
16// Option configures the Groq provider via OpenAI-compatible options.
17type Option = openaicompat.Option
18
19// New creates a new Groq provider using OpenAI-compatible transport/options.
20func New(opts ...Option) (fantasy.Provider, error) {
21	options := []Option{
22		openaicompat.WithName(Name),
23		openaicompat.WithBaseURL(BaseURL),
24	}
25	options = append(options, opts...)
26	return openaicompat.New(options...)
27}