Commit Graph

89 Commits

Author SHA1 Message Date
Yuan
e815dc49f4 chore: update params type (#98)
Different databases require different types for `Params` field when
adding parameters to their statement. e.g. alloydb, cloudsql, and
postgres uses `pgxpool` to query and build sql statement, whereas
spanner uses `Spanner` library.

Added a new `ParamValue` struct. `ParseParams` helper function parses
arbitraryJSON object into `[]ParamValue`, and the tool's invoke will
convert `[]ParamValue` into it's required type.

---------

Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
2024-12-05 16:05:09 -08:00
Yuan
e88ec409d1 feat(source/alloydb-pg): add configuration for public and private IP (#103)
Allow user to set if their database uses private or public ip. The
reason we add this is because the dialer require different
initialization with private and public ip.

By default, toolbox will use public ip.

---------

Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
2024-12-05 23:05:53 +00:00
Yuan
5c690c5c30 feat: add options for command (#110)
Add Option to configure a Command.

Currently we are only supporting `WithLogger` Option.
2024-12-05 09:02:47 -08:00
Yuan
e66cb423a7 docs(deploy/cloud-run): update deploy command (#109)
Update deploy command to include `--allow-unauthenticated`.
This is optional (hence commented out) and might only be needed for
certain projects.
2024-12-04 10:18:58 -08:00
Kurtis Van Gent
eacabf9439 chore: fix incorrect source name (#108)
Fix's the source name in one of the examples.
2024-12-04 09:51:05 -07:00
Kurtis Van Gent
5fcb19bad8 docs: improve visibility of links to SDKs (#106)
Emphasize links to the SDK documentation a bit more clearly.
2024-12-03 16:25:51 -07:00
Yuan
9a0f618efc feat: add --log-level and --logging-format flags (#97)
Logging support 4 different types of logging (debug, info, warn, error).
The default logging level is Info.

User will be able to set flag for log level (allowed values: "debug",
"info", "warn", "error"), example:
`go run . --log-level debug`

User will be able to set flag for logging format (allowed values:
"standard", "JSON"), example:
`go run . --logging-format json`

**sample http request log - std:**
server
```
2024-11-12T15:08:11.451377-08:00 INFO "Initalized 0 sources.\n"
```
httplog
```
2024-11-26T15:15:53.947287-08:00 INFO Response: 200 OK service: "httplog" httpRequest: {url: "http://127.0.0.1:5000/" method: "GET" path: "/" remoteIP: "127.0.0.1:64216" proto: "HTTP/1.1" requestID: "macbookpro.roam.interna/..." scheme: "http" header: {user-agent: "curl/8.7.1" accept: "*/*"}} httpResponse: {status: 200 bytes: 22 elapsed: 0.012417}
```

**sample http request log - structured:**
server
```
{
  "timestamp":"2024-11-04T16:45:11.987299-08:00",
  "severity":"ERROR",
  "logging.googleapis.com/sourceLocation":{
    "function":"github.com/googleapis/genai-toolbox/internal/log.(*StructuredLogger).Errorf",
    "file":"/Users/yuanteoh/github/genai-toolbox/internal/log/log.go","line":157
  },
  "message":"unable to parse tool file at \"tools.yaml\": \"cloud-sql-postgres1\" is not a valid kind of data source"
}
```
httplog
```
{
  "timestamp":"2024-11-26T15:12:49.290974-08:00",
  "severity":"INFO",
  "logging.googleapis.com/sourceLocation":{
      "function":"github.com/go-chi/httplog/v2.(*RequestLoggerEntry).Write",
      "file":"/Users/yuanteoh/go/pkg/mod/github.com/go-chi/httplog/v2@v2.1.1/httplog.go","line":173
  },
  "message":"Response: 200 OK",
  "service":"httplog",
  "httpRequest":{
      "url":"http://127.0.0.1:5000/",
      "method":"GET",
      "path":"/",
      "remoteIP":"127.0.0.1:64140",
      "proto":"HTTP/1.1",
      "requestID":"yuanteoh-macbookpro.roam.internal/NBrtYBu3q9-000001",
      "scheme":"http",
      "header":{"user-agent":"curl/8.7.1","accept":"*/*"}
  },
  "httpResponse":{"status":200,"bytes":22,"elapsed":0.0115}
}
```
2024-12-03 16:52:19 +00:00
Anubhav Dhawan
bf614ed28d doc(llamaindex-sdk): Improve the developer.md file to segregate install and test steps. (#105)
Mirrors change from #99 for LlamaIndex.

Also includes a minor change to wrap text.
2024-12-03 16:43:52 +00:00
Yuan
51c6b5b66f docs: update readme to include deploy instructions (#102) 2024-12-02 11:47:26 -08:00
Yuan
7878858bea chore: move logger interface to log/ (#101) 2024-12-02 11:44:46 -08:00
Anubhav Dhawan
4b47725411 doc: Improve the developer.md file to segregate install and test steps. (#99) 2024-12-02 17:08:17 +00:00
Twisha Bansal
a12973ea36 chore(langchain-sdk): pin versions in requirements.txt (#94) 2024-11-27 12:08:33 -07:00
Twisha Bansal
084725ee05 ci(llamaindex): Added auto lint and integration test config (#72)
This PR adds CI workflows for linting and integration tests to the
Llamaindex SDK.

Linting is failing due to type checking errors in the SDK (to be fixed
separately).
Integration tests are failing since there are no existing tests.
2024-11-27 17:29:24 +00:00
Twisha Bansal
20c90ec317 chore(llamaindex-sdk): pin versions in requirements.txt (#93) 2024-11-27 22:53:15 +05:30
Twisha Bansal
9bce24dc0e chore(langchain-sdk): add note to README about asyncio environments (#92) 2024-11-27 10:11:57 -07:00
Twisha Bansal
c65edf8c27 chore(llamaindex-sdk): add note to README about asyncio environments (#91) 2024-11-27 09:47:24 +05:30
Yuan
ea04688331 ci: setup continuous release (#86)
Setup continuous release for Toolbox.
Cloudbuild triggers releases when there's a push to the main branch.

Binary url:
`https://storage.googleapis.com/genai-toolbox-dev/$REF_NAME/darwin/amd64/toolbox`
image url:
`us-central1-docker.pkg.dev/database-toolbox/toolbox-dev/toolbox:$REF_NAME`
2024-11-26 17:14:51 -08:00
Kurtis Van Gent
7650a0b6d6 ci: improve releasing (#66)
Does a few things to improve releasing process:
- Moves file to .ci folder
- Updates release script to check for version
- Uses printf instead of "echo" to work better between linux/mac
- removes comments about non-mac (worked on linux for me)

I've also updated the tigger to run on new tags.

---------

Co-authored-by: Yuan Teoh <yuanteoh@google.com>
2024-11-26 15:48:58 -07:00
Yuan
5e20417551 feat: add structured logger (#96)
Logging support 4 different types of logging (debug, info, warn, error).

Example of structured logger:

```
{
  "timestamp":"2024-11-04T16:45:11.987299-08:00",
  "severity":"ERROR",
  "logging.googleapis.com/sourceLocation":{
    "function":"github.com/googleapis/genai-toolbox/internal/log.(*StructuredLogger).Errorf",
    "file":"/Users/yuanteoh/github/genai-toolbox/internal/log/log.go","line":157
  },
  "message":"unable to parse tool file at \"tools.yaml\": \"cloud-sql-postgres1\" is not a valid kind of data source"
}
```

```
{
  "timestamp":"2024-11-04T16:45:11.987562-08:00",
  "severity":"INFO",
  "logging.googleapis.com/sourceLocation":{
    "function":"github.com/googleapis/genai-toolbox/internal/log.(*StructuredLogger).Infof",
    "file":"/Users/yuanteoh/github/genai-toolbox/internal/log/log.go","line":147
  },
  "message":"Initalized 0 sources.\n"
}
```
2024-11-26 13:57:44 -08:00
Yuan
6a8feb51f0 feat: add std logger (#95)
Logging support 4 different types of logging (debug, info, warn, error).

Example of standard logger:
`2024-11-12T15:08:11.451147-08:00 ERROR "unable to parse tool file at
\"tools.yaml\": \"cloud-sql-postgres1\" is not a valid kind of data
source"`

`2024-11-12T15:08:11.451377-08:00 INFO "Initalized 0 sources.\n"`
2024-11-26 12:51:19 -08:00
Kurtis Van Gent
d29a32936e docs: add intros to Cloud SQL and AlloyDB (#89)
Address a comment about getting started from Per.
2024-11-22 13:43:55 -07:00
Kurtis Van Gent
2203a374a2 docs: misc improvements to README (#88)
Fix numerous issues flagged by @vmanghnani.
2024-11-22 13:16:51 -07:00
Twisha Bansal
9a4d13d7da chore(llamaindex-sdk): Fix path (#85) 2024-11-21 15:45:13 -07:00
Wenxin Du
8c2c373d35 fix: fix go test workflow (#84) 2024-11-19 17:25:59 -05:00
Anubhav Dhawan
fa03376bbc fix(llamaindex-sdk): Fix issue causing client session to not close properly while closing SDK. (#82) 2024-11-19 13:58:36 +05:30
Anubhav Dhawan
9d360e16ea fix: Fix issue causing client session to not close properly while closing SDK. (#81) 2024-11-19 13:29:09 +05:30
Anubhav Dhawan
9ed4479428 chore(langchain-sdk): Pin LangChain SDK deps versions. (#77) 2024-11-19 06:14:14 +00:00
Twisha Bansal
2986916740 chore(llamaindex-sdk): Pin llamaindex SDK deps versions (#76) 2024-11-18 10:23:04 +05:30
Anubhav Dhawan
522bbefa7b fix: Fix the errors showing up after setting up mypy type checker. (#74) 2024-11-14 14:04:24 -08:00
Wenxin Du
751228a774 ci: add e2e testing with cloud build (#27) 2024-11-13 17:59:41 -05:00
Twisha Bansal
75ce468b2f chore(langchain-sdk): Fix type checks (#70) 2024-11-13 15:57:52 +00:00
Twisha Bansal
83b87f4666 chore(llamaindex-sdk): Fix type checks (#69) 2024-11-13 08:55:09 -07:00
Twisha Bansal
74c032abdf docs: fix link to sdk developer file (#67) 2024-11-13 11:59:02 +05:30
release-please[bot]
8a6ec6042c chore(main): release 0.0.2 (#35)
🤖 I have created a release *beep* *boop*
---


##
[0.0.2](https://github.com/googleapis/genai-toolbox/compare/v0.0.1...v0.0.2)
(2024-11-12)


### ⚠ BREAKING CHANGES

* consolidate "x-postgres-generic" tools to "postgres-sql" tool
([#43](https://github.com/googleapis/genai-toolbox/issues/43))

### Features

* Consolidate "x-postgres-generic" tools to "postgres-sql" tool
([#43](https://github.com/googleapis/genai-toolbox/issues/43))
([f630965](f630965937))
* **container:** Add entrypoint in Dockerfile
([#38](https://github.com/googleapis/genai-toolbox/issues/38))
([b08072a](b08072a800))
* LlamaIndex SDK
([#48](https://github.com/googleapis/genai-toolbox/issues/48))
([b824abe](b824abe72f))
* **sdk:** Make ClientSession optional when initializing ToolboxClient
([#55](https://github.com/googleapis/genai-toolbox/issues/55))
([26347b5](26347b5a5e))
* Support requesting a single tool
([#56](https://github.com/googleapis/genai-toolbox/issues/56))
([efafba9](efafba9033))


### Bug Fixes

* Correct source type validation for postgres-sql tool
([#47](https://github.com/googleapis/genai-toolbox/issues/47))
([52ebb43](52ebb431b7))
* **docs:** Correct outdated references to tool kinds
([#49](https://github.com/googleapis/genai-toolbox/issues/49))
([972888b](972888b9d6))
* Handle content-type correctly
([#33](https://github.com/googleapis/genai-toolbox/issues/33))
([cf8112f](cf8112f856))


### Miscellaneous Chores

* Release 0.0.2
([#65](https://github.com/googleapis/genai-toolbox/issues/65))
([beea3c3](beea3c32d9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

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.0.2
2024-11-12 21:04:09 +00:00
Kurtis Van Gent
beea3c32d9 chore: release 0.0.2 (#65)
Release-As: 0.0.2
2024-11-12 13:57:27 -07:00
Kurtis Van Gent
6a8397fc9e docs: fix links to SDKs in README (#64) 2024-11-12 20:52:23 +00:00
Kurtis Van Gent
981f0b88f7 docs: update README (#62)
Update README to refer to toolbox consistently and to emphasize
interaction with orchestration frameworks.
2024-11-12 13:34:11 -07:00
Anubhav Dhawan
7af208a628 doc(llamaindex-sdk): Add a tip about passing a ClientSession to Toolbox client for optimisation. (#61) 2024-11-12 09:38:43 +00:00
Anubhav Dhawan
26347b5a5e feat(sdk): make ClientSession optional when initializing ToolboxClient (#55) 2024-11-12 09:20:19 +00:00
Twisha Bansal
a415f29639 chore(langchain-sdk): Update README (#58) 2024-11-12 08:50:52 +00:00
Twisha Bansal
7d10f58393 chore(llamaindex-sdk): Add info on how to get single tool (#60) 2024-11-12 14:18:03 +05:30
Kurtis Van Gent
efafba9033 feat: support requesting a single tool (#56)
Adds support for getting a ToolsManifest with a single tool when a GET
`/tools/$toolname` request is sent.
2024-11-11 19:35:57 +00:00
Twisha Bansal
ed15418652 chore(llamaindex-sdk): fix url in README (#57) 2024-11-11 19:33:00 +00:00
Twisha Bansal
4cf3a04b57 docs(llamaindex-sdk): add README for LlamaIndex SDK (#53)
Added LlamaIndex SDK docs

And corrected README to include LLamaIndex SDKs

---------

Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
2024-11-11 17:20:21 +00:00
Yuan
0af2222cb4 docs: add deploy to cloud run instructions (#36)
Instructions to deploy Toolbox to Cloud Run.

---------

Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
Co-authored-by: Anubhav Dhawan <anubhavdhawan@google.com>
2024-11-11 09:10:43 -08:00
Anubhav Dhawan
1833fee5bc docs(langchain-sdk): update README file (#54) 2024-11-08 21:21:37 +00:00
Anubhav Dhawan
1b57ecab0d doc: Create a README file explaining the setup and sample usage with LangChain and LangGraph. (#45) 2024-11-08 13:49:16 -07:00
Twisha Bansal
1cf0d96e58 Update client.py (#51)
Minor fix
2024-11-07 10:39:39 -07:00
Twisha Bansal
b824abe72f feat: LlamaIndex SDK (#48)
Added client code for LlamaIndex SDK.

Will add README and tests in a follow up PR.
2024-11-07 05:04:09 +00:00
Twisha Bansal
972888b9d6 fix(docs): correct outdated references to tool kinds (#49) 2024-11-06 11:27:14 -07:00