aitaskbuilder

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Error messages
	ErrAtLeastOneInstructionRequired  = "at least one instruction must be provided"
	ErrBatchIDRequired                = "batch ID is required"
	ErrBatchNotFound                  = "batch not found"
	ErrBothInstructionInputsProvided  = "cannot specify both instructions file (-f) and JSON string (-j)"
	ErrBothBatchItemsInputsProvided   = "cannot specify both batch-items file (-f) and batch-items JSON (-j)"
	ErrBatchItemsMutuallyExclusive    = "cannot combine --clear-batch-items with batch-items file (-f) or batch-items JSON (-j)"
	ErrBatchItemsMustBeArray          = "batch_items must be a JSON array"
	ErrBatchItemsMustBeNonEmpty       = "batch_items must contain at least one page"
	ErrDatasetIDRequired              = "dataset ID is required"
	ErrDatasetUploadFileEmpty         = "file must not be empty"
	ErrDatasetUploadFormatRequired    = "file format could not be determined from file extension; use --format csv or --format jsonl"
	ErrDatasetNotFound                = "dataset not found"
	ErrFilePathRequired               = "file path is required"
	ErrInstructionInputRequired       = "either instructions file (-f) or JSON string (-j) must be provided"
	ErrNameRequired                   = "name is required"
	ErrSchemaInvalidJSON              = "schema contains invalid JSON"
	ErrSchemaStrictSetInBoth          = "cannot set strict in both --schema and --strict"
	ErrStrictRequiresSchema           = "--strict requires --schema"
	ErrSchemaMustBeObject             = "schema must be a JSON object"
	ErrSchemaFieldsRequired           = "schema must define at least one field"
	ErrSchemaMultipleTaskGroupID      = "schema may define at most one task_group_id field"
	ErrTaskIntroductionRequired       = "task introduction is required"
	ErrTaskNameRequired               = "task name is required"
	ErrTaskStepsRequired              = "task steps is required"
	ErrTasksPerGroupMinimum           = "tasks per group must be at least 1"
	ErrWorkspaceIDRequired            = "workspace ID is required"
	ErrAtLeastOneUpdateFieldRequired  = "at least one of --name, --dataset-id, task detail flags, batch-items flags, --auto-sync, or --no-auto-sync must be provided"
	ErrAutoSyncFlagsMutuallyExclusive = "cannot use --auto-sync and --no-auto-sync together"
)

Variables

View Source
var DatasetUploadPollSleep func(time.Duration) = time.Sleep

DatasetUploadPollSleep is the sleep function used between dataset import status polls.

Functions

func NewAITaskBuilderCommand

func NewAITaskBuilderCommand(client client.API, w io.Writer) *cobra.Command

NewAITaskBuilderCommand creates a new `aitaskbuilder` command

func NewBatchCreateCommand added in v0.0.57

func NewBatchCreateCommand(client client.API, w io.Writer) *cobra.Command

func NewBatchExportCommand added in v1.0.0

func NewBatchExportCommand(c client.API, w io.Writer) *cobra.Command

NewBatchExportCommand creates a new `aitaskbuilder batch export` command to export a batch's responses as a ZIP archive.

func NewBatchInstructionsCommand added in v0.0.57

func NewBatchInstructionsCommand(client client.API, w io.Writer) *cobra.Command

NewBatchInstructionsCommand creates a new command for creating AI Task Builder instructions.

func NewBatchSetupCommand added in v0.0.57

func NewBatchSetupCommand(client client.API, w io.Writer) *cobra.Command

func NewBatchSyncCommand added in v1.0.3

func NewBatchSyncCommand(c client.API, w io.Writer) *cobra.Command

NewBatchSyncCommand creates a new `aitaskbuilder batch sync` command to extend a batch with tasks for datapoints appended to its dataset since the last sync.

func NewBatchTasksCommand added in v0.0.57

func NewBatchTasksCommand(client client.API, w io.Writer) *cobra.Command

func NewBatchUpdateCommand added in v1.0.0

func NewBatchUpdateCommand(client client.API, w io.Writer) *cobra.Command

func NewBatchesCommand added in v0.0.57

func NewBatchesCommand(client client.API, w io.Writer) *cobra.Command

NewBatchesCommand creates a new `batch` command

func NewCreateDatasetCommand added in v0.0.57

func NewCreateDatasetCommand(client client.API, w io.Writer) *cobra.Command

NewCreateDatasetCommand creates a new command for creating datasets

func NewDatasetUploadCommand added in v0.0.57

func NewDatasetUploadCommand(client client.API, w io.Writer) *cobra.Command

NewDatasetUploadCommand creates a new command for uploading to an AI Task Builder dataset.

func NewDatasetsCommand added in v0.0.57

func NewDatasetsCommand(client client.API, w io.Writer) *cobra.Command

NewDatasetsCommand creates a new `dataset` command

func NewGetBatchCommand

func NewGetBatchCommand(client client.API, w io.Writer) *cobra.Command

func NewGetBatchStatusCommand

func NewGetBatchStatusCommand(client client.API, w io.Writer) *cobra.Command

func NewGetBatchesListCommand added in v0.0.57

func NewGetBatchesListCommand(client client.API, w io.Writer) *cobra.Command

func NewGetDatasetStatusCommand

func NewGetDatasetStatusCommand(client client.API, w io.Writer) *cobra.Command

func NewGetResponsesCommand

func NewGetResponsesCommand(client client.API, w io.Writer) *cobra.Command

Types

type BatchCreateOptions added in v0.0.57

type BatchCreateOptions struct {
	Args             []string
	Name             string
	WorkspaceID      string
	DatasetID        string
	TaskName         string
	TaskIntroduction string
	TaskSteps        string
	BatchItemsFile   string
	BatchItemsJSON   string
	AutoSync         bool
}

type BatchExportOptions added in v1.0.0

type BatchExportOptions struct {
	Args   []string
	Output string
}

BatchExportOptions holds the options for the batch export command.

type BatchGetBatchesOptions

type BatchGetBatchesOptions struct {
	Args        []string
	WorkspaceID string
}

type BatchGetOptions

type BatchGetOptions struct {
	Args    []string
	BatchID string
}

type BatchGetResponsesOptions

type BatchGetResponsesOptions struct {
	Args    []string
	BatchID string
}

type BatchGetStatusOptions

type BatchGetStatusOptions struct {
	Args    []string
	BatchID string
}

type BatchInstructionsOptions added in v0.0.57

type BatchInstructionsOptions struct {
	Args             []string
	BatchID          string
	InstructionsFile string
	InstructionsJSON string
}

BatchInstructionsOptions are the options for creating AI Task Builder instructions.

type BatchSetupOptions added in v0.0.57

type BatchSetupOptions struct {
	Args          []string
	BatchID       string
	DatasetID     string
	TasksPerGroup int
}

type BatchSyncOptions added in v1.0.3

type BatchSyncOptions struct {
	Args    []string
	Timeout time.Duration
}

BatchSyncOptions holds the options for the batch sync command.

type BatchTasksOptions added in v0.0.57

type BatchTasksOptions struct {
	Args    []string
	BatchID string
}

type BatchUpdateOptions added in v1.0.0

type BatchUpdateOptions struct {
	Args                    []string
	BatchID                 string
	Name                    string
	DatasetID               string
	TaskName                string
	TaskIntroduction        string
	TaskSteps               string
	TaskNameChanged         bool
	TaskIntroductionChanged bool
	TaskStepsChanged        bool
	BatchItemsFile          string
	BatchItemsJSON          string
	ClearBatchItems         bool
	EnableAutoSync          bool
	DisableAutoSync         bool
}

type CreateDatasetOptions added in v0.0.57

type CreateDatasetOptions struct {
	Args        []string
	Name        string
	WorkspaceID string
	Schema      string // raw --schema value (inline JSON or path)
	Strict      bool   // --strict flag value
	StrictSet   bool   // whether --strict was explicitly passed
}

CreateDatasetOptions holds the options for creating a dataset

type DatasetGetStatusOptions

type DatasetGetStatusOptions struct {
	Args      []string
	DatasetID string
}

type DatasetUploadOptions added in v0.0.57

type DatasetUploadOptions struct {
	Args      []string
	DatasetID string
	FilePath  string
	Format    string
	Timeout   time.Duration
}

DatasetUploadOptions are the options for uploading to an AI Task Builder dataset.

Jump to

Keyboard shortcuts

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