Documentation
¶
Index ¶
- type AnalysisEvent
- type AnalysisMessage
- type AnalysisOptions
- type AnalysisQuery
- type CAPayload
- type ChartOptions
- type Config
- type ConversationOptions
- type Credentials
- type DataMessage
- type DataResult
- type Datasource
- type DatasourceReferences
- type ErrorMessage
- type Filter
- type ImageOptions
- type InlineContext
- type LookerExploreReference
- type LookerExploreReferences
- type LookerQuery
- type Message
- type OAuthCredentials
- type Python
- type SchemaMessage
- type SchemaQuery
- type SchemaResult
- type SecretBased
- type StreamMessage
- type SystemMessage
- type TextMessage
- type TokenBased
- type Tool
- func (t Tool) Authorized(verifiedAuthServices []string) bool
- func (t Tool) Invoke(ctx context.Context, params parameters.ParamValues, ...) (any, error)
- func (t Tool) Manifest() tools.Manifest
- func (t Tool) McpManifest() tools.McpManifest
- func (t Tool) ParseParams(data map[string]any, claims map[string]map[string]any) (parameters.ParamValues, error)
- func (t Tool) RequiresClientAuthorization() bool
- func (t Tool) ToConfig() tools.ToolConfig
- type UserMessage
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 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 (Config) ToolConfigKind ¶
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 ¶
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 ImageOptions ¶
type InlineContext ¶
type InlineContext struct {
SystemInstruction string `json:"systemInstruction"`
DatasourceReferences DatasourceReferences `json:"datasourceReferences"`
Options ConversationOptions `json:"options"`
}
type LookerExploreReference ¶
type LookerExploreReferences ¶
type LookerExploreReferences struct {
ExploreReferences []LookerExploreReference `json:"exploreReferences"`
Credentials Credentials `json:"credentials,omitzero"`
}
type LookerQuery ¶
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 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 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 (Tool) Invoke ¶
func (t Tool) Invoke(ctx context.Context, params parameters.ParamValues, accessToken tools.AccessToken) (any, error)
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 (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