providers

package
v0.39.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package providers contains shared functionality for LLM provider clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDefaults

func ApplyDefaults(config any) error

ApplyDefaults applies default values to common configuration fields. It sets TimeoutSeconds to 30 if it's zero, and MaxTokens to 1000 if it's zero.

func BuildPrompt

func BuildPrompt(request *ltypes.AnalysisRequest) (string, error)

BuildPrompt combines the base prompt with context data. This function is shared across all LLM providers to ensure consistent prompt formatting.

func ValidateBaseURL

func ValidateBaseURL(baseURL string) error

ValidateBaseURL validates that the provided baseURL is a valid HTTP/HTTPS URL.

func ValidateCommonConfig

func ValidateCommonConfig(config any) error

ValidateCommonConfig validates common configuration fields. It checks that the API key is provided and that numeric fields are non-negative.

Types

type CommonConfig

type CommonConfig struct {
	APIKey         string
	TimeoutSeconds int
	MaxTokens      int
}

CommonConfig represents the common configuration fields across all LLM providers.

Directories

Path Synopsis
Package gemini is the Client implementation for Google Gemini LLM integration.
Package gemini is the Client implementation for Google Gemini LLM integration.
Package openai is the Client implementation for OpenAI LLM integration.
Package openai is the Client implementation for OpenAI LLM integration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL