Documentation
¶
Index ¶
- Constants
- func CreateTempDbtProfiles(t *testing.T) string
- func CreateTempSourceTables() shared.SourceTables
- func Deduplicate(elements []string) []string
- func InferColumnFields(llm Llm, ts shared.SourceTables)
- func PrepBuildDir(bd string) error
- func SetConnectionDetails(fr FormResponse, ps DbtProfiles) shared.ConnectionDetails
- func WriteFiles(ts shared.SourceTables, bd string, prefix string) error
- func WriteProfile(cd shared.ConnectionDetails, bd string)
- func WriteScaffoldProject(cd shared.ConnectionDetails, bd string, pn string) (string, error)
- func WriteStagingModels(ts shared.SourceTables, buildDir string, prefix string)
- func WriteYAML(tables shared.SourceTables, buildDir string)
- type Anthropic
- func (a *Anthropic) GetRateLimiter() (semaphore chan struct{}, limiter *time.Ticker)
- func (a *Anthropic) GetResponse(prompt string) error
- func (a *Anthropic) SetDescription(descPrompt string, ts shared.SourceTables, i, j int) error
- func (a *Anthropic) SetTests(testsPrompt string, ts shared.SourceTables, i, j int) error
- type DbtProfile
- type DbtProfiles
- type FormResponse
- type Groq
- func (g *Groq) GetRateLimiter() (semaphore chan struct{}, limiter *time.Ticker)
- func (o *Groq) GetResponse(prompt string) error
- func (g *Groq) SetDescription(descPrompt string, ts shared.SourceTables, i, j int) error
- func (g *Groq) SetTests(testsPrompt string, ts shared.SourceTables, i, j int) error
- type Llm
- type Message
- type OpenAI
- func (o *OpenAI) GetRateLimiter() (semaphore chan struct{}, limiter *time.Ticker)
- func (o *OpenAI) GetResponse(prompt string) error
- func (o *OpenAI) SetDescription(descPrompt string, ts shared.SourceTables, i, j int) error
- func (o *OpenAI) SetTests(testsPrompt string, ts shared.SourceTables, i, j int) error
- type Payload
Constants ¶
View Source
const ( DESC_PROMPT = `` /* 1277-byte string literal not displayed */ TESTS_PROMPT = `` /* 1059-byte string literal not displayed */ )
View Source
const VERSION = "0.0.28"
Variables ¶
This section is empty.
Functions ¶
func CreateTempDbtProfiles ¶
func CreateTempSourceTables ¶
func CreateTempSourceTables() shared.SourceTables
func Deduplicate ¶
func InferColumnFields ¶
func InferColumnFields(llm Llm, ts shared.SourceTables)
func PrepBuildDir ¶
func SetConnectionDetails ¶
func SetConnectionDetails(fr FormResponse, ps DbtProfiles) shared.ConnectionDetails
func WriteFiles ¶
func WriteFiles(ts shared.SourceTables, bd string, prefix string) error
func WriteProfile ¶
func WriteProfile(cd shared.ConnectionDetails, bd string)
func WriteScaffoldProject ¶
func WriteStagingModels ¶
func WriteStagingModels(ts shared.SourceTables, buildDir string, prefix string)
func WriteYAML ¶
func WriteYAML(tables shared.SourceTables, buildDir string)
Types ¶
type Anthropic ¶
type Anthropic struct {
Type string
ApiKey string
Model string
Url string
Response struct {
Content []struct {
Type string `json:"type"`
Text string `json:"text"`
} `json:"content"`
Id string `json:"id"`
Type string `json:"type"`
Role string `json:"role"`
StopReason string `json:"stop_reason"`
StopSequence []string `json:"stop_sequence"`
Usage struct {
InputTokens int `json:"input_tokens"`
OutputToken int `json:"output_tokens"`
} `json:"usage"`
}
}
func (*Anthropic) GetRateLimiter ¶
func (*Anthropic) GetResponse ¶
func (*Anthropic) SetDescription ¶
type DbtProfile ¶
type DbtProfile struct {
Outputs map[string]struct {
Settings map[string]struct {
S3Region string `yaml:"s3_region"`
S3AccessKeyID string `yaml:"s3_access_key_id"`
S3SecretAccessKey string `yaml:"s3_secret_access_key"`
} `yaml:"settings"`
DataprocBatch map[string]interface{} `yaml:"dataproc_batch"`
KeyfileJson map[string]struct {
Type string `yaml:"type"`
ProjectId string `yaml:"project_id"`
PrivateKeyId string `yaml:"private_key_id"`
PrivateKey string `yaml:"private_key"`
ClientEmail string `yaml:"client_email"`
ClientId string `yaml:"client_id"`
AuthURI string `yaml:"auth_uri"`
TokenURI string `yaml:"token_uri"`
AuthProviderX509CertUrl string `yaml:"auth_provider_x509_cert_url"`
ClientX509CertUrl string `yaml:"client_x509_cert_url"`
} `yaml:"keyfile_json"`
PrivateKeyPath string `yaml:"private_key_path"`
DbName string `yaml:"dbname"`
Database string `yaml:"database"`
Account string `yaml:"account"`
Schema string `yaml:"schema"`
QueryTag string `yaml:"query_tag"`
Dataset string `yaml:"dataset"`
Path string `yaml:"path"`
Role string `yaml:"role"`
Password string `yaml:"password"`
User string `yaml:"user"`
Warehouse string `yaml:"warehouse"`
Method string `yaml:"method"`
Host string `yaml:"host"`
PrivateKey string `yaml:"private_key"`
Location string `yaml:"location"`
ConnType string `yaml:"type"`
Authenticator string `yaml:"authenticator"`
Project string `yaml:"project"`
SslMode string `yaml:"sslmode"`
DataprocClusterName string `yaml:"dataproc_cluster_name"`
DataprocRegion string `yaml:"dataproc_region"`
GcsBucket string `yaml:"gcs_bucket"`
ExecutionProject string `yaml:"execution_project"`
PrivateKeyPassphrase string `yaml:"private_key_passphrase"`
RefreshToken string `yaml:"refresh_token"`
ClientID string `yaml:"client_id"`
ClientSecret string `yaml:"client_secret"`
TokenURI string `yaml:"token_uri"`
Token string `yaml:"token"`
Priority string `yaml:"priority"`
Keyfile string `yaml:"keyfile"`
ImpersonateServiceAccount string `yaml:"impersonate_service_account"`
HttpPath string `yaml:"http_path"`
Extensions []string `yaml:"extensions"`
Scopes []string `yaml:"scopes"`
JobCreationTimeoutSeconds int `yaml:"job_creation_timeout_seconds"`
MaximumBytesBilled int `yaml:"maximum_bytes_billed"`
JobRetryDeadlineSeconds int `yaml:"job_retry_deadline_seconds"`
JobExecutionTimeoutSeconds int `yaml:"job_execution_timeout_seconds"`
ConnectTimeout int `yaml:"connect_timeout"`
ConnectRetries int `yaml:"connect_retries"`
Port int `yaml:"port"`
Threads int `yaml:"threads"`
ReuseConnections bool `yaml:"reuse_connections"`
RetryAll bool `yaml:"retry_all"`
RetryOnDatabaseErrors bool `yaml:"retry_on_database_errors"`
ClientSessionKeepAlive bool `yaml:"client_session_keep_alive"`
} `yaml:"outputs"`
Target string `yaml:"target"`
}
func GetDbtProfile ¶
func GetDbtProfile(pn string, ps DbtProfiles) (DbtProfile, error)
type DbtProfiles ¶
type DbtProfiles map[string]DbtProfile
func FetchDbtProfiles ¶
func FetchDbtProfiles() (DbtProfiles, error)
type FormResponse ¶
type FormResponse struct {
Password string
Host string
BuildDir string
SslMode string
Database string
Schema string
Project string
Dataset string
ProjectName string
Warehouse string
Account string
LlmKeyEnvVar string
DbtProfileOutput string
DbtProfileName string
Path string
Port string
TokenEnvVar string
HttpPath string
Username string
Prefix string
Llm string
GenerateDescriptions bool
ScaffoldProject bool
CreateProfile bool
UseDbtProfile bool
Confirm bool
}
func Forms ¶
func Forms(ps DbtProfiles) (FormResponse, error)
type Groq ¶
type Groq struct {
Type string
ApiKey string
Model string
Url string
Response struct {
SystemFingerprint interface{} `json:"system_fingerprint"`
Id string `json:"id"`
Object string `json:"object"`
Model string `json:"model"`
Choices []struct {
Logprobs interface{} `json:"logprobs"`
Message Message `json:"message"`
FinishReason string `json:"finish_reason"`
Index int `json:"index"`
} `json:"choices"`
Usage struct {
PromptTokens int `json:"prompt_tokens"`
PromptTime float64 `json:"prompt_time"`
CompletionTokens int `json:"completion_tokens"`
CompletionTime float64 `json:"completion_time"`
TotalTokens int `json:"total_tokens"`
TotalTime float64 `json:"total_time"`
} `json:"usage"`
Created int `json:"created"`
}
}
func (*Groq) GetRateLimiter ¶
func (*Groq) GetResponse ¶
func (*Groq) SetDescription ¶
type Llm ¶
type Llm interface {
GetResponse(prompt string) error
SetDescription(descPrompt string, ts shared.SourceTables, i, j int) error
SetTests(descPrompt string, ts shared.SourceTables, i, j int) error
GetRateLimiter() (chan struct{}, *time.Ticker)
}
func GetLlm ¶
func GetLlm(fr FormResponse) (Llm, error)
type OpenAI ¶
type OpenAI struct {
Type string
ApiKey string
Model string
Url string
Response struct {
SystemFingerprint interface{} `json:"system_fingerprint"`
Id string `json:"id"`
Object string `json:"object"`
Model string `json:"model"`
Choices []struct {
Logprobs interface{} `json:"logprobs"`
Message Message `json:"message"`
FinishReason string `json:"finish_reason"`
Index int `json:"index"`
} `json:"choices"`
Usage struct {
PromptTokens int `json:"prompt_tokens"`
PromptTime float64 `json:"prompt_time"`
CompletionTokens int `json:"completion_tokens"`
CompletionTime float64 `json:"completion_time"`
TotalTokens int `json:"total_tokens"`
TotalTime float64 `json:"total_time"`
} `json:"usage"`
Created int `json:"created"`
}
}
func (*OpenAI) GetRateLimiter ¶
func (*OpenAI) GetResponse ¶
func (*OpenAI) SetDescription ¶
Source Files
¶
- fetch_dbt_profiles.go
- forms.go
- get_dbt_profile.go
- llm_get_llm.go
- llm_get_rate_limiter.go
- llm_get_response.go
- llm_infer_column_fields.go
- llm_prompts.go
- llm_set_description.go
- llm_set_tests.go
- prep_build_dir.go
- set_connection_details.go
- test_helpers.go
- version.go
- write_files.go
- write_profile.go
- write_scaffold_project.go
- write_staging_models.go
- write_yaml.go
Click to show internal directories.
Click to hide internal directories.