Documentation
¶
Index ¶
- Constants
- func DryRun(filePath, tool string) ([]string, error)
- func GetRecommendations(resourceType string, unusedAttrs []string, model string, tool string, ...) (string, error)
- func PrettyPrint(markdownContent string)
- func Run(filePath, tool, model, prompt, addr string) error
- func ValidateModel(model, addr string) error
- type LlamaRequest
- type LlamaResponse
- type Model
- type ModelsResponse
- type ProviderSchema
- type Resource
Constants ¶
const ( ColorReset = "\033[0m" ColorGreen = "\033[32m" ColorBold = "\033[1m" )
ANSI color codes
Variables ¶
This section is empty.
Functions ¶
func DryRun ¶ added in v1.2.0
DryRun checks the provided file for unused attributes based on a provider schema.
func GetRecommendations ¶
func GetRecommendations(resourceType string, unusedAttrs []string, model string, tool string, prompt string, addr string) (string, error)
GetRecommendations generates recommendations based on unused attributes and a model.
func PrettyPrint ¶ added in v1.0.0
func PrettyPrint(markdownContent string)
PrettyPrint formats and displays markdown content with styled headers and recommendations. It applies custom styling using lipgloss and renders markdown using glamour. The output includes a header, the rendered markdown content, and a footer.
func ValidateModel ¶ added in v0.3.0
ValidateModel checks if the specified model exists in Ollama
Types ¶
type LlamaRequest ¶
type LlamaRequest struct { Model string `json:"model"` Prompt string `json:"prompt"` Stream bool `json:"stream"` }
LlamaRequest represents a request to the Llama API
type LlamaResponse ¶
type LlamaResponse struct {
Recommendations string `json:"response"`
}
LlamaResponse represents a response from the Llama API
type Model ¶ added in v0.3.0
type Model struct {
Name string `json:"name"`
}
Model represents the structure of a model in the response
type ModelsResponse ¶ added in v0.3.0
type ModelsResponse struct {
Models []Model `json:"models"`
}
ModelsResponse represents the structure of the response from /api/tags
type ProviderSchema ¶
func ExtractOpenTofuProviderSchema ¶ added in v0.6.0
func ExtractOpenTofuProviderSchema(rootDir string) (ProviderSchema, error)
func ExtractTerraformProviderSchema ¶ added in v0.6.0
func ExtractTerraformProviderSchema(rootDir string) (ProviderSchema, error)