* ci: add Go client integration tests Add test-go-client job to CI workflow following the same pattern as Python, TypeScript, and Rust client tests. The job: - Sets up Go 1.23 with dependency caching - Starts the Hindsight API server - Runs integration tests using the 'integration' build tag - Displays server logs on failure The integration tests (hindsight-clients/go/integration_test.go) cover all core operations: retain, recall, reflect, bank management, and end-to-end workflows. * Move Go cookbook content to hindsight-cookbook repo Removes Go-specific cookbook content that was added in PR #375: - applications/go-memory-service.md - recipes/go-quickstart.md - recipes/go-concurrent-pipeline.md These have been moved to the hindsight-cookbook repository where cookbook content should live per project conventions. * feat(go): add CI test for Go client and patch for ogen null handling - Add test-go-client job to GitHub Actions CI workflow - Create post-generation patch script (patch-ogen.sh) to fix ogen's handling of null values in optional string fields - Patch OptString.Decode() to check jx.Next() type before decoding, properly handling explicit null in JSON responses The patch ensures generated code persists across regenerations and handles the Hindsight API's nullable optional fields correctly. Fixes: Go client integration tests for retain and bank operations Note: Some tests still fail for nullable arrays/objects - those require additional patches for other Opt* types. * feat: use official go generator for Go client * feat: use official go generator for Go client * ci fixes * chore: sync Go client with latest OpenAPI spec - Add model_child_operation_status.go (new model) - Update model_operation_status_response.go with child operations - Update go.mod/go.sum dependencies - Update api/openapi.yaml
1.6 KiB
1.6 KiB
| sidebar_position |
|---|
| 3 |
Go Client
Official Go client for the Hindsight API, generated from the OpenAPI 3.1 spec using OpenAPI Generator.
import CodeSnippet from '@site/src/components/CodeSnippet'; import quickstartGo from '!!raw-loader!@site/examples/api/quickstart.go';
Installation
go get github.com/vectorize-io/hindsight-client-go
Requires Go 1.23+.
Quick Start
API Structure
The Go client provides access to all Hindsight API operations through structured namespaces:
client.MemoryAPI- Retain, recall, reflect operationsclient.BanksAPI- Bank managementclient.DirectivesAPI- Directive managementclient.MentalModelsAPI- Mental model managementclient.DocumentsAPI- Document operationsclient.EntitiesAPI- Entity operationsclient.OperationsAPI- Async operation monitoring
Working with Nullable Fields
The Go client uses NullableString, NullableTime, and similar types for optional fields:
Error Handling
More Examples
For detailed examples of all operations, see:
- Python SDK documentation - API concepts are the same
- Node.js SDK documentation - API concepts are the same
- OpenAPI specification - Complete API reference