Documentation
¶
Index ¶
- type CSVExporter
- func (x *CSVExporter) BuildDataPoints(ctx context.Context, description string, src []byte) ([]*DataPoint, error)
- func (x *CSVExporter) EnhanceDataPoint(ctx context.Context, d *DataPoint) error
- func (x *CSVExporter) InferOutput_WithChat(ctx context.Context, input *DataPoint, out io.Writer) error
- func (x *CSVExporter) InferOutput_WithCompletion(ctx context.Context, model string, input *DataPoint, out io.Writer) error
- func (x *CSVExporter) VisitCodeDir(ctx context.Context, srcDir string) error
- func (x *CSVExporter) WriteCSVForAllTools(ctx context.Context, outputDir string) error
- type DataPoint
- type EnhanceWithGoStruct
- type EnhanceWithMappers
- type EnhanceWithProtoDefinition
- type Enhancer
- type ExtractToolMarkers
- type Extractor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSVExporter ¶
type CSVExporter struct { // StrictInputColumnKeys ensures that all input datapoints have this shape. // This helps detect typos in the examples. StrictInputColumnKeys sets.Set[string] // contains filtered or unexported fields }
CSVExporter is an exporter that writes CSV files for each tool.
func NewCSVExporter ¶
func NewCSVExporter(extractor Extractor, enhancers ...Enhancer) (*CSVExporter, error)
NewCSVExporter creates a new CSVExporter.
func (*CSVExporter) BuildDataPoints ¶
func (x *CSVExporter) BuildDataPoints(ctx context.Context, description string, src []byte) ([]*DataPoint, error)
BuildDataPoints extracts data points from a byte slice representing a Go file.
func (*CSVExporter) EnhanceDataPoint ¶
func (x *CSVExporter) EnhanceDataPoint(ctx context.Context, d *DataPoint) error
EnhanceDataPoint enhances a data point by running all the registered enhancers.
func (*CSVExporter) InferOutput_WithChat ¶
func (x *CSVExporter) InferOutput_WithChat(ctx context.Context, input *DataPoint, out io.Writer) error
InferOutput_WithChat tries to infer an output value, using the Chat LLM APIs.
func (*CSVExporter) InferOutput_WithCompletion ¶
func (x *CSVExporter) InferOutput_WithCompletion(ctx context.Context, model string, input *DataPoint, out io.Writer) error
InferOutput_WithCompletion tries to infer an output value, using the Completion LLM APIs.
func (*CSVExporter) VisitCodeDir ¶
func (x *CSVExporter) VisitCodeDir(ctx context.Context, srcDir string) error
VisitCodeDir visits a directory and extracts data points from all Go files in the directory tree.
func (*CSVExporter) WriteCSVForAllTools ¶
func (x *CSVExporter) WriteCSVForAllTools(ctx context.Context, outputDir string) error
WriteCSVForAllTools writes CSV files for all tools.
type DataPoint ¶
DataPoint holds the input and output for a tool.
func (*DataPoint) AddCSVColumns ¶
AddCSVColumns adds the columns for the data point to the columnSet.
func (*DataPoint) InputColumnKeys ¶
InputColumnKeys returns a set of the input column names
func (*DataPoint) ToGenAIFormat ¶
ToGenAIFormat converts the data point to the input format for Gemini (or other LLMs).
type EnhanceWithGoStruct ¶
type EnhanceWithGoStruct struct {
// contains filtered or unexported fields
}
EnhanceWithGoStruct is an enhancer that finds Go structs with matching proto message annotation "// +kcc:proto=..."
func NewEnhanceWithGoStruct ¶
func NewEnhanceWithGoStruct(srcDirectory string) (*EnhanceWithGoStruct, error)
NewEnhanceWithGoStruct creates a new EnhanceWithGoStruct
func (*EnhanceWithGoStruct) EnhanceDataPoint ¶
func (x *EnhanceWithGoStruct) EnhanceDataPoint(ctx context.Context, p *DataPoint) error
EnhanceDataPoint enhances the data point by adding matching Go struct definitions
type EnhanceWithMappers ¶
type EnhanceWithMappers struct {
// contains filtered or unexported fields
}
EnhanceWithMappers is an enhancer that finds Go mapper functions in a directory
func NewEnhanceWithMappers ¶
func NewEnhanceWithMappers(srcDirectory string) (*EnhanceWithMappers, error)
NewEnhanceWithMappers creates a new EnhanceWithMappers
func (*EnhanceWithMappers) EnhanceDataPoint ¶
func (x *EnhanceWithMappers) EnhanceDataPoint(ctx context.Context, p *DataPoint) error
EnhanceDataPoint enhances the data point by adding mapper function definitions
type EnhanceWithProtoDefinition ¶
type EnhanceWithProtoDefinition struct {
// contains filtered or unexported fields
}
EnhanceWithProtoDefinition is an enhancer that adds the definition of a proto message or service to the data point.
func NewEnhanceWithProtoDefinition ¶
func NewEnhanceWithProtoDefinition(protoDirectory string) (*EnhanceWithProtoDefinition, error)
NewEnhanceWithProtoDefinition creates a new EnhanceWithProtoDefinition.
func (*EnhanceWithProtoDefinition) EnhanceDataPoint ¶
func (x *EnhanceWithProtoDefinition) EnhanceDataPoint(ctx context.Context, p *DataPoint) error
EnhanceDataPoint enhances the data point by adding the definition of the proto message or service.
type Enhancer ¶
Enhancer is an interface for enhancing a data point. For example, it might add a computed field to the data point, such as the definition of a proto message, given the name of the proto message.
type ExtractToolMarkers ¶
type ExtractToolMarkers struct { }
ExtractToolMarkers extracts tool markers from source code.