Documentation
¶
Index ¶
- Variables
- func CostAndUsageToCSVMapper(sortFn func(r map[int]model.Service) []..., r model.CostAndUsageOutputType) error
- func CostAndUsageToChartMapper(sortFn func(r map[int]model.Service) []..., r model.CostAndUsageOutputType) error
- func CostAndUsageToStdoutMapper(sortFn func(r map[int]model.Service) []..., r model.CostAndUsageOutputType) error
- func CostAndUsageToVectorMapper(r model.CostAndUsageOutputType) error
- func CostUsageToRows(s []model.Service, granularity string) model.CostAndUsage
- func CreateTitle(dimension string) string
- func ForecastToRows(r model.ForecastStdoutType) []table.Row
- func ForecastToStdoutMapper(r model.ForecastPrintData, dimensions []string)
- func NewCSVFile(dir string, file string) (*os.File, error)
- func NewCSVWriter(f io.Writer, header []string) (*csv.Writer, error)
- func NewStdoutWriter(variant string) (model.Table, error)
- func PopulatePieDate(services []model.Service, key int) []...
- func WriteToCSV(f *os.File, header []string, rows [][]string) error
- func WriteToChart(p *components.Page) error
- type Builder
- type ChartPrinter
- type CostAndUsageTable
- type CsvPrinter
- type ForecastTable
- type OpenAIPrinter
- type PineconePrinter
- type Printer
- type StdoutPrinter
- type VectorStore
- type VectorStoreClient
- func (v *VectorStoreClient) CreateEmbeddings(items []*model.VectorStoreItem) ([]gogpt.Embedding, error)
- func (v *VectorStoreClient) CreateVectorStoreInput(r ...) ([]*model.VectorStoreItem, error)
- func (v *VectorStoreClient) Upsert(context context.Context, items []pinecone.PineconeStruct) (resp model.UpsertResponse, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
OutputDir = "./output"
)
Functions ¶
func CostAndUsageToCSVMapper ¶
func CostAndUsageToVectorMapper ¶
func CostAndUsageToVectorMapper(r model.CostAndUsageOutputType) error
func CostUsageToRows ¶
func CostUsageToRows(s []model.Service, granularity string) model.CostAndUsage
func CreateTitle ¶
func ForecastToRows ¶
func ForecastToRows(r model.ForecastStdoutType) []table.Row
func ForecastToStdoutMapper ¶
func ForecastToStdoutMapper(r model.ForecastPrintData, dimensions []string)
func WriteToChart ¶
func WriteToChart(p *components.Page) error
Types ¶
type ChartPrinter ¶
type ChartPrinter struct {
Variant string
}
func (*ChartPrinter) Write ¶
func (p *ChartPrinter) Write(f interface{}, c interface{}) error
type CostAndUsageTable ¶
func (CostAndUsageTable) AddRows ¶
func (c CostAndUsageTable) AddRows(rows []table.Row)
func (CostAndUsageTable) Footer ¶
func (c CostAndUsageTable) Footer(row table.Row)
func (CostAndUsageTable) Header ¶
func (c CostAndUsageTable) Header()
func (CostAndUsageTable) Style ¶
func (c CostAndUsageTable) Style()
func (CostAndUsageTable) Writer ¶
func (c CostAndUsageTable) Writer(output interface{})
type CsvPrinter ¶
type CsvPrinter struct {
Variant string
}
func (*CsvPrinter) Write ¶
func (p *CsvPrinter) Write(f interface{}, c interface{}) error
type ForecastTable ¶
func (ForecastTable) AddRows ¶
func (f ForecastTable) AddRows(rows []table.Row)
func (ForecastTable) Footer ¶
func (f ForecastTable) Footer(row table.Row)
func (ForecastTable) Header ¶
func (f ForecastTable) Header()
func (ForecastTable) Style ¶
func (f ForecastTable) Style()
func (ForecastTable) Writer ¶
func (f ForecastTable) Writer(output interface{})
type OpenAIPrinter ¶
type OpenAIPrinter struct {
Variant string
}
type PineconePrinter ¶
type PineconePrinter struct {
Variant string
}
func (*PineconePrinter) Write ¶
func (p *PineconePrinter) Write(f interface{}, c interface{}) error
type Printer ¶
type Printer interface {
Write(interface{}, interface{}) error
}
func NewPrintWriter ¶
func NewPrintWriter(printType model.PrintWriterType, variant string) Printer
type StdoutPrinter ¶
type StdoutPrinter struct {
Variant string
}
func (*StdoutPrinter) Write ¶
func (p *StdoutPrinter) Write(f interface{}, c interface{}) error
type VectorStore ¶
type VectorStore interface { CreateVectorStoreInput(r model.CostAndUsageOutputType) ([]*model. VectorStoreItem, error) CreateEmbeddings(items []*model.VectorStoreItem) ([]gogpt.Embedding, error) Upsert(context context.Context, data []pinecone.PineconeStruct) (resp model.UpsertResponse, err error) }
func NewVectorStoreClient ¶
func NewVectorStoreClient(builder requestbuilder.Builder, openAIAPIKey, indexUrl, pineconeAPIKey string) VectorStore
type VectorStoreClient ¶
type VectorStoreClient struct {
// contains filtered or unexported fields
}
func (*VectorStoreClient) CreateEmbeddings ¶
func (v *VectorStoreClient) CreateEmbeddings(items []*model.VectorStoreItem) ( []gogpt.Embedding, error)
func (*VectorStoreClient) CreateVectorStoreInput ¶
func (v *VectorStoreClient) CreateVectorStoreInput(r model. CostAndUsageOutputType) ([]*model.VectorStoreItem, error)
func (*VectorStoreClient) Upsert ¶
func (v *VectorStoreClient) Upsert(context context.Context, items []pinecone.PineconeStruct) (resp model.UpsertResponse, err error)
Click to show internal directories.
Click to hide internal directories.