The Go SDK declared its module as github.com/vectorize-io/hindsight-client-go, but that repository doesn't exist. Update to github.com/vectorize-io/hindsight/hindsight-clients/go to match the actual monorepo path, enabling standard `go get` imports with directory-prefixed tags. Also enables isGoSubmodule in the OpenAPI generator config and updates all import references across tests, docs, and the client generation script. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
226 lines
13 KiB
Markdown
226 lines
13 KiB
Markdown
# Go API client for hindsight
|
|
|
|
HTTP API for Hindsight
|
|
|
|
## Overview
|
|
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
|
|
|
|
- API version: 0.4.11
|
|
- Package version: 1.0.0
|
|
- Generator version: 7.10.0
|
|
- Build package: org.openapitools.codegen.languages.GoClientCodegen
|
|
|
|
## Installation
|
|
|
|
Install the following dependencies:
|
|
|
|
```sh
|
|
go get github.com/stretchr/testify/assert
|
|
go get golang.org/x/net/context
|
|
```
|
|
|
|
Put the package under your project folder and add the following in import:
|
|
|
|
```go
|
|
import hindsight "github.com/vectorize-io/hindsight/hindsight-clients/go"
|
|
```
|
|
|
|
To use a proxy, set the environment variable `HTTP_PROXY`:
|
|
|
|
```go
|
|
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
|
```
|
|
|
|
## Configuration of Server URL
|
|
|
|
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.
|
|
|
|
### Select Server Configuration
|
|
|
|
For using other server than the one defined on index 0 set context value `hindsight.ContextServerIndex` of type `int`.
|
|
|
|
```go
|
|
ctx := context.WithValue(context.Background(), hindsight.ContextServerIndex, 1)
|
|
```
|
|
|
|
### Templated Server URL
|
|
|
|
Templated server URL is formatted using default variables from configuration or from context value `hindsight.ContextServerVariables` of type `map[string]string`.
|
|
|
|
```go
|
|
ctx := context.WithValue(context.Background(), hindsight.ContextServerVariables, map[string]string{
|
|
"basePath": "v2",
|
|
})
|
|
```
|
|
|
|
Note, enum values are always validated and all unused variables are silently ignored.
|
|
|
|
### URLs Configuration per Operation
|
|
|
|
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
|
|
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
|
Similar rules for overriding default operation server index and variables applies by using `hindsight.ContextOperationServerIndices` and `hindsight.ContextOperationServerVariables` context maps.
|
|
|
|
```go
|
|
ctx := context.WithValue(context.Background(), hindsight.ContextOperationServerIndices, map[string]int{
|
|
"{classname}Service.{nickname}": 2,
|
|
})
|
|
ctx = context.WithValue(context.Background(), hindsight.ContextOperationServerVariables, map[string]map[string]string{
|
|
"{classname}Service.{nickname}": {
|
|
"port": "8443",
|
|
},
|
|
})
|
|
```
|
|
|
|
## Documentation for API Endpoints
|
|
|
|
All URIs are relative to *http://localhost*
|
|
|
|
Class | Method | HTTP request | Description
|
|
------------ | ------------- | ------------- | -------------
|
|
*BanksAPI* | [**AddBankBackground**](docs/BanksAPI.md#addbankbackground) | **Post** /v1/default/banks/{bank_id}/background | Add/merge memory bank background (deprecated)
|
|
*BanksAPI* | [**ClearObservations**](docs/BanksAPI.md#clearobservations) | **Delete** /v1/default/banks/{bank_id}/observations | Clear all observations
|
|
*BanksAPI* | [**CreateOrUpdateBank**](docs/BanksAPI.md#createorupdatebank) | **Put** /v1/default/banks/{bank_id} | Create or update memory bank
|
|
*BanksAPI* | [**DeleteBank**](docs/BanksAPI.md#deletebank) | **Delete** /v1/default/banks/{bank_id} | Delete memory bank
|
|
*BanksAPI* | [**GetAgentStats**](docs/BanksAPI.md#getagentstats) | **Get** /v1/default/banks/{bank_id}/stats | Get statistics for memory bank
|
|
*BanksAPI* | [**GetBankConfig**](docs/BanksAPI.md#getbankconfig) | **Get** /v1/default/banks/{bank_id}/config | Get bank configuration
|
|
*BanksAPI* | [**GetBankProfile**](docs/BanksAPI.md#getbankprofile) | **Get** /v1/default/banks/{bank_id}/profile | Get memory bank profile
|
|
*BanksAPI* | [**ListBanks**](docs/BanksAPI.md#listbanks) | **Get** /v1/default/banks | List all memory banks
|
|
*BanksAPI* | [**ResetBankConfig**](docs/BanksAPI.md#resetbankconfig) | **Delete** /v1/default/banks/{bank_id}/config | Reset bank configuration
|
|
*BanksAPI* | [**TriggerConsolidation**](docs/BanksAPI.md#triggerconsolidation) | **Post** /v1/default/banks/{bank_id}/consolidate | Trigger consolidation
|
|
*BanksAPI* | [**UpdateBank**](docs/BanksAPI.md#updatebank) | **Patch** /v1/default/banks/{bank_id} | Partial update memory bank
|
|
*BanksAPI* | [**UpdateBankConfig**](docs/BanksAPI.md#updatebankconfig) | **Patch** /v1/default/banks/{bank_id}/config | Update bank configuration
|
|
*BanksAPI* | [**UpdateBankDisposition**](docs/BanksAPI.md#updatebankdisposition) | **Put** /v1/default/banks/{bank_id}/profile | Update memory bank disposition
|
|
*DirectivesAPI* | [**CreateDirective**](docs/DirectivesAPI.md#createdirective) | **Post** /v1/default/banks/{bank_id}/directives | Create directive
|
|
*DirectivesAPI* | [**DeleteDirective**](docs/DirectivesAPI.md#deletedirective) | **Delete** /v1/default/banks/{bank_id}/directives/{directive_id} | Delete directive
|
|
*DirectivesAPI* | [**GetDirective**](docs/DirectivesAPI.md#getdirective) | **Get** /v1/default/banks/{bank_id}/directives/{directive_id} | Get directive
|
|
*DirectivesAPI* | [**ListDirectives**](docs/DirectivesAPI.md#listdirectives) | **Get** /v1/default/banks/{bank_id}/directives | List directives
|
|
*DirectivesAPI* | [**UpdateDirective**](docs/DirectivesAPI.md#updatedirective) | **Patch** /v1/default/banks/{bank_id}/directives/{directive_id} | Update directive
|
|
*DocumentsAPI* | [**DeleteDocument**](docs/DocumentsAPI.md#deletedocument) | **Delete** /v1/default/banks/{bank_id}/documents/{document_id} | Delete a document
|
|
*DocumentsAPI* | [**GetChunk**](docs/DocumentsAPI.md#getchunk) | **Get** /v1/default/chunks/{chunk_id} | Get chunk details
|
|
*DocumentsAPI* | [**GetDocument**](docs/DocumentsAPI.md#getdocument) | **Get** /v1/default/banks/{bank_id}/documents/{document_id} | Get document details
|
|
*DocumentsAPI* | [**ListDocuments**](docs/DocumentsAPI.md#listdocuments) | **Get** /v1/default/banks/{bank_id}/documents | List documents
|
|
*EntitiesAPI* | [**GetEntity**](docs/EntitiesAPI.md#getentity) | **Get** /v1/default/banks/{bank_id}/entities/{entity_id} | Get entity details
|
|
*EntitiesAPI* | [**ListEntities**](docs/EntitiesAPI.md#listentities) | **Get** /v1/default/banks/{bank_id}/entities | List entities
|
|
*EntitiesAPI* | [**RegenerateEntityObservations**](docs/EntitiesAPI.md#regenerateentityobservations) | **Post** /v1/default/banks/{bank_id}/entities/{entity_id}/regenerate | Regenerate entity observations (deprecated)
|
|
*MemoryAPI* | [**ClearBankMemories**](docs/MemoryAPI.md#clearbankmemories) | **Delete** /v1/default/banks/{bank_id}/memories | Clear memory bank memories
|
|
*MemoryAPI* | [**GetGraph**](docs/MemoryAPI.md#getgraph) | **Get** /v1/default/banks/{bank_id}/graph | Get memory graph data
|
|
*MemoryAPI* | [**GetMemory**](docs/MemoryAPI.md#getmemory) | **Get** /v1/default/banks/{bank_id}/memories/{memory_id} | Get memory unit
|
|
*MemoryAPI* | [**ListMemories**](docs/MemoryAPI.md#listmemories) | **Get** /v1/default/banks/{bank_id}/memories/list | List memory units
|
|
*MemoryAPI* | [**ListTags**](docs/MemoryAPI.md#listtags) | **Get** /v1/default/banks/{bank_id}/tags | List tags
|
|
*MemoryAPI* | [**RecallMemories**](docs/MemoryAPI.md#recallmemories) | **Post** /v1/default/banks/{bank_id}/memories/recall | Recall memory
|
|
*MemoryAPI* | [**Reflect**](docs/MemoryAPI.md#reflect) | **Post** /v1/default/banks/{bank_id}/reflect | Reflect and generate answer
|
|
*MemoryAPI* | [**RetainMemories**](docs/MemoryAPI.md#retainmemories) | **Post** /v1/default/banks/{bank_id}/memories | Retain memories
|
|
*MentalModelsAPI* | [**CreateMentalModel**](docs/MentalModelsAPI.md#creatementalmodel) | **Post** /v1/default/banks/{bank_id}/mental-models | Create mental model
|
|
*MentalModelsAPI* | [**DeleteMentalModel**](docs/MentalModelsAPI.md#deletementalmodel) | **Delete** /v1/default/banks/{bank_id}/mental-models/{mental_model_id} | Delete mental model
|
|
*MentalModelsAPI* | [**GetMentalModel**](docs/MentalModelsAPI.md#getmentalmodel) | **Get** /v1/default/banks/{bank_id}/mental-models/{mental_model_id} | Get mental model
|
|
*MentalModelsAPI* | [**ListMentalModels**](docs/MentalModelsAPI.md#listmentalmodels) | **Get** /v1/default/banks/{bank_id}/mental-models | List mental models
|
|
*MentalModelsAPI* | [**RefreshMentalModel**](docs/MentalModelsAPI.md#refreshmentalmodel) | **Post** /v1/default/banks/{bank_id}/mental-models/{mental_model_id}/refresh | Refresh mental model
|
|
*MentalModelsAPI* | [**UpdateMentalModel**](docs/MentalModelsAPI.md#updatementalmodel) | **Patch** /v1/default/banks/{bank_id}/mental-models/{mental_model_id} | Update mental model
|
|
*MonitoringAPI* | [**GetVersion**](docs/MonitoringAPI.md#getversion) | **Get** /version | Get API version and feature flags
|
|
*MonitoringAPI* | [**HealthEndpointHealthGet**](docs/MonitoringAPI.md#healthendpointhealthget) | **Get** /health | Health check endpoint
|
|
*MonitoringAPI* | [**MetricsEndpointMetricsGet**](docs/MonitoringAPI.md#metricsendpointmetricsget) | **Get** /metrics | Prometheus metrics endpoint
|
|
*OperationsAPI* | [**CancelOperation**](docs/OperationsAPI.md#canceloperation) | **Delete** /v1/default/banks/{bank_id}/operations/{operation_id} | Cancel a pending async operation
|
|
*OperationsAPI* | [**GetOperationStatus**](docs/OperationsAPI.md#getoperationstatus) | **Get** /v1/default/banks/{bank_id}/operations/{operation_id} | Get operation status
|
|
*OperationsAPI* | [**ListOperations**](docs/OperationsAPI.md#listoperations) | **Get** /v1/default/banks/{bank_id}/operations | List async operations
|
|
|
|
|
|
## Documentation For Models
|
|
|
|
- [AddBackgroundRequest](docs/AddBackgroundRequest.md)
|
|
- [AsyncOperationSubmitResponse](docs/AsyncOperationSubmitResponse.md)
|
|
- [BackgroundResponse](docs/BackgroundResponse.md)
|
|
- [BankConfigResponse](docs/BankConfigResponse.md)
|
|
- [BankConfigUpdate](docs/BankConfigUpdate.md)
|
|
- [BankListItem](docs/BankListItem.md)
|
|
- [BankListResponse](docs/BankListResponse.md)
|
|
- [BankProfileResponse](docs/BankProfileResponse.md)
|
|
- [BankStatsResponse](docs/BankStatsResponse.md)
|
|
- [Budget](docs/Budget.md)
|
|
- [CancelOperationResponse](docs/CancelOperationResponse.md)
|
|
- [ChunkData](docs/ChunkData.md)
|
|
- [ChunkIncludeOptions](docs/ChunkIncludeOptions.md)
|
|
- [ChunkResponse](docs/ChunkResponse.md)
|
|
- [ConsolidationResponse](docs/ConsolidationResponse.md)
|
|
- [CreateBankRequest](docs/CreateBankRequest.md)
|
|
- [CreateDirectiveRequest](docs/CreateDirectiveRequest.md)
|
|
- [CreateMentalModelRequest](docs/CreateMentalModelRequest.md)
|
|
- [CreateMentalModelResponse](docs/CreateMentalModelResponse.md)
|
|
- [DeleteDocumentResponse](docs/DeleteDocumentResponse.md)
|
|
- [DeleteResponse](docs/DeleteResponse.md)
|
|
- [DirectiveListResponse](docs/DirectiveListResponse.md)
|
|
- [DirectiveResponse](docs/DirectiveResponse.md)
|
|
- [DispositionTraits](docs/DispositionTraits.md)
|
|
- [DocumentResponse](docs/DocumentResponse.md)
|
|
- [EntityDetailResponse](docs/EntityDetailResponse.md)
|
|
- [EntityIncludeOptions](docs/EntityIncludeOptions.md)
|
|
- [EntityInput](docs/EntityInput.md)
|
|
- [EntityListItem](docs/EntityListItem.md)
|
|
- [EntityListResponse](docs/EntityListResponse.md)
|
|
- [EntityObservationResponse](docs/EntityObservationResponse.md)
|
|
- [EntityStateResponse](docs/EntityStateResponse.md)
|
|
- [FeaturesInfo](docs/FeaturesInfo.md)
|
|
- [GraphDataResponse](docs/GraphDataResponse.md)
|
|
- [HTTPValidationError](docs/HTTPValidationError.md)
|
|
- [IncludeOptions](docs/IncludeOptions.md)
|
|
- [ListDocumentsResponse](docs/ListDocumentsResponse.md)
|
|
- [ListMemoryUnitsResponse](docs/ListMemoryUnitsResponse.md)
|
|
- [ListTagsResponse](docs/ListTagsResponse.md)
|
|
- [MemoryItem](docs/MemoryItem.md)
|
|
- [MentalModelListResponse](docs/MentalModelListResponse.md)
|
|
- [MentalModelResponse](docs/MentalModelResponse.md)
|
|
- [MentalModelTrigger](docs/MentalModelTrigger.md)
|
|
- [OperationResponse](docs/OperationResponse.md)
|
|
- [OperationStatusResponse](docs/OperationStatusResponse.md)
|
|
- [OperationsListResponse](docs/OperationsListResponse.md)
|
|
- [RecallRequest](docs/RecallRequest.md)
|
|
- [RecallResponse](docs/RecallResponse.md)
|
|
- [RecallResult](docs/RecallResult.md)
|
|
- [ReflectBasedOn](docs/ReflectBasedOn.md)
|
|
- [ReflectDirective](docs/ReflectDirective.md)
|
|
- [ReflectFact](docs/ReflectFact.md)
|
|
- [ReflectIncludeOptions](docs/ReflectIncludeOptions.md)
|
|
- [ReflectLLMCall](docs/ReflectLLMCall.md)
|
|
- [ReflectMentalModel](docs/ReflectMentalModel.md)
|
|
- [ReflectRequest](docs/ReflectRequest.md)
|
|
- [ReflectResponse](docs/ReflectResponse.md)
|
|
- [ReflectToolCall](docs/ReflectToolCall.md)
|
|
- [ReflectTrace](docs/ReflectTrace.md)
|
|
- [RetainRequest](docs/RetainRequest.md)
|
|
- [RetainResponse](docs/RetainResponse.md)
|
|
- [TagItem](docs/TagItem.md)
|
|
- [TokenUsage](docs/TokenUsage.md)
|
|
- [ToolCallsIncludeOptions](docs/ToolCallsIncludeOptions.md)
|
|
- [UpdateDirectiveRequest](docs/UpdateDirectiveRequest.md)
|
|
- [UpdateDispositionRequest](docs/UpdateDispositionRequest.md)
|
|
- [UpdateMentalModelRequest](docs/UpdateMentalModelRequest.md)
|
|
- [ValidationError](docs/ValidationError.md)
|
|
- [ValidationErrorLocInner](docs/ValidationErrorLocInner.md)
|
|
- [VersionResponse](docs/VersionResponse.md)
|
|
|
|
|
|
## Documentation For Authorization
|
|
|
|
Endpoints do not require authorization.
|
|
|
|
|
|
## Documentation for Utility Methods
|
|
|
|
Due to the fact that model structure members are all pointers, this package contains
|
|
a number of utility functions to easily obtain pointers to values of basic types.
|
|
Each of these functions takes a value of the given basic type and returns a pointer to it:
|
|
|
|
* `PtrBool`
|
|
* `PtrInt`
|
|
* `PtrInt32`
|
|
* `PtrInt64`
|
|
* `PtrFloat`
|
|
* `PtrFloat32`
|
|
* `PtrFloat64`
|
|
* `PtrString`
|
|
* `PtrTime`
|
|
|
|
## Author
|
|
|
|
|
|
|