table

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATE_TABLE_TEMPERATURE  = 0.1
	CREATE_TABLE_MAX_TOKENS   = 3000
	GENERATE_DATA_TEMPERATURE = 0.6
	GENERATE_DATA_MAX_TOKENS  = 6000
)

Variables

This section is empty.

Functions

func ErrColumnNotFound added in v0.0.8

func ErrColumnNotFound(input string) error

Types

type AIRowsGenerator

type AIRowsGenerator struct {
	// contains filtered or unexported fields
}

func NewRowsGenerator

func NewRowsGenerator(ctx context.Context, params GenerateRowsRequest, db *ent.Client, ai ai.AiService, logger *zap.SugaredLogger) (*AIRowsGenerator, error)

func (*AIRowsGenerator) Next

func (g *AIRowsGenerator) Next(ctx context.Context) ([]map[string]*schema.CellValue, error)

func (*AIRowsGenerator) Table

func (g *AIRowsGenerator) Table() *ent.TableMeta

type AutofillRequest added in v0.0.6

type AutofillRequest struct {
	Enable         bool     `json:"enable"`
	Offset         int      `json:"offset"`
	Columns        []string `json:"columns"`
	ContextColumns []string `json:"context_columns"`

	// fields below are used in regenerate API
	Rows   []string `json:"rows"`
	Prompt string   `json:"prompt"`
}

type BuilderTable added in v0.2.0

type BuilderTable struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Depends     []string `json:"depends"`
}

type ColumnSchema

type ColumnSchema struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	Type     string `json:"type"`
	LinkedTo string `json:"linked_to"`
	Mode     string `json:"mode"`
}

type CreateRowsRequest added in v0.0.7

type CreateRowsRequest struct {
	Rows []map[string]any `json:"rows"`
}

type GenerateRowsRequest added in v0.0.2

type GenerateRowsRequest struct {
	Table       string  `json:"table"`
	SaveTo      string  `json:"save_to"`
	Count       int     `json:"count"`
	Batch       int     `json:"batch"`
	Temperature float64 `json:"temperature"`
	Model       string  `json:"model"`
	ImageModel  string  `json:"image_model"`
	// used in API only to send streaming results
	Stream bool `json:"stream"`

	Autofill AutofillRequest `json:"autofill"`
	// contains filtered or unexported fields
}

type ImageExtractionColumn added in v0.3.2

type ImageExtractionColumn struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type" jsonschema:"enum=string,enum=number,enum=integer,enum=boolean,enum=array"`
}

type ImageExtractionOutput added in v0.3.2

type ImageExtractionOutput struct {
	TableName        string                  `json:"table_name"`
	TableDescription string                  `json:"table_description"`
	Columns          []ImageExtractionColumn `json:"columns"`
	Rows             [][]string              `json:"rows"`
}

type ImageImportRequest added in v0.3.2

type ImageImportRequest struct {
	Data   []byte
	Prompt string
	Model  string
}

type ListTablesResponse

type ListTablesResponse struct {
	Total  int         `json:"total"`
	Tables []TableInfo `json:"tables"`
}

type ModelParams added in v0.2.0

type ModelParams struct {
	Temperature float64 `json:"temperature"`
	Model       string  `json:"model"`
}

type ReGenerateRowsRequest added in v0.3.1

type ReGenerateRowsRequest struct {
	Rows        []string `json:"rows"`
	Table       string   `json:"table"`
	Temperature float64  `json:"temperature"`
	Model       string   `json:"model"`
	ImageModel  string   `json:"image_model"`
	Columns     []string `json:"columns"`
	Prompt      string   `json:"prompt"`
}

type Rows

type Rows struct {
	Columns []*ent.TableColumn `json:"columns"`
	Rows    []*ent.TableRow    `json:"rows"`
}

type RowsGenerator

type RowsGenerator interface {
	Next(ctx context.Context) ([]map[string]*schema.CellValue, error)
	Table() *ent.TableMeta
}

type RowsGeneratorMock

type RowsGeneratorMock struct {
	// NextFunc mocks the Next method.
	NextFunc func(ctx context.Context) ([]map[string]*schema.CellValue, error)

	// TableFunc mocks the Table method.
	TableFunc func() *ent.TableMeta
	// contains filtered or unexported fields
}

RowsGeneratorMock is a mock implementation of RowsGenerator.

func TestSomethingThatUsesRowsGenerator(t *testing.T) {

	// make and configure a mocked RowsGenerator
	mockedRowsGenerator := &RowsGeneratorMock{
		NextFunc: func(ctx context.Context) ([]map[string]*schema.CellValue, error) {
			panic("mock out the Next method")
		},
		TableFunc: func() *ent.TableMeta {
			panic("mock out the Table method")
		},
	}

	// use mockedRowsGenerator in code that requires RowsGenerator
	// and then make assertions.

}

func (*RowsGeneratorMock) Next

func (mock *RowsGeneratorMock) Next(ctx context.Context) ([]map[string]*schema.CellValue, error)

Next calls NextFunc.

func (*RowsGeneratorMock) NextCalls

func (mock *RowsGeneratorMock) NextCalls() []struct {
	Ctx context.Context
}

NextCalls gets all the calls that were made to Next. Check the length with:

len(mockedRowsGenerator.NextCalls())

func (*RowsGeneratorMock) Table

func (mock *RowsGeneratorMock) Table() *ent.TableMeta

Table calls TableFunc.

func (*RowsGeneratorMock) TableCalls

func (mock *RowsGeneratorMock) TableCalls() []struct {
}

TableCalls gets all the calls that were made to Table. Check the length with:

len(mockedRowsGenerator.TableCalls())

type SharedSource added in v0.1.0

type SharedSource struct {
	Name string          `json:"name"`
	Data json.RawMessage `json:"data"`
	// only used in csv/parquet type source, this is required by API+WebUI, so user can select columns in UI
	Columns []string `json:"columns"`
}

type TableColumnInfo

type TableColumnInfo struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
	FillMode    string `json:"fill_mode"`
}

type TableGenColumn

type TableGenColumn struct {
	Name                 string   `json:"name"`
	Description          string   `json:"description"`
	Type                 string   `json:"type"`
	FillMode             string   `json:"fill_mode"`
	Source               string   `json:"source"`
	Random               bool     `json:"random"`
	Replacement          bool     `json:"replacement"`
	Repeat               int      `json:"repeat"`
	ContextLength        int      `json:"context_length"`
	LinkedColumn         string   `json:"linked_column"`
	LinkedContextColumns []string `json:"linked_context_columns"`
}

type TableGenColumnSchema

type TableGenColumnSchema struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
}

type TableGenRequest

type TableGenRequest struct {
	Name        string            `json:"name"`
	Model       string            `json:"model"`
	Description string            `json:"description"`
	Columns     []TableGenColumn  `json:"columns"`
	Sources     []json.RawMessage `json:"sources"`
	// contains filtered or unexported fields
}

func (*TableGenRequest) APIRequest added in v0.1.0

func (r *TableGenRequest) APIRequest() bool

func (*TableGenRequest) MarkAPIRequest added in v0.1.0

func (r *TableGenRequest) MarkAPIRequest()

type TableInfo added in v0.0.3

type TableInfo struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Model       string            `json:"model"`
	Columns     []TableColumnInfo `json:"columns"`
}

type TableService

type TableService interface {
	Validate(ctx context.Context, req *TableGenRequest) error
	Create(ctx context.Context, req *TableGenRequest) (string, error)
	Update(ctx context.Context, table string, req *TableGenRequest) (string, error)
	ListTables(ctx context.Context) (*ListTablesResponse, error)
	GetTableDetail(ctx context.Context, table string) (*TableInfo, error)
	Genetate(ctx context.Context, params GenerateRowsRequest) (RowsGenerator, error)
	Rows(ctx context.Context, table string) (*Rows, error)
	Truncate(ctx context.Context, table string) (int, error)
	Delete(ctx context.Context, table string) (int, error)
	Import(ctx context.Context, table string, reader io.Reader) (string, error)
	ImportImage(ctx context.Context, request ImageImportRequest) (string, error)
	CreateRows(ctx context.Context, table string, rows []map[string]any) error
	SharedSources(ctx context.Context) []*SharedSource
	GetTableSchema(ctx context.Context, table string) (*TableGenRequest, error)
	GenerateBuilderTables(ctx context.Context, prompt string, params ModelParams) ([]BuilderTable, error)
	PolishBuilderTables(ctx context.Context, tables []BuilderTable, prompt string, params ModelParams) ([]BuilderTable, error)
	BuildTable(ctx context.Context, name, description string, depends []string, exists []*TableInfo, params ModelParams) (*TableGenRequest, error)
	PolishBuilderTable(ctx context.Context, table *TableGenRequest, prompt string, exists []*TableInfo, params ModelParams) (*TableGenRequest, error)
}

type TableServiceImpl

type TableServiceImpl struct {
	// contains filtered or unexported fields
}

func NewTableService

func NewTableService(config *config.Config, db *ent.Client, ai ai.AiService, logger *zap.SugaredLogger) (*TableServiceImpl, error)

func (*TableServiceImpl) BuildTable added in v0.2.0

func (t *TableServiceImpl) BuildTable(ctx context.Context, name, description string, depends []string, exists []*TableInfo, params ModelParams) (*TableGenRequest, error)

func (*TableServiceImpl) Create added in v0.1.4

func (t *TableServiceImpl) Create(ctx context.Context, req *TableGenRequest) (string, error)

func (*TableServiceImpl) CreateRows added in v0.0.7

func (t *TableServiceImpl) CreateRows(ctx context.Context, table string, rows []map[string]any) error

func (*TableServiceImpl) Delete

func (t *TableServiceImpl) Delete(ctx context.Context, table string) (int, error)

func (*TableServiceImpl) GenerateBuilderTables added in v0.2.0

func (t *TableServiceImpl) GenerateBuilderTables(ctx context.Context, prompt string, params ModelParams) ([]BuilderTable, error)

func (*TableServiceImpl) Genetate

func (*TableServiceImpl) GetTableDetail added in v0.0.3

func (t *TableServiceImpl) GetTableDetail(ctx context.Context, table string) (*TableInfo, error)

func (*TableServiceImpl) GetTableSchema added in v0.1.9

func (t *TableServiceImpl) GetTableSchema(ctx context.Context, table string) (*TableGenRequest, error)

func (*TableServiceImpl) Import

func (t *TableServiceImpl) Import(ctx context.Context, table string, reader io.Reader) (string, error)

func (*TableServiceImpl) ImportImage added in v0.3.2

func (t *TableServiceImpl) ImportImage(ctx context.Context, request ImageImportRequest) (string, error)

func (*TableServiceImpl) ListTables

func (t *TableServiceImpl) ListTables(ctx context.Context) (*ListTablesResponse, error)

func (*TableServiceImpl) PolishBuilderTable added in v0.2.0

func (t *TableServiceImpl) PolishBuilderTable(ctx context.Context, table *TableGenRequest, prompt string, exists []*TableInfo, params ModelParams) (*TableGenRequest, error)

func (*TableServiceImpl) PolishBuilderTables added in v0.2.0

func (t *TableServiceImpl) PolishBuilderTables(ctx context.Context, tables []BuilderTable, prompt string, params ModelParams) ([]BuilderTable, error)

func (*TableServiceImpl) Rows

func (t *TableServiceImpl) Rows(ctx context.Context, table string) (*Rows, error)

func (*TableServiceImpl) SharedSources added in v0.1.0

func (t *TableServiceImpl) SharedSources(ctx context.Context) []*SharedSource

func (*TableServiceImpl) Truncate

func (t *TableServiceImpl) Truncate(ctx context.Context, table string) (int, error)

func (*TableServiceImpl) Update added in v0.1.4

func (t *TableServiceImpl) Update(ctx context.Context, table string, req *TableGenRequest) (string, error)

func (*TableServiceImpl) Validate added in v0.2.0

func (t *TableServiceImpl) Validate(ctx context.Context, req *TableGenRequest) error

type TableServiceMock

type TableServiceMock struct {
	// BuildTableFunc mocks the BuildTable method.
	BuildTableFunc func(ctx context.Context, name string, description string, depends []string, exists []*TableInfo, params ModelParams) (*TableGenRequest, error)

	// CreateFunc mocks the Create method.
	CreateFunc func(ctx context.Context, req *TableGenRequest) (string, error)

	// CreateRowsFunc mocks the CreateRows method.
	CreateRowsFunc func(ctx context.Context, table string, rows []map[string]any) error

	// DeleteFunc mocks the Delete method.
	DeleteFunc func(ctx context.Context, table string) (int, error)

	// GenerateBuilderTablesFunc mocks the GenerateBuilderTables method.
	GenerateBuilderTablesFunc func(ctx context.Context, prompt string, params ModelParams) ([]BuilderTable, error)

	// GenetateFunc mocks the Genetate method.
	GenetateFunc func(ctx context.Context, params GenerateRowsRequest) (RowsGenerator, error)

	// GetTableDetailFunc mocks the GetTableDetail method.
	GetTableDetailFunc func(ctx context.Context, table string) (*TableInfo, error)

	// GetTableSchemaFunc mocks the GetTableSchema method.
	GetTableSchemaFunc func(ctx context.Context, table string) (*TableGenRequest, error)

	// ImportFunc mocks the Import method.
	ImportFunc func(ctx context.Context, table string, reader io.Reader) (string, error)

	// ImportImageFunc mocks the ImportImage method.
	ImportImageFunc func(ctx context.Context, request ImageImportRequest) (string, error)

	// ListTablesFunc mocks the ListTables method.
	ListTablesFunc func(ctx context.Context) (*ListTablesResponse, error)

	// PolishBuilderTableFunc mocks the PolishBuilderTable method.
	PolishBuilderTableFunc func(ctx context.Context, table *TableGenRequest, prompt string, exists []*TableInfo, params ModelParams) (*TableGenRequest, error)

	// PolishBuilderTablesFunc mocks the PolishBuilderTables method.
	PolishBuilderTablesFunc func(ctx context.Context, tables []BuilderTable, prompt string, params ModelParams) ([]BuilderTable, error)

	// RowsFunc mocks the Rows method.
	RowsFunc func(ctx context.Context, table string) (*Rows, error)

	// SharedSourcesFunc mocks the SharedSources method.
	SharedSourcesFunc func(ctx context.Context) []*SharedSource

	// TruncateFunc mocks the Truncate method.
	TruncateFunc func(ctx context.Context, table string) (int, error)

	// UpdateFunc mocks the Update method.
	UpdateFunc func(ctx context.Context, table string, req *TableGenRequest) (string, error)

	// ValidateFunc mocks the Validate method.
	ValidateFunc func(ctx context.Context, req *TableGenRequest) error
	// contains filtered or unexported fields
}

TableServiceMock is a mock implementation of TableService.

func TestSomethingThatUsesTableService(t *testing.T) {

	// make and configure a mocked TableService
	mockedTableService := &TableServiceMock{
		BuildTableFunc: func(ctx context.Context, name string, description string, depends []string, exists []*TableInfo, params ModelParams) (*TableGenRequest, error) {
			panic("mock out the BuildTable method")
		},
		CreateFunc: func(ctx context.Context, req *TableGenRequest) (string, error) {
			panic("mock out the Create method")
		},
		CreateRowsFunc: func(ctx context.Context, table string, rows []map[string]any) error {
			panic("mock out the CreateRows method")
		},
		DeleteFunc: func(ctx context.Context, table string) (int, error) {
			panic("mock out the Delete method")
		},
		GenerateBuilderTablesFunc: func(ctx context.Context, prompt string, params ModelParams) ([]BuilderTable, error) {
			panic("mock out the GenerateBuilderTables method")
		},
		GenetateFunc: func(ctx context.Context, params GenerateRowsRequest) (RowsGenerator, error) {
			panic("mock out the Genetate method")
		},
		GetTableDetailFunc: func(ctx context.Context, table string) (*TableInfo, error) {
			panic("mock out the GetTableDetail method")
		},
		GetTableSchemaFunc: func(ctx context.Context, table string) (*TableGenRequest, error) {
			panic("mock out the GetTableSchema method")
		},
		ImportFunc: func(ctx context.Context, table string, reader io.Reader) (string, error) {
			panic("mock out the Import method")
		},
		ImportImageFunc: func(ctx context.Context, request ImageImportRequest) (string, error) {
			panic("mock out the ImportImage method")
		},
		ListTablesFunc: func(ctx context.Context) (*ListTablesResponse, error) {
			panic("mock out the ListTables method")
		},
		PolishBuilderTableFunc: func(ctx context.Context, table *TableGenRequest, prompt string, exists []*TableInfo, params ModelParams) (*TableGenRequest, error) {
			panic("mock out the PolishBuilderTable method")
		},
		PolishBuilderTablesFunc: func(ctx context.Context, tables []BuilderTable, prompt string, params ModelParams) ([]BuilderTable, error) {
			panic("mock out the PolishBuilderTables method")
		},
		RowsFunc: func(ctx context.Context, table string) (*Rows, error) {
			panic("mock out the Rows method")
		},
		SharedSourcesFunc: func(ctx context.Context) []*SharedSource {
			panic("mock out the SharedSources method")
		},
		TruncateFunc: func(ctx context.Context, table string) (int, error) {
			panic("mock out the Truncate method")
		},
		UpdateFunc: func(ctx context.Context, table string, req *TableGenRequest) (string, error) {
			panic("mock out the Update method")
		},
		ValidateFunc: func(ctx context.Context, req *TableGenRequest) error {
			panic("mock out the Validate method")
		},
	}

	// use mockedTableService in code that requires TableService
	// and then make assertions.

}

func (*TableServiceMock) BuildTable added in v0.2.0

func (mock *TableServiceMock) BuildTable(ctx context.Context, name string, description string, depends []string, exists []*TableInfo, params ModelParams) (*TableGenRequest, error)

BuildTable calls BuildTableFunc.

func (*TableServiceMock) BuildTableCalls added in v0.2.0

func (mock *TableServiceMock) BuildTableCalls() []struct {
	Ctx         context.Context
	Name        string
	Description string
	Depends     []string
	Exists      []*TableInfo
	Params      ModelParams
}

BuildTableCalls gets all the calls that were made to BuildTable. Check the length with:

len(mockedTableService.BuildTableCalls())

func (*TableServiceMock) Create added in v0.1.4

func (mock *TableServiceMock) Create(ctx context.Context, req *TableGenRequest) (string, error)

Create calls CreateFunc.

func (*TableServiceMock) CreateCalls added in v0.1.4

func (mock *TableServiceMock) CreateCalls() []struct {
	Ctx context.Context
	Req *TableGenRequest
}

CreateCalls gets all the calls that were made to Create. Check the length with:

len(mockedTableService.CreateCalls())

func (*TableServiceMock) CreateRows added in v0.0.7

func (mock *TableServiceMock) CreateRows(ctx context.Context, table string, rows []map[string]any) error

CreateRows calls CreateRowsFunc.

func (*TableServiceMock) CreateRowsCalls added in v0.0.7

func (mock *TableServiceMock) CreateRowsCalls() []struct {
	Ctx   context.Context
	Table string
	Rows  []map[string]any
}

CreateRowsCalls gets all the calls that were made to CreateRows. Check the length with:

len(mockedTableService.CreateRowsCalls())

func (*TableServiceMock) Delete

func (mock *TableServiceMock) Delete(ctx context.Context, table string) (int, error)

Delete calls DeleteFunc.

func (*TableServiceMock) DeleteCalls

func (mock *TableServiceMock) DeleteCalls() []struct {
	Ctx   context.Context
	Table string
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedTableService.DeleteCalls())

func (*TableServiceMock) GenerateBuilderTables added in v0.2.0

func (mock *TableServiceMock) GenerateBuilderTables(ctx context.Context, prompt string, params ModelParams) ([]BuilderTable, error)

GenerateBuilderTables calls GenerateBuilderTablesFunc.

func (*TableServiceMock) GenerateBuilderTablesCalls added in v0.2.0

func (mock *TableServiceMock) GenerateBuilderTablesCalls() []struct {
	Ctx    context.Context
	Prompt string
	Params ModelParams
}

GenerateBuilderTablesCalls gets all the calls that were made to GenerateBuilderTables. Check the length with:

len(mockedTableService.GenerateBuilderTablesCalls())

func (*TableServiceMock) Genetate

func (mock *TableServiceMock) Genetate(ctx context.Context, params GenerateRowsRequest) (RowsGenerator, error)

Genetate calls GenetateFunc.

func (*TableServiceMock) GenetateCalls

func (mock *TableServiceMock) GenetateCalls() []struct {
	Ctx    context.Context
	Params GenerateRowsRequest
}

GenetateCalls gets all the calls that were made to Genetate. Check the length with:

len(mockedTableService.GenetateCalls())

func (*TableServiceMock) GetTableDetail added in v0.0.3

func (mock *TableServiceMock) GetTableDetail(ctx context.Context, table string) (*TableInfo, error)

GetTableDetail calls GetTableDetailFunc.

func (*TableServiceMock) GetTableDetailCalls added in v0.0.3

func (mock *TableServiceMock) GetTableDetailCalls() []struct {
	Ctx   context.Context
	Table string
}

GetTableDetailCalls gets all the calls that were made to GetTableDetail. Check the length with:

len(mockedTableService.GetTableDetailCalls())

func (*TableServiceMock) GetTableSchema added in v0.1.9

func (mock *TableServiceMock) GetTableSchema(ctx context.Context, table string) (*TableGenRequest, error)

GetTableSchema calls GetTableSchemaFunc.

func (*TableServiceMock) GetTableSchemaCalls added in v0.1.9

func (mock *TableServiceMock) GetTableSchemaCalls() []struct {
	Ctx   context.Context
	Table string
}

GetTableSchemaCalls gets all the calls that were made to GetTableSchema. Check the length with:

len(mockedTableService.GetTableSchemaCalls())

func (*TableServiceMock) Import

func (mock *TableServiceMock) Import(ctx context.Context, table string, reader io.Reader) (string, error)

Import calls ImportFunc.

func (*TableServiceMock) ImportCalls

func (mock *TableServiceMock) ImportCalls() []struct {
	Ctx    context.Context
	Table  string
	Reader io.Reader
}

ImportCalls gets all the calls that were made to Import. Check the length with:

len(mockedTableService.ImportCalls())

func (*TableServiceMock) ImportImage added in v0.3.2

func (mock *TableServiceMock) ImportImage(ctx context.Context, request ImageImportRequest) (string, error)

ImportImage calls ImportImageFunc.

func (*TableServiceMock) ImportImageCalls added in v0.3.2

func (mock *TableServiceMock) ImportImageCalls() []struct {
	Ctx     context.Context
	Request ImageImportRequest
}

ImportImageCalls gets all the calls that were made to ImportImage. Check the length with:

len(mockedTableService.ImportImageCalls())

func (*TableServiceMock) ListTables

func (mock *TableServiceMock) ListTables(ctx context.Context) (*ListTablesResponse, error)

ListTables calls ListTablesFunc.

func (*TableServiceMock) ListTablesCalls

func (mock *TableServiceMock) ListTablesCalls() []struct {
	Ctx context.Context
}

ListTablesCalls gets all the calls that were made to ListTables. Check the length with:

len(mockedTableService.ListTablesCalls())

func (*TableServiceMock) PolishBuilderTable added in v0.2.0

func (mock *TableServiceMock) PolishBuilderTable(ctx context.Context, table *TableGenRequest, prompt string, exists []*TableInfo, params ModelParams) (*TableGenRequest, error)

PolishBuilderTable calls PolishBuilderTableFunc.

func (*TableServiceMock) PolishBuilderTableCalls added in v0.2.0

func (mock *TableServiceMock) PolishBuilderTableCalls() []struct {
	Ctx    context.Context
	Table  *TableGenRequest
	Prompt string
	Exists []*TableInfo
	Params ModelParams
}

PolishBuilderTableCalls gets all the calls that were made to PolishBuilderTable. Check the length with:

len(mockedTableService.PolishBuilderTableCalls())

func (*TableServiceMock) PolishBuilderTables added in v0.2.0

func (mock *TableServiceMock) PolishBuilderTables(ctx context.Context, tables []BuilderTable, prompt string, params ModelParams) ([]BuilderTable, error)

PolishBuilderTables calls PolishBuilderTablesFunc.

func (*TableServiceMock) PolishBuilderTablesCalls added in v0.2.0

func (mock *TableServiceMock) PolishBuilderTablesCalls() []struct {
	Ctx    context.Context
	Tables []BuilderTable
	Prompt string
	Params ModelParams
}

PolishBuilderTablesCalls gets all the calls that were made to PolishBuilderTables. Check the length with:

len(mockedTableService.PolishBuilderTablesCalls())

func (*TableServiceMock) Rows

func (mock *TableServiceMock) Rows(ctx context.Context, table string) (*Rows, error)

Rows calls RowsFunc.

func (*TableServiceMock) RowsCalls

func (mock *TableServiceMock) RowsCalls() []struct {
	Ctx   context.Context
	Table string
}

RowsCalls gets all the calls that were made to Rows. Check the length with:

len(mockedTableService.RowsCalls())

func (*TableServiceMock) SharedSources added in v0.1.0

func (mock *TableServiceMock) SharedSources(ctx context.Context) []*SharedSource

SharedSources calls SharedSourcesFunc.

func (*TableServiceMock) SharedSourcesCalls added in v0.1.0

func (mock *TableServiceMock) SharedSourcesCalls() []struct {
	Ctx context.Context
}

SharedSourcesCalls gets all the calls that were made to SharedSources. Check the length with:

len(mockedTableService.SharedSourcesCalls())

func (*TableServiceMock) Truncate

func (mock *TableServiceMock) Truncate(ctx context.Context, table string) (int, error)

Truncate calls TruncateFunc.

func (*TableServiceMock) TruncateCalls

func (mock *TableServiceMock) TruncateCalls() []struct {
	Ctx   context.Context
	Table string
}

TruncateCalls gets all the calls that were made to Truncate. Check the length with:

len(mockedTableService.TruncateCalls())

func (*TableServiceMock) Update added in v0.1.4

func (mock *TableServiceMock) Update(ctx context.Context, table string, req *TableGenRequest) (string, error)

Update calls UpdateFunc.

func (*TableServiceMock) UpdateCalls added in v0.1.4

func (mock *TableServiceMock) UpdateCalls() []struct {
	Ctx   context.Context
	Table string
	Req   *TableGenRequest
}

UpdateCalls gets all the calls that were made to Update. Check the length with:

len(mockedTableService.UpdateCalls())

func (*TableServiceMock) Validate added in v0.2.0

func (mock *TableServiceMock) Validate(ctx context.Context, req *TableGenRequest) error

Validate calls ValidateFunc.

func (*TableServiceMock) ValidateCalls added in v0.2.0

func (mock *TableServiceMock) ValidateCalls() []struct {
	Ctx context.Context
	Req *TableGenRequest
}

ValidateCalls gets all the calls that were made to Validate. Check the length with:

len(mockedTableService.ValidateCalls())

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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