Documentation
¶
Overview ¶
Package llm provides interfaces and implementations for LLM interactions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenAIProvider ¶ added in v0.7.1
type OpenAIProvider struct {
// contains filtered or unexported fields
}
OpenAIProvider calls the OpenAI chat completions API.
func NewOpenAIProvider ¶ added in v0.7.1
func NewOpenAIProvider(apiKey, model string) *OpenAIProvider
NewOpenAIProvider creates an LLM provider that calls OpenAI.
type Provider ¶
type Provider interface {
// Complete sends a conversation to the LLM and returns its response.
Complete(ctx context.Context, messages []Message) (*Response, error)
}
Provider is the interface for completing LLM conversations.
type StubProvider ¶
type StubProvider struct {
// contains filtered or unexported fields
}
StubProvider returns configurable responses for testing.
func NewStubProvider ¶
func NewStubProvider(responses ...string) *StubProvider
NewStubProvider creates a stub provider that cycles through the given responses. If no responses are provided, it returns an empty string.
func (*StubProvider) CallCount ¶
func (s *StubProvider) CallCount() int
CallCount returns the number of times Complete was called.
Click to show internal directories.
Click to hide internal directories.