lookerconversationalanalytics

package
v0.20.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalysisEvent

type AnalysisEvent struct {
	PlannerReasoning      string `json:"plannerReasoning,omitempty"`
	CoderInstructions     string `json:"coderInstructions,omitempty"`
	Code                  string `json:"code,omitempty"`
	ExecutionOutput       string `json:"executionOutput,omitempty"`
	ExecutionError        string `json:"executionError,omitempty"`
	ResultVegaChartJson   string `json:"resultVegaChartJson,omitempty"`
	ResultNaturalLanguage string `json:"resultNaturalLanguage,omitempty"`
	ResultCsvData         string `json:"resultCsvData,omitempty"`
	ResultReferenceData   string `json:"resultReferenceData,omitempty"`
	Error                 string `json:"error,omitempty"`
}

type AnalysisMessage

type AnalysisMessage struct {
	Query         AnalysisQuery `json:"query,omitempty"`
	ProgressEvent AnalysisEvent `json:"progressEvent,omitempty"`
}

type AnalysisOptions

type AnalysisOptions struct {
	Python Python `json:"python"`
}

type AnalysisQuery

type AnalysisQuery struct {
	Question        string   `json:"question,omitempty"`
	DataResultNames []string `json:"dataResultNames,omitempty"`
}

type CAPayload

type CAPayload struct {
	Messages      []Message     `json:"messages"`
	InlineContext InlineContext `json:"inlineContext"`
	ClientIdEnum  string        `json:"clientIdEnum"`
}

type ChartOptions

type ChartOptions struct {
	Image ImageOptions `json:"image"`
}

type Config

type Config struct {
	Name         string   `yaml:"name" validate:"required"`
	Kind         string   `yaml:"kind" validate:"required"`
	Source       string   `yaml:"source" validate:"required"`
	Description  string   `yaml:"description" validate:"required"`
	AuthRequired []string `yaml:"authRequired"`
}

func (Config) Initialize

func (cfg Config) Initialize(srcs map[string]sources.Source) (tools.Tool, error)

func (Config) ToolConfigKind

func (cfg Config) ToolConfigKind() string

type ConversationOptions

type ConversationOptions struct {
	Chart    ChartOptions    `json:"chart,omitzero"`
	Analysis AnalysisOptions `json:"analysis,omitzero"`
}

type Credentials

type Credentials struct {
	OAuth OAuthCredentials `json:"oauth"`
}

type DataMessage

type DataMessage struct {
	GeneratedLookerQuery *LookerQuery `json:"generatedLookerQuery,omitempty"`
	Result               *DataResult  `json:"result,omitempty"`
}

DataMessage contains data-related information, like queries and results.

type DataResult

type DataResult struct {
	Data []map[string]any `json:"data"`
}

DataResult contains the schema and rows of a query result.

type Datasource

type Datasource struct {
	LookerExploreReference LookerExploreReference `json:"lookerExploreReference"`
}

Datasource represents a data source with its reference and schema.

type DatasourceReferences

type DatasourceReferences struct {
	Looker LookerExploreReferences `json:"looker"`
}

type ErrorMessage

type ErrorMessage struct {
	Text string `json:"text"`
}

ErrorResponse represents an error message from the API.

type Filter

type Filter struct {
	Field string `json:"field,omitempty"`
	Value string `json:"value,omitempty"`
}

type ImageOptions

type ImageOptions struct {
	NoImage map[string]any `json:"noImage"`
}

type InlineContext

type InlineContext struct {
	SystemInstruction    string               `json:"systemInstruction"`
	DatasourceReferences DatasourceReferences `json:"datasourceReferences"`
	Options              ConversationOptions  `json:"options"`
}

type LookerExploreReference

type LookerExploreReference struct {
	LookerInstanceUri string `json:"lookerInstanceUri"`
	LookmlModel       string `json:"lookmlModel"`
	Explore           string `json:"explore"`
}

type LookerExploreReferences

type LookerExploreReferences struct {
	ExploreReferences []LookerExploreReference `json:"exploreReferences"`
	Credentials       Credentials              `json:"credentials,omitzero"`
}

type LookerQuery

type LookerQuery struct {
	Model   string   `json:"model"`
	Explore string   `json:"explore"`
	Fields  []string `json:"fields"`
	Filters []Filter `json:"filters,omitempty"`
	Sorts   []string `json:"sorts,omitempty"`
	Limit   string   `json:"limit,omitempty"`
}

type Message

type Message struct {
	UserMessage UserMessage `json:"userMessage"`
}

type OAuthCredentials

type OAuthCredentials struct {
	Secret SecretBased `json:"secret,omitzero"`
	Token  TokenBased  `json:"token,omitzero"`
}

type Python

type Python struct {
	Enabled bool `json:"enabled"`
}

type SchemaMessage

type SchemaMessage struct {
	Query  *SchemaQuery  `json:"query,omitempty"`
	Result *SchemaResult `json:"result,omitempty"`
}

SchemaMessage contains schema-related information.

type SchemaQuery

type SchemaQuery struct {
	Question string `json:"question"`
}

SchemaQuery holds the question that prompted a schema lookup.

type SchemaResult

type SchemaResult struct {
	Datasources []Datasource `json:"datasources"`
}

SchemaResult contains the datasources with their schemas.

type SecretBased

type SecretBased struct {
	ClientId     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
}

type StreamMessage

type StreamMessage struct {
	SystemMessage *SystemMessage `json:"systemMessage,omitempty"`
}

StreamMessage represents a single message object from the streaming API response.

type SystemMessage

type SystemMessage struct {
	Text     *TextMessage     `json:"text,omitempty"`
	Schema   *SchemaMessage   `json:"schema,omitempty"`
	Data     *DataMessage     `json:"data,omitempty"`
	Analysis *AnalysisMessage `json:"analysis,omitempty"`
	Error    *ErrorMessage    `json:"error,omitempty"`
}

SystemMessage contains different types of system-generated content.

type TextMessage

type TextMessage struct {
	Parts []string `json:"parts"`
}

TextMessage contains textual parts of a message.

type TokenBased

type TokenBased struct {
	AccessToken string `json:"accessToken"`
}

type Tool

type Tool struct {
	Config
	ApiSettings    *rtl.ApiSettings
	UseClientOAuth bool                  `yaml:"useClientOAuth"`
	Parameters     parameters.Parameters `yaml:"parameters"`
	Project        string
	Location       string
	TokenSource    oauth2.TokenSource
	// contains filtered or unexported fields
}

func (Tool) Authorized

func (t Tool) Authorized(verifiedAuthServices []string) bool

func (Tool) Invoke

func (t Tool) Invoke(ctx context.Context, params parameters.ParamValues, accessToken tools.AccessToken) (any, error)

func (Tool) Manifest

func (t Tool) Manifest() tools.Manifest

func (Tool) McpManifest

func (t Tool) McpManifest() tools.McpManifest

func (Tool) ParseParams

func (t Tool) ParseParams(data map[string]any, claims map[string]map[string]any) (parameters.ParamValues, error)

func (Tool) RequiresClientAuthorization

func (t Tool) RequiresClientAuthorization() bool

func (Tool) ToConfig added in v0.20.0

func (t Tool) ToConfig() tools.ToolConfig

type UserMessage

type UserMessage struct {
	Text string `json:"text"`
}

Structs for building the JSON payload

Jump to

Keyboard shortcuts

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