Compare commits

...

7 Commits

Author SHA1 Message Date
Shobhit Singh
044ce3457f Merge branch 'main' into shobsi-bq-tool-label 2025-11-18 16:29:16 -08:00
Shobhit Singh
76d04b1f96 Merge branch 'main' into shobsi-bq-tool-label 2025-11-18 12:48:55 -08:00
Shobhit Singh
91c6c5bf6c Merge remote-tracking branch 'origin/main' into shobsi-bq-tool-label 2025-11-18 08:00:47 +00:00
Shobhit Singh
2c15be8101 feat(tools/bigquery): add per tool query label in BigQuery jobs 2025-11-18 07:58:45 +00:00
Shobhit Singh
977154220a Revert "fix(tests): remove broken bigquery unit tests"
This reverts commit 0f60c7702a.
2025-11-18 07:55:38 +00:00
Shobhit Singh
0f60c7702a fix(tests): remove broken bigquery unit tests 2025-11-18 07:53:29 +00:00
Shobhit Singh
a9eb3de687 feat(tools/bigquery): add per tool query label in BigQuery jobs 2025-11-18 07:41:42 +00:00
4 changed files with 5 additions and 0 deletions

View File

@@ -289,6 +289,7 @@ func (t Tool) Invoke(ctx context.Context, params parameters.ParamValues, accessT
)
createModelQuery := bqClient.Query(createModelSQL)
createModelQuery.Labels = map[string]string{"genai-toolbox-tool": kind}
// Get session from provider if in protected mode.
// Otherwise, a new session will be created by the first query.
@@ -332,6 +333,7 @@ func (t Tool) Invoke(ctx context.Context, params parameters.ParamValues, accessT
getInsightsSQL := fmt.Sprintf("SELECT * FROM ML.GET_INSIGHTS(MODEL %s)", modelID)
getInsightsQuery := bqClient.Query(getInsightsSQL)
getInsightsQuery.Labels = map[string]string{"genai-toolbox-tool": kind}
getInsightsQuery.ConnectionProperties = []*bigqueryapi.ConnectionProperty{{Key: "session_id", Value: sessionID}}
job, err := getInsightsQuery.Run(ctx)

View File

@@ -303,6 +303,7 @@ func (t Tool) Invoke(ctx context.Context, params parameters.ParamValues, accessT
query := bqClient.Query(sql)
query.Location = bqClient.Location
query.Labels = map[string]string{"genai-toolbox-tool": kind}
query.ConnectionProperties = connProps

View File

@@ -279,6 +279,7 @@ func (t Tool) Invoke(ctx context.Context, params parameters.ParamValues, accessT
// JobStatistics.QueryStatistics.StatementType
query := bqClient.Query(sql)
query.Location = bqClient.Location
query.Labels = map[string]string{"genai-toolbox-tool": kind}
session, err := t.SessionProvider(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get BigQuery session: %w", err)

View File

@@ -230,6 +230,7 @@ func (t Tool) Invoke(ctx context.Context, params parameters.ParamValues, accessT
query := bqClient.Query(newStatement)
query.Parameters = highLevelParams
query.Location = bqClient.Location
query.Labels = map[string]string{"genai-toolbox-tool": kind}
connProps := []*bigqueryapi.ConnectionProperty{}
if t.SessionProvider != nil {