package
0.2.0
Repository: https://github.com/mgla96/snappr.git
Documentation: pkg.go.dev

# README

config

import "github.com/Mgla96/snappr/internal/config"

Package config is the singular place where configuration is loaded and parsed.

Index

Constants

const (
    DefaultConfig = ""
)

ServicePrefix - imagery producer specific env vars have this prefix

const ServicePrefix = "PR"

type Config

Config contains all config parameters for the service

type Config struct {
    Log    Log         `required:"true"`
    Github Github      `required:"true"`
    LLM    LLM         `required:"true"`
    Input  InputConfig `required:"true"`
}

func New

func New() (*Config, error)

New returns the parsed config from the environment.

type Github

type Github struct {
    Token string `required:"true"`
    Owner string `required:"true"`
    Repo  string `required:"true"`
}

type InputConfig

type InputConfig struct {
    KnowledgeSources []KnowledgeSource `mapstructure:"knowledgeSources"`
    PromptWorkflows  []PromptWorkflow  `mapstructure:"promptWorkflows"`
}

type KnowledgeSource

type KnowledgeSource struct {
    Name  string              `mapstructure:"name"`
    Type  KnowledgeSourceType `mapstructure:"type"`
    Value string              `mapstructure:"value"`
}

type KnowledgeSourceType

type KnowledgeSourceType string

const (
    KnowledgeSourceTypeFile KnowledgeSourceType = "file"
    KnowledgeSourceTypeURL  KnowledgeSourceType = "url"
    KnowledgeSourceTypeAPI  KnowledgeSourceType = "api"
    KnowledgeSourceTypeText KnowledgeSourceType = "text"
)

type LLM

type LLM struct {
    Token        string            `required:"true"`
    DefaultModel clients.ModelType `default:"gpt-4-turbo"`
    Endpoint     string
    APIType      clients.APIType `default:"openai"`
    Retries      int             `default:"3"`
}

type Log

Log level config

type Log struct {
    Level zerolog.Level `default:"info"`
}

type PromptWorkflow

type PromptWorkflow struct {
    Name  string               `mapstructure:"name"`
    Steps []PromptWorkflowStep `mapstructure:"steps"`
}

type PromptWorkflowStep

type PromptWorkflowStep struct {
    Prompt      string `mapstructure:"prompt"`
    InputSource string `mapstructure:"inputSource"`
}

Generated by gomarkdoc

# Functions

New returns the parsed config from the environment.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ServicePrefix - imagery producer specific env vars have this prefix.

# Structs

Config contains all config parameters for the service.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Log level config.
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author