Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LLM ¶
type LLM interface { Generate(...string) (LLMResult, error) GenerateWithContext(context.Context, ...string) (LLMResult, error) GenerateWithOptions(context.Context, LLMOptions) (LLMResult, error) GenerateStream(io.Writer, ...string) (LLMResult, error) GenerateStreamWithContext(context.Context, io.Writer, ...string) (LLMResult, error) GenerateStreamWithOptions(context.Context, io.Writer, LLMOptions) (LLMResult, error) }
type LLMGeneration ¶
type LLMOptions ¶
type LLMOptions interface { GetRequest() interface{} WithPrompt(any) LLMOptions WithModel(model string) LLMOptions WithMaxTokens(maxTokens int) LLMOptions WithTemperature(temperature float32) LLMOptions WithTopP(topP float32) LLMOptions WithN(n int) LLMOptions WithStream(stream bool) LLMOptions WithStop(stop []string) LLMOptions WithPresencePenalty(presencePenalty float32) LLMOptions WithFrequencyPenalty(frequencyPenalty float32) LLMOptions WithLogitBias(logitBias map[string]int) LLMOptions WithUser(user string) LLMOptions GetPrompt() []string WithTimeout(time.Duration) LLMOptions GetTimeout() time.Duration }
type LLMResult ¶
type LLMResult struct { Generations []LLMGeneration Usage LLMUsage Cost LLMCost }
func (*LLMResult) CalculateCosts ¶
Click to show internal directories.
Click to hide internal directories.