Documentation
¶
Index ¶
- func ValidationErrorCount(err error) int
- type FieldDef
- type GeminiOption
- type KeyDef
- type Maker
- func (m *Maker) AddPredictableKeys(keys ...KeyDef) *Maker
- func (m *Maker) Generate() (string, error)
- func (m *Maker) LastProvider() string
- func (m *Maker) LastResult() string
- func (m *Maker) MaxRetries(n int) *Maker
- func (m *Maker) OptionalPrompt(p string) *Maker
- func (m *Maker) PredictableKeys(keys ...KeyDef) *Maker
- func (m *Maker) Run(output string) error
- func (m *Maker) Source(path string) *Maker
- func (m *Maker) UnpredictableKeys() []string
- func (m *Maker) UnpredictableObjects() []UnpredictableObject
- type Message
- type OpenAIOption
- func WithOpenAIAPIKey(k string) OpenAIOption
- func WithOpenAIBaseURL(u string) OpenAIOption
- func WithOpenAIMaxTokens(n int) OpenAIOption
- func WithOpenAIModel(m string) OpenAIOption
- func WithOpenAIStream(s bool) OpenAIOption
- func WithOpenAITemperature(t float64) OpenAIOption
- func WithOpenAITimeout(d time.Duration) OpenAIOption
- type Provider
- type UnpredictableObject
- type VarType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidationErrorCount ¶
Types ¶
type FieldDef ¶
type GeminiOption ¶
type GeminiOption func(*geminiConfig)
func WithAPIKey ¶
func WithAPIKey(k string) GeminiOption
func WithModel ¶
func WithModel(m string) GeminiOption
func WithStream ¶
func WithStream(s bool) GeminiOption
func WithTemperature ¶
func WithTemperature(t float64) GeminiOption
func WithTimeout ¶
func WithTimeout(d time.Duration) GeminiOption
type KeyDef ¶
type Maker ¶
type Maker struct {
// contains filtered or unexported fields
}
func (*Maker) AddPredictableKeys ¶
func (*Maker) LastProvider ¶ added in v0.2.3
func (*Maker) LastResult ¶
func (*Maker) MaxRetries ¶
func (*Maker) OptionalPrompt ¶
func (*Maker) PredictableKeys ¶
func (*Maker) UnpredictableKeys ¶
func (*Maker) UnpredictableObjects ¶
func (m *Maker) UnpredictableObjects() []UnpredictableObject
type OpenAIOption ¶
type OpenAIOption func(*openAIConfig)
func WithOpenAIAPIKey ¶
func WithOpenAIAPIKey(k string) OpenAIOption
func WithOpenAIBaseURL ¶
func WithOpenAIBaseURL(u string) OpenAIOption
func WithOpenAIMaxTokens ¶ added in v0.2.3
func WithOpenAIMaxTokens(n int) OpenAIOption
func WithOpenAIModel ¶
func WithOpenAIModel(m string) OpenAIOption
func WithOpenAIStream ¶
func WithOpenAIStream(s bool) OpenAIOption
func WithOpenAITemperature ¶ added in v0.2.3
func WithOpenAITemperature(t float64) OpenAIOption
func WithOpenAITimeout ¶ added in v0.2.3
func WithOpenAITimeout(d time.Duration) OpenAIOption
type Provider ¶
type Provider interface {
Name() string
GenerateWithFile(ctx context.Context, prompt string, filename string, data []byte) (string, error)
GenerateWithHistory(ctx context.Context, history []Message, prompt string) (string, error)
}
func Gemini ¶
func Gemini(opts ...GeminiOption) Provider
func OpenAI ¶
func OpenAI(opts ...OpenAIOption) Provider
type UnpredictableObject ¶
Click to show internal directories.
Click to hide internal directories.