Skip to content

Commit 348b0aa

Browse files
authored
Merge branch 'main' into fix-param-validation
2 parents 9dcb16f + 0036d8c commit 348b0aa

23 files changed

Lines changed: 5156 additions & 6 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
name: Link Checks
15+
16+
on:
17+
schedule:
18+
- cron: '0 0 * * 1'
19+
jobs:
20+
linkChecker:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
issues: write
24+
steps:
25+
- name: Checkout Repository
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Link Checker
31+
id: lychee-check
32+
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2
33+
continue-on-error: true
34+
with:
35+
args: >
36+
--quiet
37+
--no-progress
38+
--exclude '^neo4j\+.*' --exclude '^bolt://.*'
39+
README.md
40+
docs/
41+
output: lychee-report.md
42+
format: markdown
43+
fail: true
44+
jobSummary: false
45+
debug: false
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Prepare Report
50+
run: |
51+
echo "## Link Resolution Note" > full-report.md
52+
echo "Local links and directory changes work differently on GitHub than on the docsite.You must ensure fixes pass the **GitHub check** and also work with **\`hugo server\`**." >> full-report.md
53+
echo "See [Link Checking and Fixing with Lychee](https://github.com/googleapis/genai-toolbox/blob/main/DEVELOPER.md#link-checking-and-fixing-with-lychee) for more details." >> full-report.md
54+
echo "" >> full-report.md
55+
sed -E '/(Redirect|Redirects per input)/d' lychee-report.md >> full-report.md
56+
57+
- name: Create Issue From File
58+
if: steps.lychee-check.outcome == 'failure'
59+
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5
60+
with:
61+
title: Link Checker Report
62+
content-filepath: full-report.md
63+
labels: report, automated issue, link checker
64+
65+
- name: Display Failure Report
66+
# Run this ONLY if the link checker failed
67+
if: steps.lychee-check.outcome == 'failure'
68+
run: |
69+
# We can now simply output the prepared file to the job summary
70+
cat full-report.md >> $GITHUB_STEP_SUMMARY
71+
# Fail the job
72+
exit 1

.github/workflows/tests.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,27 @@ on:
1717
push:
1818
branches:
1919
- "main"
20+
paths:
21+
- "**"
22+
- "!docs/**"
23+
- "!**.md"
24+
- "!.github/**"
25+
- ".github/workflows/tests.yaml"
2026
pull_request:
27+
paths:
28+
- "**"
29+
- "!docs/**"
30+
- "!**.md"
31+
- "!.github/**"
32+
- ".github/workflows/tests.yaml"
2133
pull_request_target:
2234
types: [labeled]
35+
paths:
36+
- "**"
37+
- "!docs/**"
38+
- "!**.md"
39+
- "!.github/**"
40+
- ".github/workflows/tests.yaml"
2341

2442
# Declare default permissions as read only.
2543
permissions: read-all
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: tests
16+
17+
on:
18+
push:
19+
branches:
20+
- "main"
21+
paths:
22+
- "docs/**"
23+
- "**.md"
24+
- ".github/**"
25+
- "!.github/workflows/tests.yaml"
26+
pull_request:
27+
paths:
28+
- "docs/**"
29+
- "**.md"
30+
- ".github/**"
31+
- "!.github/workflows/tests.yaml"
32+
pull_request_target:
33+
types: [labeled]
34+
paths:
35+
- "docs/**"
36+
- "**.md"
37+
- ".github/**"
38+
- "!.github/workflows/tests.yaml"
39+
40+
permissions: read-all
41+
42+
jobs:
43+
integration:
44+
name: unit tests
45+
runs-on: ${{ matrix.os }}
46+
strategy:
47+
matrix:
48+
os: [macos-latest, windows-latest, ubuntu-latest]
49+
steps:
50+
- name: Skip Tests
51+
run: |
52+
echo "Skipping unit tests for documentation/config-only changes."
53+
echo "This job exists to satisfy the required status check."

cmd/internal/imports.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ import (
105105
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookeradddashboardelement"
106106
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookeradddashboardfilter"
107107
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookerconversationalanalytics"
108+
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookercreateprojectdirectory"
108109
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookercreateprojectfile"
110+
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookerdeleteprojectdirectory"
109111
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookerdeleteprojectfile"
110112
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookerdevmode"
111113
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookergenerateembedurl"
@@ -122,6 +124,7 @@ import (
122124
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookergetmeasures"
123125
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookergetmodels"
124126
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookergetparameters"
127+
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookergetprojectdirectories"
125128
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookergetprojectfile"
126129
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookergetprojectfiles"
127130
_ "github.com/googleapis/genai-toolbox/internal/tools/looker/lookergetprojects"

cmd/internal/tools_file_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ func TestPrebuiltTools(t *testing.T) {
17781778
wantToolset: server.ToolsetConfigs{
17791779
"looker_tools": tools.ToolsetConfig{
17801780
Name: "looker_tools",
1781-
ToolNames: []string{"get_models", "get_explores", "get_dimensions", "get_measures", "get_filters", "get_parameters", "query", "query_sql", "query_url", "get_looks", "run_look", "make_look", "get_dashboards", "run_dashboard", "make_dashboard", "add_dashboard_element", "add_dashboard_filter", "generate_embed_url", "health_pulse", "health_analyze", "health_vacuum", "dev_mode", "get_projects", "get_project_files", "get_project_file", "create_project_file", "update_project_file", "delete_project_file", "validate_project", "get_connections", "get_connection_schemas", "get_connection_databases", "get_connection_tables", "get_connection_table_columns"},
1781+
ToolNames: []string{"get_models", "get_explores", "get_dimensions", "get_measures", "get_filters", "get_parameters", "query", "query_sql", "query_url", "get_looks", "run_look", "make_look", "get_dashboards", "run_dashboard", "make_dashboard", "add_dashboard_element", "add_dashboard_filter", "generate_embed_url", "health_pulse", "health_analyze", "health_vacuum", "dev_mode", "get_projects", "get_project_files", "get_project_file", "create_project_file", "update_project_file", "delete_project_file", "get_project_directories", "create_project_directory", "delete_project_directory", "validate_project", "get_connections", "get_connection_schemas", "get_connection_databases", "get_connection_tables", "get_connection_table_columns"},
17821782
},
17831783
},
17841784
},

docs/en/reference/prebuilt-tools.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,9 @@ See [Usage Examples](../reference/cli.md#examples).
543543
* `create_project_file`: Create a new LookML file.
544544
* `update_project_file`: Update an existing LookML file.
545545
* `delete_project_file`: Delete a LookML file.
546+
* `get_project_directories`: Retrieves a list of project directories for a given LookML project.
547+
* `create_project_directory`: Creates a new directory within a specified LookML project.
548+
* `delete_project_directory`: Deletes a directory from a specified LookML project.
546549
* `validate_project`: Check the syntax of a LookML project.
547550
* `get_connections`: Get the available connections in a Looker instance.
548551
* `get_connection_schemas`: Get the available schemas in a connection.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: "looker-create-project-directory"
3+
type: docs
4+
weight: 1
5+
description: >
6+
A "looker-create-project-directory" tool creates a new directory in a LookML project.
7+
aliases:
8+
- /resources/tools/looker-create-project-directory
9+
---
10+
11+
## About
12+
13+
A `looker-create-project-directory` tool creates a new directory within a specified LookML project.
14+
15+
It's compatible with the following sources:
16+
17+
- [looker](../../sources/looker.md)
18+
19+
## Example
20+
21+
```yaml
22+
kind: tools
23+
name: looker-create-project-directory
24+
type: looker-create-project-directory
25+
source: looker-source
26+
description: |
27+
This tool creates a new directory within a specific LookML project.
28+
It is useful for organizing project files.
29+
30+
Parameters:
31+
- project_id (string): The ID of the LookML project.
32+
- directory_path (string): The path of the directory to create.
33+
34+
Output:
35+
A string confirming the creation of the directory.
36+
```
37+
38+
## Reference
39+
40+
| **field** | **type** | **required** | **description** |
41+
|-------------|:--------:|:------------:|----------------------------------------------------|
42+
| type | string | true | Must be "looker-create-project-directory". |
43+
| source | string | true | Name of the source Looker instance. |
44+
| description | string | true | Description of the tool that is passed to the LLM. |
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: "looker-delete-project-directory"
3+
type: docs
4+
weight: 1
5+
description: >
6+
A "looker-delete-project-directory" tool deletes a directory from a LookML project.
7+
aliases:
8+
- /resources/tools/looker-delete-project-directory
9+
---
10+
11+
## About
12+
13+
A `looker-delete-project-directory` tool deletes a directory from a specified LookML project.
14+
15+
It's compatible with the following sources:
16+
17+
- [looker](../../sources/looker.md)
18+
19+
## Example
20+
21+
```yaml
22+
kind: tools
23+
name: looker-delete-project-directory
24+
type: looker-delete-project-directory
25+
source: looker-source
26+
description: |
27+
This tool deletes a directory from a specific LookML project.
28+
It is useful for removing unnecessary or obsolete directories.
29+
30+
Parameters:
31+
- project_id (string): The ID of the LookML project.
32+
- directory_path (string): The path of the directory to delete.
33+
34+
Output:
35+
A string confirming the deletion of the directory.
36+
```
37+
38+
## Reference
39+
40+
| **field** | **type** | **required** | **description** |
41+
|-------------|:--------:|:------------:|----------------------------------------------------|
42+
| type | string | true | Must be "looker-delete-project-directory". |
43+
| source | string | true | Name of the source Looker instance. |
44+
| description | string | true | Description of the tool that is passed to the LLM. |
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: "looker-get-project-directories"
3+
type: docs
4+
weight: 1
5+
description: >
6+
A "looker-get-project-directories" tool returns the directories within a specific LookML project.
7+
aliases:
8+
- /resources/tools/looker-get-project-directories
9+
---
10+
11+
## About
12+
13+
A `looker-get-project-directories` tool retrieves the directories within a specified LookML project.
14+
15+
It's compatible with the following sources:
16+
17+
- [looker](../../sources/looker.md)
18+
19+
## Example
20+
21+
```yaml
22+
kind: tools
23+
name: looker-get-project-directories
24+
type: looker-get-project-directories
25+
source: looker-source
26+
description: |
27+
This tool retrieves a list of directories within a specific LookML project.
28+
It is useful for exploring the project structure.
29+
30+
Parameters:
31+
- project_id (string): The ID of the LookML project.
32+
33+
Output:
34+
A JSON array of strings, representing the directories within the project.
35+
```
36+
37+
## Reference
38+
39+
| **field** | **type** | **required** | **description** |
40+
|-------------|:--------:|:------------:|----------------------------------------------------|
41+
| type | string | true | Must be "looker-get-project-directories". |
42+
| source | string | true | Name of the source Looker instance. |
43+
| description | string | true | Description of the tool that is passed to the LLM. |

docs/en/samples/pre_post_processing/js.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@ This guide demonstrates how to implement these patterns in your Toolbox applicat
1616

1717
{{< tabpane persist=header >}}
1818
{{% tab header="ADK" text=true %}}
19-
Coming soon.
19+
The following example demonstrates how to use the `beforeToolCallback` and `afterToolCallback` hooks in the ADK `LlmAgent` to implement pre and post processing logic.
20+
21+
```js
22+
{{< include "js/adk/agent.js" >}}
23+
```
24+
25+
You can also add model-level (`beforeModelCallback`, `afterModelCallback`) and agent-level (`beforeAgentCallback`, `afterAgentCallback`) hooks to intercept messages at different stages of the execution loop.
26+
27+
For more information, see the [ADK Callbacks documentation](https://google.github.io/adk-docs/callbacks/types-of-callbacks/).
2028
{{% /tab %}}
2129
{{% tab header="Langchain" text=true %}}
22-
The following example demonstrates how to use `ToolboxClient` with LangChain's middleware to implement pre- and post- processing for tool calls.
30+
The following example demonstrates how to use `ToolboxClient` with LangChain's middleware to implement pre and post processing for tool calls.
2331

2432
```js
2533
{{< include "js/langchain/agent.js" >}}

0 commit comments

Comments
 (0)