Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saniales/ccat-api
Cheshire Cat API Golang Client
https://github.com/saniales/ccat-api
Last synced: about 17 hours ago
JSON representation
Cheshire Cat API Golang Client
- Host: GitHub
- URL: https://github.com/saniales/ccat-api
- Owner: saniales
- License: mit
- Created: 2024-04-03T18:51:42.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-04-13T17:39:43.000Z (6 months ago)
- Last Synced: 2024-06-19T19:27:47.477Z (4 months ago)
- Language: Go
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cheshire Cat API Golang Client
This is a very simple Golang client to call [Cheshire Cat API](https://cheshirecat.ai).
The library is documented using [GoDoc](https://pkg.go.dev/github.com/saniales/ccat-api).
## Download and usage
``` bash
go get github.com/saniales/ccat-api
```## A more complete usage example
``` go
package ccatapi_testimport (
"fmt"
"log"ccatapi "github.com/saniales/ccat-api"
)func main() {
// Create a new Cheshire Cat API client.
client := ccatapi.NewClient(
ccatapi.WithBaseURL("https://examplecat.ai"),
)// Call the Cheshire Cat API
err := client.Status()
if err != nil {
log.Fatal("Cheshire API is not OK")
}// Use Settings API
getSettingsParams := ccatapi.GetSettingsParams{
Search: "example",
}
getSettingsResponse, err := client.Settings.GetSettings(getSettingsParams)
if err != nil {
log.Fatal("Cannot get settings", err)
}
fmt.Println(getSettingsResponse.Settings)// Use LLMs API
getAllLLMsSettingsResponse, err := client.LLMs.GetAllLLMsSettings()
if err != nil {
log.Fatal("Cannot get LLMs settings", err)
}
fmt.Println(getAllLLMsSettingsResponse.Settings)// Use Embedders API
getAllEmbeddersSettingsResponse, err := client.Embedders.GetAllEmbeddersSettings()
if err != nil {
log.Fatal("Cannot get Embedders settings", err)
}
fmt.Println(getAllEmbeddersSettingsResponse.Settings)// and so on...
}
```