Commit Graph

229 Commits

Author SHA1 Message Date
Yuan
9e2f49e129 chore: migrate remaining yaml library to goccy/go-yaml (#299)
Migrate yaml library from
[gopkg.in/yaml.v3](https://pkg.go.dev/gopkg.in/yaml.v3) to
[goccy/go-yaml](https://github.com/goccy/go-yaml).

It was previously migrated in
https://github.com/googleapis/genai-toolbox/pull/211. These files were
added later hence the migration wasn't done on these files.
2025-02-21 12:54:42 -08:00
Yuan
e494d11e6e fix: validate required common fields for parameters (#298)
Check common parameters for required fields. Throw an error if name or
description is not provided.

Example of error when `description` field not provided:
```
2025-02-18T14:11:55.475101-08:00 ERROR "unable to parse tool file at \"tools.yaml\": unable to parse as \"postgres-sql\": unable to parse as \"array\": Key: 'CommonParameter.Desc' Error:Field validation for 'Desc' failed on the 'required' tag"
```
2025-02-19 10:09:57 -08:00
Yuan
9193836eff fix: throw error when items field is missing from array parameter (#296)
Fixes #291 by throwing a more descriptive error when items field is not provided.

Example of error when `items` field not provided for array parameter:
```
2025-02-18T14:07:58.77173-08:00 ERROR "unable to parse tool file at \"tools.yaml\": unable to parse as \"postgres-sql\": unable to parse as \"array\": unable to parse 'items' field: error parsing parameters: nothing to unmarshal"
```
2025-02-18 19:52:36 -07:00
Yuan
541612d72d fix: add items to parameter manifest (#293)
`items` are not specified in the manifest for parameters, which means
the client doesn't parse them correctly when presented to the LLMs. This
PR adds `items` as part of manifest.

Example manifest:
```
{
    "serverVersion": "0.1.0",
    "tools": {
        "tool_name": {
            "description": "description of the tool...",
            "parameters": [{
                "name": "foos",
                "type": "array",
                "description": "A list of foo.",
                "authSources": [],
                "items": {"name": "foo", "type": "string", "description": "foobar.", "authSources": []}
            }]
        }
    }
}
```

Fixes #292 🦕
2025-02-14 15:29:16 -08:00
Kurtis Van Gent
914f8437b1 chore: improve wording about virtual environments in quickstart (#290) 2025-02-12 17:19:24 -07:00
Kurtis Van Gent
d9c050ce13 docs: clarify pip as a requirement (#289)
Updates the local_quickstart to clarify pip as a requirement and connect
using psql consistently.
2025-02-12 17:11:54 -07:00
Yuan
a01247d860 ci: reorganize integration test files (#285)
Reorganize integration tests, mainly between postgres, mysql, and sql
server that shares alot similar code.
* separate commons_test.go to multiple file:
    * server_test.go: for setting up server etc.
* tool_test.go: for testing tools endpoint, including testing tools with
parameters or auth-invokes
* source_test.go: for testing source such as connection tests or setting
up source-related code
    * auth_test.go: only contain auth set up related code
* common_test.go: consist of common and general set up such as getting
tools config etc.
* Move `switch-case` into individual source's test file so common files
only contains code that don't need to be altered when adding new
integration test. This will ease future debugging and adding new tests.

The following integration tests are not updated (does not have testing
of tool invoke with parameters):
- dgraph 
- neo4j
- spanner (will require more changes, will update in a separate PR)

This PR also does not re-organize `tests/` folder structure.
2025-02-10 18:11:58 -08:00
Anubhav Dhawan
941745b3a3 doc: Update README to improve Toolbox LangChain SDK installation instructions (#287)
Add the bash command to `pip install` the package directly in the README
for a quicker start.

Also add “SDK” after “Toolbox LangChain” to clearly show that “Toolbox
LangChain” is an SDK.

> [!NOTE]
> We had released the PyPI package for Toolbox LangChain SDK as
`toolbox-langchain` and not `toolbox-langchain-sdk` but it still makes
sense to call it “Toolbox LangChain SDK” in natural language.
2025-02-10 08:34:27 -07:00
fengjessica
0bb5010a52 chore: update description for draph (#281)
Updated Dgraph description

---------

Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
2025-02-06 15:54:04 -08:00
Yuan
4b7bb158b4 docs(tools): fix broken links (#284)
Fix broken links to auth source page.

Fixes #282
2025-02-06 15:38:52 -08:00
Kurtis Van Gent
70f617bbae chore: fix graphic with correct name (#283) 2025-02-06 16:22:01 -07:00
Kurtis Van Gent
399cd8686f chore: correct formatting on intro (#279) 2025-02-06 09:45:31 -08:00
Kurtis Van Gent
9ab4dcceac chore(docs): correct reference to auth params (#278) 2025-02-06 10:32:42 -07:00
Anubhav Dhawan
4e37e5818a doc: Update README for a typo in sources link (#277) 2025-02-06 07:01:40 -07:00
Twisha Bansal
8c9305c4c8 chore(docs): fix quickstart (#276) 2025-02-06 04:40:48 -07:00
Kurtis Van Gent
cd4b35e108 chore: make docs public (#274) 2025-02-05 21:32:39 -07:00
Kurtis Van Gent
59b4282adb chore: update README and move to docs site (#273)
Updates the README and pushes doc site changes.
2025-02-06 04:01:54 +00:00
release-please[bot]
53158b07f2 chore(main): release 0.1.0 (#217)
🤖 I have created a release *beep* *boop*
---


##
[0.1.0](https://github.com/googleapis/genai-toolbox/compare/v0.0.5...v0.1.0)
(2025-02-06)


### ⚠ BREAKING CHANGES

* **langchain-sdk:** The SDK for `toolbox-langchain` is now located
[here](https://github.com/googleapis/genai-toolbox-langchain-python).

### Features

* Add Cloud SQL for SQL Server Source and Tool
([#223](https://github.com/googleapis/genai-toolbox/issues/223))
([9bad952](9bad952060))
* Add Cloud SQL for MySQL Source and Tool
([#221](https://github.com/googleapis/genai-toolbox/issues/221))
([f1f61d7](f1f61d7087))
* Add Dgraph Source and Tool
([#233](https://github.com/googleapis/genai-toolbox/issues/233))
([617cc87](617cc872d1))
* Add local quickstart
([#232](https://github.com/googleapis/genai-toolbox/issues/232))
([497fb06](497fb06fae))
* Add user agents for cloud sources
([#244](https://github.com/googleapis/genai-toolbox/issues/244))
([8452f8e](8452f8eb44))
* Add MySQL Source
([#250](https://github.com/googleapis/genai-toolbox/issues/250))
([378692a](378692ab50))
* Add MSSQL source
([#255](https://github.com/googleapis/genai-toolbox/issues/255))
([8fca0a9](8fca0a95ee))


### Bug Fixes

* Auth token verification failure should not throw error immediately
([#234](https://github.com/googleapis/genai-toolbox/issues/234))
([4639cc6](4639cc6560))
* Fix typo in postgres test
([#216](https://github.com/googleapis/genai-toolbox/issues/216))
([0c3d12a](0c3d12ae04))
* **mssql:** Fix mssql tool kind to mssql-sql
([#249](https://github.com/googleapis/genai-toolbox/issues/249))
([1357be2](1357be2569))
* **mysql:** Fix mysql tool kind to mysql-sql
([#248](https://github.com/googleapis/genai-toolbox/issues/248))
([669d6b7](669d6b7239))
* Schema float type
([#264](https://github.com/googleapis/genai-toolbox/issues/264))
([1702f74](1702f74e99))
* Typos at test cases
([#265](https://github.com/googleapis/genai-toolbox/issues/265))
([b7c5661](b7c5661215))
* Update README and quickstart with the correct async APIs.
([#269](https://github.com/googleapis/genai-toolbox/issues/269))
([21eef2e](21eef2e198))
* Update tool invoke to return json
([#266](https://github.com/googleapis/genai-toolbox/issues/266))
([ad58cd5](ad58cd5855))

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
v0.1.0
2025-02-05 18:46:38 -08:00
Yuan
c6e3f731e2 chore(main): release 0.1.0 (#272)
Release-As: 0.1.0
2025-02-05 17:07:38 -08:00
Yuan
5fedbde87c chore: remove sdks and doc fixes (#271)
Remove `/sdks` folder and fix README file.
Update quickstart to remove installing python package from git repo.
2025-02-06 00:24:52 +00:00
Yuan
2d80922900 doc: fix typo for quickstart (#270) 2025-02-05 23:58:53 +00:00
Anubhav Dhawan
21eef2e198 fix: Update README and quickstart with the correct async APIs. (#269) 2025-02-05 22:39:24 +00:00
Kurtis Van Gent
2a78de8f46 chore: add FAQ (#268)
Adds a simple FAQ.

---------

Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-02-05 22:31:51 +00:00
Anubhav Dhawan
1e0dd04f32 doc: update READMEs for sync/async (#237)
Follows
https://github.com/googleapis/genai-toolbox-langchain-python/pull/15
2025-02-05 15:19:25 -07:00
Yuan
ad58cd5855 fix: update tool invoke to return json (#266)
Return actual rows as `[]any` that contains `map` of results. Each `map`
represent a row, with the key being column name.
2025-02-05 13:45:01 -08:00
Yuan
1702f74e99 fix: schema float type (#264)
float type is "float" in manifest.
2025-02-05 10:04:44 -08:00
Kurtis Van Gent
91b134a2a3 chore: move telemetry and deploy pages (#263) 2025-02-04 19:51:24 -07:00
Yuan
b7c5661215 fix: typos at test cases (#265)
Fix port and host typo at test cases
2025-02-04 22:54:36 +00:00
Kurtis Van Gent
a402c9e670 chore: improve quickstart (#262)
Improves the quick start to mention more Chat Models, and uses info boxes now that they are added.
2025-02-04 15:09:24 -07:00
Kurtis Van Gent
1104ec9668 chore: move AuthSources to new docsite (#236)
Migrations the AuthSources parts of the documentation to the new
docsite.
2025-02-04 19:26:12 +00:00
Kurtis Van Gent
77a9999a24 chore: migrate tools to docsite (#235)
This migrates the 'tools' documentation to the new docsite.
2025-02-04 19:18:35 +00:00
Kurtis Van Gent
69395fa637 chore(docs): fix favicon (#260)
Fixes the favicon for the docs site.
2025-02-04 15:45:41 +00:00
Yuan
a0ac5334d1 chore: return error for untested fields in tools.yaml (#239)
This only checks within `SourceConfig`, `ToolConfig`, and
`AuthSourceConfig`.

Error when an unknown field is provided:
`2025-01-27T22:43:46.988401-08:00 ERROR "unable to parse tool file at
\"tools.yaml\": unable to parse as \"cloud-sql-postgres\": [2:1] unknown
field \"extra\"\n 1 | database: test_database\n> 2 | extra: here\n ^\n 3
| instance: toolbox-cloudsql\n 4 | kind: cloud-sql-postgres\n 5 |
password: postgres\n 6 | "`

Error when a required field is not provided:
`2025-01-27T17:49:47.584846-08:00 ERROR "unable to parse tool file at
\"tools.yaml\": validation failed: Key: 'Config.Region' Error:Field
validation for 'Region' failed on the 'required' tag"`

---------

Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
2025-02-03 15:30:27 -08:00
dependabot[bot]
d2efd8c11d chore(deps): bump golang.org/x/net from 0.32.0 to 0.33.0 (#230)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.32.0 to
0.33.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="dfc720dfe0"><code>dfc720d</code></a>
go.mod: update golang.org/x dependencies</li>
<li><a
href="8e66b04771"><code>8e66b04</code></a>
html: use strings.EqualFold instead of lowering ourselves</li>
<li><a
href="b935f7b5d7"><code>b935f7b</code></a>
html: avoid endless loop on error token</li>
<li><a
href="9af49ef148"><code>9af49ef</code></a>
route: remove unused sizeof* consts</li>
<li><a
href="6705db9a4d"><code>6705db9</code></a>
quic: clean up crypto streams when dropping packet protection keys</li>
<li><a
href="4ef7588d2b"><code>4ef7588</code></a>
quic: handle ACK frame in packet which drops number space</li>
<li><a
href="552d8ac903"><code>552d8ac</code></a>
Revert &quot;route: change from syscall to x/sys/unix&quot;</li>
<li><a
href="13a7c0108b"><code>13a7c01</code></a>
Revert &quot;route: remove unused sizeof* consts on freebsd&quot;</li>
<li>See full diff in <a
href="https://github.com/golang/net/compare/v0.32.0...v0.33.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/net&package-manager=go_modules&previous-version=0.32.0&new-version=0.33.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/googleapis/genai-toolbox/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yuan <45984206+Yuan325@users.noreply.github.com>
2025-02-03 14:43:37 -08:00
Yuan
b578e6ce89 docs(mssql): add docs for source (#256)
Add docs for `mssql` source, and update for `mssql-sql` tool.
2025-02-03 18:34:01 +00:00
Yuan
2a7a1eb49c ci(mssql): add integration test (#257)
Add integration test for `mssql`.
2025-02-03 18:27:22 +00:00
Shivaji Kharse
617cc872d1 feat: add dgraph tool and source (#233)
* add dgraph tool and source
2025-02-01 15:32:06 -07:00
Yuan
8fca0a95ee feat(sqlserver): add mssql source (#255)
Add `mssql` source for non-cloud sql server.
2025-01-31 19:13:54 +00:00
Yuan
5f9fc762e5 docs(mysql): add docs for source (#251)
Add docs for `mysql` source.
2025-01-31 19:07:41 +00:00
Yuan
1764a4918c ci(mysql): add integration test (#252)
Add integration test for `mysql`.
2025-01-31 18:54:00 +00:00
Yuan
378692ab50 feat(mysql): add source (#250)
Add `mysql` source.
2025-01-31 10:48:05 -08:00
Twisha Bansal
b0c94946d6 chore(docs): Fix typo and language (#254) 2025-01-30 20:18:29 +05:30
Yuan
8452f8eb44 feat: add user agent to cloud databases (#244)
Add user agent to cloud databases that provides us anonymized data
request count, number of users, number of projects, and other
environment settings.

User agent is using the format: `genai-toolbox/$version+metadata`
2025-01-29 17:19:52 -08:00
Yuan
8152a98b7a ci(cloudsqlmysql): add integration tests (#243)
Add integration test for CloudSQL for MySQL.

Added other integration tests' tag into `.golangci.yaml`, and fixing
lint errors.

Moved getCloudSQLDialOpts to `common_test.go` since it is used across
all three cloud sql integration tests.
2025-01-29 17:03:40 -08:00
Yuan
1357be2569 fix(mssql): fix mssql tool kind to mssql-sql (#249)
Fixing `mssql` tool to `mssql-sql`.
2025-01-29 23:46:01 +00:00
Yuan
669d6b7239 fix(mysql): fix mysql tool kind to mysql-sql (#248)
Update `mysql` tool to `mysql-sql`.
2025-01-29 23:09:13 +00:00
Yuan
b0ecc16a43 docs(cloudsql-pg): fix typos (#247)
Fix typos in cloud sql pg docs.
2025-01-29 15:04:54 -08:00
Yuan
a7b4f20c3c docs(cloudsql-mssql): fixing some typo and add doc to github pages (#246)
Fixing typo to be consistent with other cloudsql docs, and add source
docs to github pages.
2025-01-29 22:45:55 +00:00
Yuan
a900e562d6 docs(cloudsql-mysql): add docs for source and tools (#240)
Add docs for `cloud-sql-mysql` source and `mysql-sql` tool.
2025-01-29 14:41:40 -08:00
Kurtis Van Gent
497fb06fae feat: add local quickstart (#232)
This is a continuation of #218, which add a local quickstart for running
Toolbox with Python and LangGraph.

---------

Co-authored-by: Twisha Bansal <twishabansal@google.com>
Co-authored-by: Anubhav Dhawan <anubhav756@gmail.com>
2025-01-24 12:18:19 -07:00