Documentation
¶
Index ¶
- func CreateMessageContent(r *http.Request, cfg *config.Config, provider string) ([]llms.MessageContent, error)
- func GenerateLLMResponse(ctx context.Context, model llms.Model, temperature float64, ...) (string, error)
- func New(ctx context.Context, config Config) (llms.Model, error)
- func ValidateJSON(jsonStr string) error
- type Config
- type JSONResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMessageContent ¶
func CreateMessageContent(r *http.Request, cfg *config.Config, provider string) ([]llms.MessageContent, error)
CreateMessageContent creates the message content to be processed by the LLM.
func GenerateLLMResponse ¶
func GenerateLLMResponse(ctx context.Context, model llms.Model, temperature float64, messages []llms.MessageContent) (string, error)
GenerateLLMResponse generates a response from the LLM using the input message.
func ValidateJSON ¶
ValidateJSON validates the JSON structure of the input.
Types ¶
type Config ¶
type Config struct { APIKey string CloudLocation string CloudProject string Model string Provider string ServerURL string Temperature float64 }
Config holds configuration settings for the LLM.
type JSONResponse ¶
type JSONResponse struct { Headers map[string]string `json:"headers" validate:"required"` Body string `json:"body" validate:"required"` }
JSONResponse defines the expected JSON response from the LLM.
Click to show internal directories.
Click to hide internal directories.