bigquery

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseScanSizeLimit

func ParseScanSizeLimit(sizeStr string) (uint64, error)

ParseScanSizeLimit parses human-readable size string (e.g., "10GB") into bytes

Types

type Agent

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

Agent represents a BigQuery Sub-Agent

func New

func New() *Agent

New creates a new BigQuery Agent instance

func NewAgent

func NewAgent(
	config *Config,
	llmClient gollem.LLMClient,
	memoryService *memory.Service,
) *Agent

NewAgent creates a new BigQuery Agent instance with config (for testing and direct use)

func (*Agent) Configure

func (a *Agent) Configure(ctx context.Context) error

Configure implements interfaces.Tool

func (*Agent) Flags

func (a *Agent) Flags() []cli.Flag

Flags returns CLI flags for this agent

func (*Agent) Helper

func (a *Agent) Helper() *cli.Command

Helper implements interfaces.Tool

func (*Agent) ID

func (a *Agent) ID() string

ID implements SubAgent interface

func (*Agent) Init

func (a *Agent) Init(ctx context.Context, llmClient gollem.LLMClient, memoryService *memory.Service) (bool, error)

Init initializes the agent with LLM client and memory service. Returns (true, nil) if initialized successfully, (false, nil) if not configured, or (false, error) on error.

func (*Agent) IsEnabled

func (a *Agent) IsEnabled() bool

IsEnabled returns true if the agent is configured and initialized

func (*Agent) LogValue

func (a *Agent) LogValue() slog.Value

LogValue implements interfaces.Tool

func (*Agent) Name

func (a *Agent) Name() string

Name implements interfaces.Tool

func (*Agent) Prompt

func (a *Agent) Prompt(ctx context.Context) (string, error)

Prompt implements interfaces.Tool Returns table descriptions for system prompt

func (*Agent) Run

func (a *Agent) Run(ctx context.Context, name string, args map[string]any) (map[string]any, error)

Run implements gollem.ToolSet

func (*Agent) Specs

func (a *Agent) Specs(ctx context.Context) ([]gollem.ToolSpec, error)

Specs implements gollem.ToolSet

type Config

type Config struct {
	Tables           []TableConfig   `yaml:"-"`        // Internal use only (expanded from Projects)
	Projects         []ProjectConfig `yaml:"projects"` // Hierarchical configuration
	ScanSizeLimit    uint64          `yaml:"-"`        // Parsed from ScanSizeLimitStr
	ScanSizeLimitStr string          `yaml:"scan_size_limit"`
	QueryTimeout     time.Duration   `yaml:"query_timeout"` // Timeout for waiting for BigQuery job completion (default: 5 minutes)
}

Config represents BigQuery Agent configuration

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads BigQuery Agent configuration from a YAML file

func (*Config) GetQueryTimeout

func (c *Config) GetQueryTimeout() time.Duration

GetQueryTimeout returns the query timeout with fallback to default

type DatasetConfig

type DatasetConfig struct {
	ID          string        `yaml:"id"`
	Description string        `yaml:"description,omitempty"`
	Tables      []TableDetail `yaml:"tables"`
}

DatasetConfig represents a BigQuery dataset with tables

type ProjectConfig

type ProjectConfig struct {
	ID          string          `yaml:"id"`
	Description string          `yaml:"description,omitempty"`
	Datasets    []DatasetConfig `yaml:"datasets"`
}

ProjectConfig represents a GCP project with datasets

type TableConfig

type TableConfig struct {
	ProjectID   string `yaml:"project_id"`
	DatasetID   string `yaml:"dataset_id"`
	TableID     string `yaml:"table_id"`
	Description string `yaml:"description"`
}

TableConfig represents a BigQuery table configuration (flat structure for backward compatibility)

type TableDetail

type TableDetail struct {
	ID          string `yaml:"id"`
	Description string `yaml:"description,omitempty"`
}

TableDetail represents a table within a dataset

Jump to

Keyboard shortcuts

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