helpers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func DisplayInVim

func DisplayInVim(content string, filetype string) error

func DoesConfigFileExists

func DoesConfigFileExists() bool

func GetConfigFilePath

func GetConfigFilePath() string

func GetLlmKey

func GetLlmKey(llmName string) (string, error)

func IsLighthouseInstalled

func IsLighthouseInstalled() bool

func IsNodeInstalled

func IsNodeInstalled() bool

func IsPa11yInstalled

func IsPa11yInstalled() bool

func ParseGeminiOutput

func ParseGeminiOutput(input string) string

func QueryGemini

func QueryGemini(apiKey string, prompt string) (string, error)

func QueryHuggingFace

func QueryHuggingFace(apiKey, modelName, prompt string) (string, error)

func WriteToConfigFile

func WriteToConfigFile(config ConfigFile) error

Types

type Candidate

type Candidate struct {
	Content Content
}

type ConfigFile

type ConfigFile struct {
	Default Llm         `json:"default" mapstructure:"default"`
	Llms    []LlmConfig `json:"llms" mapstructure:"llms"`
}

func ReadConfigFile

func ReadConfigFile() (ConfigFile, error)

type Content

type Content struct {
	Parts []Part `json:"parts"`
}

type GeminiReqPayload

type GeminiReqPayload struct {
	Contents []Content `json:"contents"`
}

type GeminiResp

type GeminiResp struct {
	Candidates []Candidate `json:"candidates"`
}

type LighthouseAudit

type LighthouseAudit struct {
	Id           string   `json:"id"`
	Score        *float64 `json:"score"`
	NumericValue float64  `json:"numericValue"`
	NumericUnit  string   `json:"numericUnit"`
}

type LighthouseReport

type LighthouseReport struct {
	Audits map[string]LighthouseAudit `json:"audits"`
}

func GenerateLighthouseReport

func GenerateLighthouseReport(website string) (LighthouseReport, error)

type Llm

type Llm string
var (
	Gemini  Llm = "gemini"
	Mistral Llm = "mistral"
	Llama   Llm = "llama"
	Claude  Llm = "claude"
	Chatgpt Llm = "chatgpt"
	Qwen    Llm = "qwen"
)

type LlmConfig

type LlmConfig struct {
	Name   Llm    `json:"name" mapstructure:"name"`
	ApiKey string `json:"api_key" mapstructure:"api_key"`
}

type Pa11yOutputErr

type Pa11yOutputErr struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Context string `json:"context"`
}

func GeneratePa11yReport

func GeneratePa11yReport(website string) ([]Pa11yOutputErr, error)

type Part

type Part struct {
	Text string `json:"text"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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