Documentation
¶
Overview ¶
Package goodmem is the Go SDK for the GoodMem memory API.
It is generated from the same universal API IR (api_ir.json) that drives the Python, Java and MCP SDKs, so the wire contract is identical across every language. Generated wire types live in the models subpackage; the user-facing client surface (services, pagination, streaming, convenience transforms) is layered on top in later generation phases.
Code in this module is produced by clients/_clients_gen/go — do not edit generated files by hand. Regenerate with: ./clients/clients_gen.sh
Deliberate Go-idiomatic divergences from the Python/Java SDKs (see clients/notes/new_language.md for the cross-language symmetry checklist):
- Synchronous only. Every method takes a context.Context; cancellation and deadlines come from the context rather than a parallel async surface (checklist item 15). There is no AsyncClient.
- String resource IDs. IDs stay plain strings rather than typed handles (SpaceID, MemoryID, …); Go callers conventionally pass string ids and the compiler-safety win doesn't justify the surface weight (checklist item 5).
- Unknown response enums are tolerated for free. Enums are typed string constants, so an unrecognized server value deserializes without error (inv-unknown-server-enum-coerces-not-crash) — no coercion layer needed.
- Numeric range guards are request-side only. They run in a model's Validate() (called before a request is sent) but not on response deserialization, so a zero-valued server response is never rejected (inv-numeric-range-from-ir).
Index ¶
- func Ptr[T any](v T) *T
- type APIError
- type APIKeysListParams
- type APIKeysService
- func (s *APIKeysService) Create(ctx context.Context, req *models.CreateAPIKeyRequest) (*models.CreateAPIKeyResponse, error)
- func (s *APIKeysService) Delete(ctx context.Context, id string) error
- func (s *APIKeysService) Get(ctx context.Context, id string) (*models.APIKeyResponse, error)
- func (s *APIKeysService) List(ctx context.Context, params *APIKeysListParams) (*Page[models.APIKeyResponse], error)
- func (s *APIKeysService) Update(ctx context.Context, id string, req *models.UpdateAPIKeyRequest) (*models.APIKeyResponse, error)
- type AccessPolicyGrantsGetParams
- type AccessPolicyGrantsListParams
- type AccessPolicyRoleAssignmentsGetParams
- type AccessPolicyRoleAssignmentsListParams
- type AccessPolicyService
- func (s *AccessPolicyService) Check(ctx context.Context, req *models.CheckAuthorizationsRequest) (*models.CheckAuthorizationsResponse, error)
- func (s *AccessPolicyService) GrantsCreate(ctx context.Context, req *models.CreateAuthorizationGrantRequest) (*models.AuthorizationGrant, error)
- func (s *AccessPolicyService) GrantsDelete(ctx context.Context, id string) (*models.AuthorizationGrant, error)
- func (s *AccessPolicyService) GrantsGet(ctx context.Context, id string, params *AccessPolicyGrantsGetParams) (*models.AuthorizationGrant, error)
- func (s *AccessPolicyService) GrantsList(ctx context.Context, params *AccessPolicyGrantsListParams) (*Page[models.AuthorizationGrant], error)
- func (s *AccessPolicyService) RoleAssignmentsCreate(ctx context.Context, req *models.AssignRoleRequest) (*models.RoleAssignment, error)
- func (s *AccessPolicyService) RoleAssignmentsDelete(ctx context.Context, id string) (*models.RoleAssignment, error)
- func (s *AccessPolicyService) RoleAssignmentsGet(ctx context.Context, id string, params *AccessPolicyRoleAssignmentsGetParams) (*models.RoleAssignment, error)
- func (s *AccessPolicyService) RoleAssignmentsList(ctx context.Context, params *AccessPolicyRoleAssignmentsListParams) (*Page[models.RoleAssignment], error)
- type AdminRetrieveMemoryLogPoliciesGetParams
- type AdminRetrieveMemoryLogPoliciesListParams
- type AdminService
- func (s *AdminService) BackgroundJobsPurge(ctx context.Context, req *models.AdminPurgeJobsRequest) (*models.AdminPurgeJobsResponse, error)
- func (s *AdminService) Drain(ctx context.Context, req *models.AdminDrainRequest) (*models.AdminDrainResponse, error)
- func (s *AdminService) LicenseReload(ctx context.Context) (*models.AdminReloadLicenseResponse, error)
- func (s *AdminService) RetrieveMemoryLogPoliciesCreate(ctx context.Context, req *models.CreateRetrieveMemoryLogPolicyRequest) (*models.RetrieveMemoryLogPolicy, error)
- func (s *AdminService) RetrieveMemoryLogPoliciesDelete(ctx context.Context, id string, ...) (*models.RetrieveMemoryLogPolicy, error)
- func (s *AdminService) RetrieveMemoryLogPoliciesGet(ctx context.Context, id string, ...) (*models.RetrieveMemoryLogPolicy, error)
- func (s *AdminService) RetrieveMemoryLogPoliciesList(ctx context.Context, params *AdminRetrieveMemoryLogPoliciesListParams) (*Page[models.RetrieveMemoryLogPolicy], error)
- func (s *AdminService) TransferInstanceOwnership(ctx context.Context, req *models.TransferOwnershipRequest) (*models.TransferInstanceOwnershipResponse, error)
- type AuthenticationError
- type BadRequestError
- type Client
- func (c *Client) APIKeys() *APIKeysService
- func (c *Client) AccessPolicy() *AccessPolicyService
- func (c *Client) Admin() *AdminService
- func (c *Client) DecisionModels() *DecisionModelsService
- func (c *Client) Embedders() *EmbeddersService
- func (c *Client) Instance() *InstanceService
- func (c *Client) LLMs() *LLMsService
- func (c *Client) Memories() *MemoriesService
- func (c *Client) OCR() *OCRService
- func (c *Client) Ping() *PingService
- func (c *Client) Rerankers() *RerankersService
- func (c *Client) ServiceIdentities() *ServiceIdentitiesService
- func (c *Client) Spaces() *SpacesService
- func (c *Client) System() *SystemService
- func (c *Client) UserEnrollments() *UserEnrollmentsService
- func (c *Client) Users() *UsersService
- type ConflictError
- type DecisionModelsGetParams
- type DecisionModelsListParams
- type DecisionModelsService
- func (s *DecisionModelsService) Create(ctx context.Context, req *models.CreateDecisionModelRequest) (*models.DecisionModelResponse, error)
- func (s *DecisionModelsService) Decide(ctx context.Context, id string, req *models.DecisionRequest) (*models.DecisionResponse, error)
- func (s *DecisionModelsService) Delete(ctx context.Context, id string) error
- func (s *DecisionModelsService) Get(ctx context.Context, id string, params *DecisionModelsGetParams) (*models.DecisionModelResponse, error)
- func (s *DecisionModelsService) List(ctx context.Context, params *DecisionModelsListParams) (*models.ListDecisionModelsResponse, error)
- func (s *DecisionModelsService) Update(ctx context.Context, id string, req *models.UpdateDecisionModelRequest) (*models.DecisionModelResponse, error)
- type EmbeddersGetParams
- type EmbeddersListParams
- type EmbeddersService
- func (s *EmbeddersService) Create(ctx context.Context, req *models.EmbedderCreationRequest, apiKey string) (*models.EmbedderResponse, error)
- func (s *EmbeddersService) Delete(ctx context.Context, id string) error
- func (s *EmbeddersService) Get(ctx context.Context, id string, params *EmbeddersGetParams) (*models.EmbedderResponse, error)
- func (s *EmbeddersService) List(ctx context.Context, params *EmbeddersListParams) (*models.ListEmbeddersResponse, error)
- func (s *EmbeddersService) Update(ctx context.Context, id string, req *models.UpdateEmbedderRequest) (*models.EmbedderResponse, error)
- type Error
- type GoodmemError
- type InstanceService
- type InternalServerError
- type LLMsGetParams
- type LLMsListParams
- type LLMsService
- func (s *LLMsService) Create(ctx context.Context, req *models.LLMCreationRequest, apiKey string) (*models.CreateLLMResponse, error)
- func (s *LLMsService) Delete(ctx context.Context, id string) error
- func (s *LLMsService) Get(ctx context.Context, id string, params *LLMsGetParams) (*models.LLMResponse, error)
- func (s *LLMsService) List(ctx context.Context, params *LLMsListParams) (*models.ListLLMsResponse, error)
- func (s *LLMsService) Update(ctx context.Context, id string, req *models.LLMUpdateRequest) (*models.LLMResponse, error)
- type MemoriesGetParams
- type MemoriesListParams
- type MemoriesPagesImageParams
- type MemoriesPagesParams
- type MemoriesService
- func (s *MemoriesService) BatchCreate(ctx context.Context, req *models.JSONBatchMemoryCreationRequest) (*models.BatchMemoryResponse, error)
- func (s *MemoriesService) BatchDelete(ctx context.Context, req *models.BatchMemoryDeletionRequest) (*models.BatchMemoryResponse, error)
- func (s *MemoriesService) BatchGet(ctx context.Context, req *models.BatchMemoryRetrievalRequest) (*models.BatchMemoryResponse, error)
- func (s *MemoriesService) Content(ctx context.Context, id string) ([]byte, error)
- func (s *MemoriesService) ContentWithHeaders(ctx context.Context, id string, headers map[string]string) ([]byte, error)
- func (s *MemoriesService) Create(ctx context.Context, req *models.JSONMemoryCreationRequest) (*models.Memory, error)
- func (s *MemoriesService) CreateFromFile(ctx context.Context, filePath string, req *models.JSONMemoryCreationRequest) (*models.Memory, error)
- func (s *MemoriesService) CreateFromReader(ctx context.Context, r io.Reader, filename string, ...) (*models.Memory, error)
- func (s *MemoriesService) Delete(ctx context.Context, id string) error
- func (s *MemoriesService) Get(ctx context.Context, id string, params *MemoriesGetParams) (*models.Memory, error)
- func (s *MemoriesService) List(ctx context.Context, spaceID string, params *MemoriesListParams) (*Page[models.Memory], error)
- func (s *MemoriesService) Pages(ctx context.Context, id string, params *MemoriesPagesParams) (*Page[models.MemoryPageImage], error)
- func (s *MemoriesService) PagesImage(ctx context.Context, id string, pageIndex string, ...) ([]byte, error)
- func (s *MemoriesService) PagesImageWithHeaders(ctx context.Context, id string, pageIndex string, ...) ([]byte, error)
- func (s *MemoriesService) Retrieve(ctx context.Context, message string, opts *RetrieveOptions) (*Stream[models.RetrieveMemoryEvent], error)
- func (s *MemoriesService) RetrieveRaw(ctx context.Context, req *models.RetrieveMemoryRequest) (*Stream[models.RetrieveMemoryEvent], error)
- type NetworkError
- type NotFoundError
- type OCRService
- type Option
- type Page
- type PermissionDeniedError
- type PingService
- type RateLimitError
- type RerankersGetParams
- type RerankersListParams
- type RerankersService
- func (s *RerankersService) Create(ctx context.Context, req *models.RerankerCreationRequest, apiKey string) (*models.RerankerResponse, error)
- func (s *RerankersService) Delete(ctx context.Context, id string) error
- func (s *RerankersService) Get(ctx context.Context, id string, params *RerankersGetParams) (*models.RerankerResponse, error)
- func (s *RerankersService) List(ctx context.Context, params *RerankersListParams) (*models.ListRerankersResponse, error)
- func (s *RerankersService) Update(ctx context.Context, id string, req *models.UpdateRerankerRequest) (*models.RerankerResponse, error)
- type RetrieveOptions
- type ServiceIdentitiesGetParams
- type ServiceIdentitiesListParams
- type ServiceIdentitiesService
- func (s *ServiceIdentitiesService) Create(ctx context.Context, req *models.CreateServiceIdentityRequest) (*models.ServiceIdentityResponse, error)
- func (s *ServiceIdentitiesService) Delete(ctx context.Context, id string) error
- func (s *ServiceIdentitiesService) Get(ctx context.Context, id string, params *ServiceIdentitiesGetParams) (*models.ServiceIdentityResponse, error)
- func (s *ServiceIdentitiesService) List(ctx context.Context, params *ServiceIdentitiesListParams) (*Page[models.ServiceIdentityResponse], error)
- func (s *ServiceIdentitiesService) TransferOwnership(ctx context.Context, id string, req *models.TransferOwnershipRequest) (*models.TransferServiceIdentityOwnershipResponse, error)
- func (s *ServiceIdentitiesService) Update(ctx context.Context, id string, req *models.UpdateServiceIdentityRequest) (*models.ServiceIdentityResponse, error)
- type SpacesListParams
- type SpacesService
- func (s *SpacesService) Create(ctx context.Context, req *models.SpaceCreationRequest) (*models.Space, error)
- func (s *SpacesService) Delete(ctx context.Context, id string) error
- func (s *SpacesService) Get(ctx context.Context, id string) (*models.Space, error)
- func (s *SpacesService) List(ctx context.Context, params *SpacesListParams) (*Page[models.Space], error)
- func (s *SpacesService) TransferOwnership(ctx context.Context, id string, req *models.TransferOwnershipRequest) (*models.TransferSpaceOwnershipResponse, error)
- func (s *SpacesService) Update(ctx context.Context, id string, req *models.UpdateSpaceRequest) (*models.Space, error)
- type Stream
- type SystemService
- type UnprocessableEntityError
- type UserEnrollmentsService
- type UsersGetByUsernameParams
- type UsersGetOptions
- type UsersListEnrollmentsParams
- type UsersListParams
- type UsersService
- func (s *UsersService) Create(ctx context.Context, req *models.CreateUserRequest) (*models.UserResponse, error)
- func (s *UsersService) CreateEnrollment(ctx context.Context, userID string, req *models.CreateUserEnrollmentRequest) (*models.CreateUserEnrollmentResponse, error)
- func (s *UsersService) Delete(ctx context.Context, id string) error
- func (s *UsersService) Get(ctx context.Context, opts *UsersGetOptions) (*models.UserResponse, error)
- func (s *UsersService) GetByUsername(ctx context.Context, username string, params *UsersGetByUsernameParams) (*models.UserResponse, error)
- func (s *UsersService) GetEnrollment(ctx context.Context, userID string, enrollmentID string) (*models.UserEnrollmentResponse, error)
- func (s *UsersService) List(ctx context.Context, params *UsersListParams) (*Page[models.UserResponse], error)
- func (s *UsersService) ListEnrollments(ctx context.Context, userID string, params *UsersListEnrollmentsParams) (*Page[models.UserEnrollmentResponse], error)
- func (s *UsersService) Me(ctx context.Context) (*models.UserResponse, error)
- func (s *UsersService) RevokeEnrollment(ctx context.Context, userID string, enrollmentID string) error
- func (s *UsersService) Update(ctx context.Context, id string, req *models.UpdateUserRequest) (*models.UserResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ptr ¶
func Ptr[T any](v T) *T
Ptr returns a pointer to v. Optional request fields are modeled as *T so an unset field (nil) is distinguishable from a zero value, which otherwise forces callers to introduce a temporary just to take its address. Ptr removes that boilerplate at the call site:
req := &models.EmbedderCreationRequest{
DisplayName: "OpenAI Small",
ModelIdentifier: "text-embedding-3-small",
MaxSequenceLen: goodmem.Ptr(int32(512)),
}
The type parameter is inferred from the argument, so a numeric literal keeps its default type — write goodmem.Ptr(int32(5)) when the field is *int32.
Types ¶
type APIError ¶
APIError is the base for any HTTP 4xx/5xx returned by the server. Its Message embeds the server's response body (truncated to 500 chars) so logging the error shows why the call failed instead of a bare status code (inv-http-error-body). The full payload is on Body; branch on StatusCode.
Typed subclasses cover the common statuses; a status without a typed subclass surfaces as a plain *APIError. Every subclass exposes the base via errors.As(err, &apiErr) where apiErr is *APIError.
type APIKeysListParams ¶
type APIKeysListParams struct {
// SubjectPrincipalID Filter by exact subject-principal UUID
SubjectPrincipalID *string `json:"-"`
// OwnerPrincipalID Filter by exact administrative-owner UUID
OwnerPrincipalID *string `json:"-"`
// LifecycleState Filter by precise lifecycle state
LifecycleState *string `json:"-"`
// View Metadata projection; omission defaults to FULL
View *string `json:"-"`
// MaxResults Page size; FULL defaults to 10 and permits at most 20, while BASIC defaults to 50 and permits at most 1,000
MaxResults *int32 `json:"-"`
// NextToken Opaque continuation token returned by the preceding page
NextToken *string `json:"-"`
}
APIKeysListParams holds the optional query parameters for APIKeysService.List.
type APIKeysService ¶
type APIKeysService struct {
// contains filtered or unexported fields
}
APIKeysService groups the apikeys namespace methods.
func (*APIKeysService) Create ¶
func (s *APIKeysService) Create(ctx context.Context, req *models.CreateAPIKeyRequest) (*models.CreateAPIKeyResponse, error)
Create Create a new API key
func (*APIKeysService) Delete ¶
func (s *APIKeysService) Delete(ctx context.Context, id string) error
Delete Delete an API key
func (*APIKeysService) Get ¶
func (s *APIKeysService) Get(ctx context.Context, id string) (*models.APIKeyResponse, error)
Get Get an API key
func (*APIKeysService) List ¶
func (s *APIKeysService) List(ctx context.Context, params *APIKeysListParams) (*Page[models.APIKeyResponse], error)
List List API keys
func (*APIKeysService) Update ¶
func (s *APIKeysService) Update(ctx context.Context, id string, req *models.UpdateAPIKeyRequest) (*models.APIKeyResponse, error)
Update Update an API key
type AccessPolicyGrantsGetParams ¶
type AccessPolicyGrantsGetParams struct {
// IncludeRevoked Include a revoked historical row
IncludeRevoked *bool `json:"-"`
}
AccessPolicyGrantsGetParams holds the optional query parameters for AccessPolicyService.GrantsGet.
type AccessPolicyGrantsListParams ¶
type AccessPolicyGrantsListParams struct {
// ResourceKind Required target resource kind
ResourceKind *string `json:"-"`
// ResourceID Required target UUID except when resourceKind is INSTANCE
ResourceID *string `json:"-"`
// IncludeRevoked Include revoked history
IncludeRevoked *bool `json:"-"`
// MaxResults Page size; 0 or omission uses the default of 50, maximum 1,000
MaxResults *int32 `json:"-"`
// NextToken Opaque continuation token
NextToken *string `json:"-"`
}
AccessPolicyGrantsListParams holds the optional query parameters for AccessPolicyService.GrantsList.
type AccessPolicyRoleAssignmentsGetParams ¶
type AccessPolicyRoleAssignmentsGetParams struct {
// IncludeRevoked Include a revoked historical row
IncludeRevoked *bool `json:"-"`
}
AccessPolicyRoleAssignmentsGetParams holds the optional query parameters for AccessPolicyService.RoleAssignmentsGet.
type AccessPolicyRoleAssignmentsListParams ¶
type AccessPolicyRoleAssignmentsListParams struct {
// ResourceKind Required INSTANCE or SPACE kind
ResourceKind *string `json:"-"`
// ResourceID Required space UUID; omitted for INSTANCE
ResourceID *string `json:"-"`
// IncludeRevoked Include revoked history
IncludeRevoked *bool `json:"-"`
// MaxResults Page size; 0 or omission uses the default of 50, maximum 1,000
MaxResults *int32 `json:"-"`
// NextToken Opaque continuation token
NextToken *string `json:"-"`
}
AccessPolicyRoleAssignmentsListParams holds the optional query parameters for AccessPolicyService.RoleAssignmentsList.
type AccessPolicyService ¶
type AccessPolicyService struct {
// contains filtered or unexported fields
}
AccessPolicyService groups the access_policy namespace methods.
func (*AccessPolicyService) Check ¶
func (s *AccessPolicyService) Check(ctx context.Context, req *models.CheckAuthorizationsRequest) (*models.CheckAuthorizationsResponse, error)
Check Check effective authorization
func (*AccessPolicyService) GrantsCreate ¶
func (s *AccessPolicyService) GrantsCreate(ctx context.Context, req *models.CreateAuthorizationGrantRequest) (*models.AuthorizationGrant, error)
GrantsCreate Create an authorization grant
func (*AccessPolicyService) GrantsDelete ¶
func (s *AccessPolicyService) GrantsDelete(ctx context.Context, id string) (*models.AuthorizationGrant, error)
GrantsDelete Revoke an authorization grant
func (*AccessPolicyService) GrantsGet ¶
func (s *AccessPolicyService) GrantsGet(ctx context.Context, id string, params *AccessPolicyGrantsGetParams) (*models.AuthorizationGrant, error)
GrantsGet Get an authorization grant
func (*AccessPolicyService) GrantsList ¶
func (s *AccessPolicyService) GrantsList(ctx context.Context, params *AccessPolicyGrantsListParams) (*Page[models.AuthorizationGrant], error)
GrantsList List authorization grants
func (*AccessPolicyService) RoleAssignmentsCreate ¶
func (s *AccessPolicyService) RoleAssignmentsCreate(ctx context.Context, req *models.AssignRoleRequest) (*models.RoleAssignment, error)
RoleAssignmentsCreate Assign a scoped role
func (*AccessPolicyService) RoleAssignmentsDelete ¶
func (s *AccessPolicyService) RoleAssignmentsDelete(ctx context.Context, id string) (*models.RoleAssignment, error)
RoleAssignmentsDelete Revoke a scoped role assignment
func (*AccessPolicyService) RoleAssignmentsGet ¶
func (s *AccessPolicyService) RoleAssignmentsGet(ctx context.Context, id string, params *AccessPolicyRoleAssignmentsGetParams) (*models.RoleAssignment, error)
RoleAssignmentsGet Get a scoped role assignment
func (*AccessPolicyService) RoleAssignmentsList ¶
func (s *AccessPolicyService) RoleAssignmentsList(ctx context.Context, params *AccessPolicyRoleAssignmentsListParams) (*Page[models.RoleAssignment], error)
RoleAssignmentsList List scoped role assignments
type AdminRetrieveMemoryLogPoliciesGetParams ¶
type AdminRetrieveMemoryLogPoliciesGetParams struct {
// IncludeDeleted Whether to include tombstoned policies. Also accepts include_deleted.
IncludeDeleted *bool `json:"-"`
}
AdminRetrieveMemoryLogPoliciesGetParams holds the optional query parameters for AdminService.RetrieveMemoryLogPoliciesGet.
type AdminRetrieveMemoryLogPoliciesListParams ¶
type AdminRetrieveMemoryLogPoliciesListParams struct {
// IncludeDeleted Whether to include tombstoned policies. Also accepts include_deleted.
IncludeDeleted *bool `json:"-"`
// NameFilter Case-insensitive substring filter on policy display names. Also accepts name_filter.
NameFilter *string `json:"-"`
// ActiveAt Only return policies active at this millisecond epoch timestamp. Also accepts active_at.
ActiveAt *int64 `json:"-"`
// MaxResults Maximum number of policies to return. Also accepts max_results.
MaxResults *int32 `json:"-"`
// NextToken Opaque pagination token returned by the previous list response. Also accepts next_token.
NextToken *string `json:"-"`
// SortBy Sort field: created_at, updated_at, or display_name. Also accepts sort_by.
SortBy *string `json:"-"`
// SortOrder Sort order. Also accepts sort_order.
SortOrder *models.SortOrder `json:"-"`
// Label Filter by label key-value pairs. Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
Label map[string]string `json:"-"`
}
AdminRetrieveMemoryLogPoliciesListParams holds the optional query parameters for AdminService.RetrieveMemoryLogPoliciesList.
type AdminService ¶
type AdminService struct {
// contains filtered or unexported fields
}
AdminService groups the admin namespace methods.
func (*AdminService) BackgroundJobsPurge ¶
func (s *AdminService) BackgroundJobsPurge(ctx context.Context, req *models.AdminPurgeJobsRequest) (*models.AdminPurgeJobsResponse, error)
BackgroundJobsPurge Purge completed background jobs
func (*AdminService) Drain ¶
func (s *AdminService) Drain(ctx context.Context, req *models.AdminDrainRequest) (*models.AdminDrainResponse, error)
Drain Request the server to enter drain mode
func (*AdminService) LicenseReload ¶
func (s *AdminService) LicenseReload(ctx context.Context) (*models.AdminReloadLicenseResponse, error)
LicenseReload Reload the active license from disk
func (*AdminService) RetrieveMemoryLogPoliciesCreate ¶
func (s *AdminService) RetrieveMemoryLogPoliciesCreate(ctx context.Context, req *models.CreateRetrieveMemoryLogPolicyRequest) (*models.RetrieveMemoryLogPolicy, error)
RetrieveMemoryLogPoliciesCreate Create a RetrieveMemory log policy
func (*AdminService) RetrieveMemoryLogPoliciesDelete ¶
func (s *AdminService) RetrieveMemoryLogPoliciesDelete(ctx context.Context, id string, req *models.DeleteRetrieveMemoryLogPolicyRequest) (*models.RetrieveMemoryLogPolicy, error)
RetrieveMemoryLogPoliciesDelete Delete a RetrieveMemory log policy
func (*AdminService) RetrieveMemoryLogPoliciesGet ¶
func (s *AdminService) RetrieveMemoryLogPoliciesGet(ctx context.Context, id string, params *AdminRetrieveMemoryLogPoliciesGetParams) (*models.RetrieveMemoryLogPolicy, error)
RetrieveMemoryLogPoliciesGet Get a RetrieveMemory log policy
func (*AdminService) RetrieveMemoryLogPoliciesList ¶
func (s *AdminService) RetrieveMemoryLogPoliciesList(ctx context.Context, params *AdminRetrieveMemoryLogPoliciesListParams) (*Page[models.RetrieveMemoryLogPolicy], error)
RetrieveMemoryLogPoliciesList List RetrieveMemory log policies
func (*AdminService) TransferInstanceOwnership ¶
func (s *AdminService) TransferInstanceOwnership(ctx context.Context, req *models.TransferOwnershipRequest) (*models.TransferInstanceOwnershipResponse, error)
TransferInstanceOwnership Transfer GoodMem instance ownership
type AuthenticationError ¶
type AuthenticationError struct{ *APIError }
AuthenticationError is HTTP 401.
func (*AuthenticationError) Unwrap ¶
func (e *AuthenticationError) Unwrap() error
type BadRequestError ¶
type BadRequestError struct{ *APIError }
BadRequestError is HTTP 400.
func (*BadRequestError) Unwrap ¶
func (e *BadRequestError) Unwrap() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a synchronous client for the GoodMem REST API. Construct it with New, then reach each namespace through its accessor — c.Spaces().Create(...), c.Memories().Get(...), and so on. Methods take a context.Context (cancel or set a deadline on it to bound a call) and return a typed response plus an error; non-2xx responses come back as *APIError subclasses and transport failures as *NetworkError.
A Client is safe for concurrent use by multiple goroutines.
func New ¶
New returns a Client for the given base URL and API key. The base URL may carry a mount path prefix (e.g. https://host/api) — it is preserved on every request. An empty base URL is rejected here because there is no host to send to; an empty apiKey is allowed (the unauthenticated bootstrap endpoints /v1/system/info and /v1/system/init are callable without a key, and every other endpoint returns 401 from the server) — so the server, not the SDK, owns the "missing key" error (inv-empty-string-required-args).
func (*Client) APIKeys ¶
func (c *Client) APIKeys() *APIKeysService
APIKeys returns the apikeys namespace.
func (*Client) AccessPolicy ¶
func (c *Client) AccessPolicy() *AccessPolicyService
AccessPolicy returns the access_policy namespace.
func (*Client) DecisionModels ¶ added in v0.1.12
func (c *Client) DecisionModels() *DecisionModelsService
DecisionModels returns the decision_models namespace.
func (*Client) Embedders ¶
func (c *Client) Embedders() *EmbeddersService
Embedders returns the embedders namespace.
func (*Client) Instance ¶
func (c *Client) Instance() *InstanceService
Instance returns the instance namespace.
func (*Client) Memories ¶
func (c *Client) Memories() *MemoriesService
Memories returns the memories namespace.
func (*Client) Rerankers ¶
func (c *Client) Rerankers() *RerankersService
Rerankers returns the rerankers namespace.
func (*Client) ServiceIdentities ¶
func (c *Client) ServiceIdentities() *ServiceIdentitiesService
ServiceIdentities returns the service_identities namespace.
func (*Client) Spaces ¶
func (c *Client) Spaces() *SpacesService
Spaces returns the spaces namespace.
func (*Client) System ¶
func (c *Client) System() *SystemService
System returns the system namespace.
func (*Client) UserEnrollments ¶
func (c *Client) UserEnrollments() *UserEnrollmentsService
UserEnrollments returns the user_enrollments namespace.
type ConflictError ¶
type ConflictError struct{ *APIError }
ConflictError is HTTP 409.
func (*ConflictError) Unwrap ¶
func (e *ConflictError) Unwrap() error
type DecisionModelsGetParams ¶ added in v0.1.12
type DecisionModelsGetParams struct {
// IncludeCredentials Include stored credentials. Requires READ_DECISION_MODEL_CREDENTIALS in addition to READ_DECISION_MODEL.
IncludeCredentials *bool `json:"-"`
}
DecisionModelsGetParams holds the optional query parameters for DecisionModelsService.Get.
type DecisionModelsListParams ¶ added in v0.1.12
type DecisionModelsListParams struct {
// OwnerID Return only decision models owned by this principal UUID.
OwnerID *string `json:"-"`
// ProviderType Return only decision models that use this provider.
ProviderType *models.DecisionModelProviderType `json:"-"`
// PageSize Maximum number of models to return, from 1 to 1000. Omit this parameter or use 0 for 50.
PageSize *int32 `json:"-"`
// PageToken Use nextPageToken from the previous response to request the next page. Keep the filters and pageSize unchanged.
PageToken *string `json:"-"`
// Label Filter by label key-value pairs. Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
Label map[string]string `json:"-"`
}
DecisionModelsListParams holds the optional query parameters for DecisionModelsService.List.
type DecisionModelsService ¶ added in v0.1.12
type DecisionModelsService struct {
// contains filtered or unexported fields
}
DecisionModelsService groups the decision_models namespace methods.
func (*DecisionModelsService) Create ¶ added in v0.1.12
func (s *DecisionModelsService) Create(ctx context.Context, req *models.CreateDecisionModelRequest) (*models.DecisionModelResponse, error)
Create Create a decision model
func (*DecisionModelsService) Decide ¶ added in v0.1.12
func (s *DecisionModelsService) Decide(ctx context.Context, id string, req *models.DecisionRequest) (*models.DecisionResponse, error)
Decide Request decisions from a model
func (*DecisionModelsService) Delete ¶ added in v0.1.12
func (s *DecisionModelsService) Delete(ctx context.Context, id string) error
Delete Delete a decision model
func (*DecisionModelsService) Get ¶ added in v0.1.12
func (s *DecisionModelsService) Get(ctx context.Context, id string, params *DecisionModelsGetParams) (*models.DecisionModelResponse, error)
Get Get a decision model
func (*DecisionModelsService) List ¶ added in v0.1.12
func (s *DecisionModelsService) List(ctx context.Context, params *DecisionModelsListParams) (*models.ListDecisionModelsResponse, error)
List List decision models
func (*DecisionModelsService) Update ¶ added in v0.1.12
func (s *DecisionModelsService) Update(ctx context.Context, id string, req *models.UpdateDecisionModelRequest) (*models.DecisionModelResponse, error)
Update Update a decision model
type EmbeddersGetParams ¶
type EmbeddersGetParams struct {
// IncludeCredentials Whether to return stored credentials. Also accepts include_credentials. Requires READ_EMBEDDER_CREDENTIALS in addition to READ_EMBEDDER.
IncludeCredentials *bool `json:"-"`
}
EmbeddersGetParams holds the optional query parameters for EmbeddersService.Get.
type EmbeddersListParams ¶
type EmbeddersListParams struct {
// OwnerID Filter the already-authorized result set by owner principal UUID. Omitting this parameter does not bypass per-embedder READ_EMBEDDER filtering.
OwnerID *string `json:"-"`
// ProviderType Filter embedders by provider type. Allowed values match the ProviderType schema.
ProviderType *models.ProviderType `json:"-"`
// Label Filter by label key-value pairs. Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
Label map[string]string `json:"-"`
}
EmbeddersListParams holds the optional query parameters for EmbeddersService.List.
type EmbeddersService ¶
type EmbeddersService struct {
// contains filtered or unexported fields
}
EmbeddersService groups the embedders namespace methods.
func (*EmbeddersService) Create ¶
func (s *EmbeddersService) Create(ctx context.Context, req *models.EmbedderCreationRequest, apiKey string) (*models.EmbedderResponse, error)
Create Create a new embedder
func (*EmbeddersService) Delete ¶
func (s *EmbeddersService) Delete(ctx context.Context, id string) error
Delete Delete an embedder
func (*EmbeddersService) Get ¶
func (s *EmbeddersService) Get(ctx context.Context, id string, params *EmbeddersGetParams) (*models.EmbedderResponse, error)
Get Get an embedder by ID
func (*EmbeddersService) List ¶
func (s *EmbeddersService) List(ctx context.Context, params *EmbeddersListParams) (*models.ListEmbeddersResponse, error)
List List embedders
func (*EmbeddersService) Update ¶
func (s *EmbeddersService) Update(ctx context.Context, id string, req *models.UpdateEmbedderRequest) (*models.EmbedderResponse, error)
Update Update an embedder
type Error ¶
type Error interface {
error
// contains filtered or unexported methods
}
Error is the supertype of every error this SDK returns. Catch any SDK-originated failure with errors.As(err, &goodmemErr) where goodmemErr is a goodmem.Error — it matches HTTP status errors (*APIError and its typed kin), transport failures (*NetworkError), and SDK-internal failures (*GoodmemError) without enumerating concrete types.
Plain caller-fault argument validation (empty path id, nil request) is returned as a standard error (fmt.Errorf), NOT as a goodmem.Error — mirroring the cross-language rule (inv-exception-types-mapping) that caller-input validation stays a language-standard error rather than collapsing into the SDK-error catch bucket.
type GoodmemError ¶
GoodmemError is a generic SDK-internal failure that is neither an HTTP status error nor a transport failure — most commonly an unparseable response body. Go analogue of Java's GoodmemException base.
func (*GoodmemError) Error ¶
func (e *GoodmemError) Error() string
func (*GoodmemError) Unwrap ¶
func (e *GoodmemError) Unwrap() error
type InstanceService ¶
type InstanceService struct {
// contains filtered or unexported fields
}
InstanceService groups the instance namespace methods.
func (*InstanceService) Get ¶
func (s *InstanceService) Get(ctx context.Context) (*models.GoodMemInstance, error)
Get Get the GoodMem instance
type InternalServerError ¶
type InternalServerError struct{ *APIError }
InternalServerError is HTTP 5xx.
func (*InternalServerError) Unwrap ¶
func (e *InternalServerError) Unwrap() error
type LLMsGetParams ¶
type LLMsGetParams struct {
// IncludeCredentials Whether to return stored credentials. Also accepts include_credentials. Requires READ_LLM_CREDENTIALS in addition to READ_LLM.
IncludeCredentials *bool `json:"-"`
}
LLMsGetParams holds the optional query parameters for LLMsService.Get.
type LLMsListParams ¶
type LLMsListParams struct {
// OwnerID Filter the already-authorized result set by owner principal UUID. Omitting this parameter does not bypass per-LLM READ_LLM filtering.
OwnerID *string `json:"-"`
// ProviderType Filter LLMs by provider type. Allowed values match the LLMProviderType schema.
ProviderType *models.LLMProviderType `json:"-"`
// Label Filter by label key-value pairs. Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
Label map[string]string `json:"-"`
}
LLMsListParams holds the optional query parameters for LLMsService.List.
type LLMsService ¶
type LLMsService struct {
// contains filtered or unexported fields
}
LLMsService groups the llms namespace methods.
func (*LLMsService) Create ¶
func (s *LLMsService) Create(ctx context.Context, req *models.LLMCreationRequest, apiKey string) (*models.CreateLLMResponse, error)
Create Create a new LLM
func (*LLMsService) Delete ¶
func (s *LLMsService) Delete(ctx context.Context, id string) error
Delete Delete an LLM
func (*LLMsService) Get ¶
func (s *LLMsService) Get(ctx context.Context, id string, params *LLMsGetParams) (*models.LLMResponse, error)
Get Get an LLM by ID
func (*LLMsService) List ¶
func (s *LLMsService) List(ctx context.Context, params *LLMsListParams) (*models.ListLLMsResponse, error)
List List LLMs
func (*LLMsService) Update ¶
func (s *LLMsService) Update(ctx context.Context, id string, req *models.LLMUpdateRequest) (*models.LLMResponse, error)
Update Update an LLM
type MemoriesGetParams ¶
type MemoriesGetParams struct {
// IncludeContent Whether to include the original content in the response (defaults to false).
IncludeContent *bool `json:"-"`
// IncludeProcessingHistory Whether to include background job processing history in the response (defaults to false).
IncludeProcessingHistory *bool `json:"-"`
}
MemoriesGetParams holds the optional query parameters for MemoriesService.Get.
type MemoriesListParams ¶
type MemoriesListParams struct {
// IncludeContent Whether to include the original content in the response (defaults to false).
IncludeContent *bool `json:"-"`
// IncludeProcessingHistory Whether to include background job processing history in the response (defaults to false).
IncludeProcessingHistory *bool `json:"-"`
// StatusFilter Filter memories by processing status (PENDING, PROCESSING, COMPLETED, FAILED).
StatusFilter *string `json:"-"`
// Filter Optional metadata filter expression for list results
Filter *string `json:"-"`
// MaxResults Maximum number of results per page (defaults to 50, clamped to [1, 500]).
MaxResults *int32 `json:"-"`
// NextToken Opaque pagination token for the next page. URL-safe Base64 without padding; do not parse or construct it.
NextToken *string `json:"-"`
// SortBy Field to sort by (e.g., 'created_at').
SortBy *string `json:"-"`
// SortOrder Sort direction (ASCENDING or DESCENDING).
SortOrder *models.SortOrder `json:"-"`
}
MemoriesListParams holds the optional query parameters for MemoriesService.List.
type MemoriesPagesImageParams ¶
type MemoriesPagesImageParams struct {
// Dpi Optional rendition filter. If omitted, the unique page-image rendition for the page is returned; if multiple renditions exist, specify dpi and/or contentType.
Dpi *int32 `json:"-"`
// ContentType Optional rendition filter. MIME type of the desired page image, such as image/png.
ContentType *string `json:"-"`
}
MemoriesPagesImageParams holds the optional query parameters for MemoriesService.PagesImage.
type MemoriesPagesParams ¶
type MemoriesPagesParams struct {
// StartPageIndex Optional lower bound for returned page indices, inclusive.
StartPageIndex *int32 `json:"-"`
// EndPageIndex Optional upper bound for returned page indices, inclusive.
EndPageIndex *int32 `json:"-"`
// Dpi Optional rendition filter for page-image DPI.
Dpi *int32 `json:"-"`
// ContentType Optional rendition filter for page-image MIME type, such as image/png.
ContentType *string `json:"-"`
// MaxResults Maximum number of results per page.
MaxResults *int32 `json:"-"`
// NextToken Opaque pagination token for the next page. Do not parse or construct it.
NextToken *string `json:"-"`
}
MemoriesPagesParams holds the optional query parameters for MemoriesService.Pages.
type MemoriesService ¶
type MemoriesService struct {
// contains filtered or unexported fields
}
MemoriesService groups the memories namespace methods.
func (*MemoriesService) BatchCreate ¶
func (s *MemoriesService) BatchCreate(ctx context.Context, req *models.JSONBatchMemoryCreationRequest) (*models.BatchMemoryResponse, error)
BatchCreate Create multiple memories in a batch
func (*MemoriesService) BatchDelete ¶
func (s *MemoriesService) BatchDelete(ctx context.Context, req *models.BatchMemoryDeletionRequest) (*models.BatchMemoryResponse, error)
BatchDelete Delete memories in batch
func (*MemoriesService) BatchGet ¶
func (s *MemoriesService) BatchGet(ctx context.Context, req *models.BatchMemoryRetrievalRequest) (*models.BatchMemoryResponse, error)
BatchGet Get multiple memories by ID
func (*MemoriesService) ContentWithHeaders ¶ added in v0.1.13
func (s *MemoriesService) ContentWithHeaders(ctx context.Context, id string, headers map[string]string) ([]byte, error)
ContentWithHeaders Download memory content Headers apply only to this call (for example Range, Accept-Encoding, If-Match).
func (*MemoriesService) Create ¶
func (s *MemoriesService) Create(ctx context.Context, req *models.JSONMemoryCreationRequest) (*models.Memory, error)
Create Create a new memory
func (*MemoriesService) CreateFromFile ¶
func (s *MemoriesService) CreateFromFile(ctx context.Context, filePath string, req *models.JSONMemoryCreationRequest) (*models.Memory, error)
CreateFromFile creates a memory from a local file via a multipart upload — the Go analog of the Python/Java memories.create(file_path) overload. req supplies the space and any metadata (SpaceID is required); the file is the content, so any OriginalContent/OriginalContentB64 on req is ignored. When req.ContentType is empty it is inferred from the file extension.
func (*MemoriesService) CreateFromReader ¶
func (s *MemoriesService) CreateFromReader(ctx context.Context, r io.Reader, filename string, req *models.JSONMemoryCreationRequest) (*models.Memory, error)
CreateFromReader creates a memory by streaming an arbitrary io.Reader as the multipart file part — the streaming sibling of CreateFromFile for content that isn't a local file (an object-store stream, an HTTP response body, an in-memory buffer). The body is streamed with io.Pipe so a large upload never stages the whole payload in memory. filename names the part and, when req.ContentType is empty, drives MIME inference from its extension (pass "" to fall back to application/octet-stream). req supplies the space and metadata (SpaceID required); any OriginalContent/OriginalContentB64 on it is ignored — the reader is the content.
func (*MemoriesService) Delete ¶
func (s *MemoriesService) Delete(ctx context.Context, id string) error
Delete Delete a memory
func (*MemoriesService) Get ¶
func (s *MemoriesService) Get(ctx context.Context, id string, params *MemoriesGetParams) (*models.Memory, error)
Get Get a memory by ID
func (*MemoriesService) List ¶
func (s *MemoriesService) List(ctx context.Context, spaceID string, params *MemoriesListParams) (*Page[models.Memory], error)
List List memories in a space
func (*MemoriesService) Pages ¶
func (s *MemoriesService) Pages(ctx context.Context, id string, params *MemoriesPagesParams) (*Page[models.MemoryPageImage], error)
Pages List memory page images
func (*MemoriesService) PagesImage ¶
func (s *MemoriesService) PagesImage(ctx context.Context, id string, pageIndex string, params *MemoriesPagesImageParams) ([]byte, error)
PagesImage Download memory page image content
func (*MemoriesService) PagesImageWithHeaders ¶ added in v0.1.13
func (s *MemoriesService) PagesImageWithHeaders(ctx context.Context, id string, pageIndex string, params *MemoriesPagesImageParams, headers map[string]string) ([]byte, error)
PagesImageWithHeaders Download memory page image content Headers apply only to this call (for example Range, Accept-Encoding, If-Match).
func (*MemoriesService) Retrieve ¶
func (s *MemoriesService) Retrieve(ctx context.Context, message string, opts *RetrieveOptions) (*Stream[models.RetrieveMemoryEvent], error)
Retrieve runs a memory retrieval using the flat convenience parameters, expanding SpaceIDs into SpaceKeys and the flat post-processor keys into a ChatPostProcessor (space_ids_to_space_keys + flat_to_nested transforms). The returned Stream must be closed. Use RetrieveRaw to pass a fully-formed RetrieveMemoryRequest.
RetrieveOptions and the request assembly (buildRetrieveRequest / buildChatPostProcessor) are generated into gen_convenience.go from convenience.json; this thin wrapper is the only hand-written piece because it depends on the RetrieveRaw service method signature.
func (*MemoriesService) RetrieveRaw ¶
func (s *MemoriesService) RetrieveRaw(ctx context.Context, req *models.RetrieveMemoryRequest) (*Stream[models.RetrieveMemoryEvent], error)
RetrieveRaw Advanced semantic memory retrieval with JSON
type NetworkError ¶
NetworkError wraps a transport-level failure (DNS, connect, timeout, mid-read drop). The underlying cause is available via errors.Unwrap so users who catch goodmem.Error still see transport failures. inv-network-error-wrap.
func (*NetworkError) Error ¶
func (e *NetworkError) Error() string
func (*NetworkError) Unwrap ¶
func (e *NetworkError) Unwrap() error
type NotFoundError ¶
type NotFoundError struct{ *APIError }
NotFoundError is HTTP 404.
func (*NotFoundError) Unwrap ¶
func (e *NotFoundError) Unwrap() error
type OCRService ¶
type OCRService struct {
// contains filtered or unexported fields
}
OCRService groups the ocr namespace methods.
func (*OCRService) Document ¶
func (s *OCRService) Document(ctx context.Context, req *models.OCRDocumentRequest) (*models.OCRDocumentResponse, error)
Document Run OCR on a document or image
func (*OCRService) DocumentFromFile ¶
func (s *OCRService) DocumentFromFile(ctx context.Context, filePath string, req *models.OCRDocumentRequest) (*models.OCRDocumentResponse, error)
DocumentFromFile runs OCR over a local file — the Go analog of the Python/Java ocr.document(file_path) overload. It reads the file and sends it as base64 in the normal JSON body; the document format is NOT inferred (the server auto-detects it from the bytes — set req.Format only to override). Any req.Content is replaced by the file's contents.
type Option ¶
type Option func(*Client)
Option customizes a Client at construction time.
func WithHTTPClient ¶
WithHTTPClient supplies a pre-configured *http.Client (BYO mode) instead of the SDK-built default. In BYO mode the caller owns the redirect policy; the SDK-built default refuses to follow redirects so the x-api-key custom header cannot leak across a host boundary (inv-no-redirect-with-custom-auth-header).
func WithStreamMaxLineBytes ¶
WithStreamMaxLineBytes overrides the maximum size of a single NDJSON stream event (memories.retrieve, ping.stream). The default is 8 MiB; a single retrieved item can approach that when Retrieve runs with FetchMemoryContent set, so raise this if a large document ends iteration with a "line cap" error. A value <= 0 keeps the default.
type Page ¶
type Page[T any] struct { // contains filtered or unexported fields }
Page is a single page of a paginated list response plus the means to fetch the following pages on demand. The list methods (spaces.List, memories.List) return the first page; iterate every item across all pages with All:
page, err := client.Spaces().List(ctx, nil)
if err != nil { ... }
for sp, err := range page.All(ctx) {
if err != nil { ... }
fmt.Println(sp.SpaceID)
}
Or walk page by page with Items()/Next().
func (*Page[T]) All ¶
All returns a range-over-func iterator (Go 1.23+) over every item across all pages, fetching subsequent pages lazily. If a page fetch fails, the iterator yields the zero value with the error once and stops.
type PermissionDeniedError ¶
type PermissionDeniedError struct{ *APIError }
PermissionDeniedError is HTTP 403.
func (*PermissionDeniedError) Unwrap ¶
func (e *PermissionDeniedError) Unwrap() error
type PingService ¶
type PingService struct {
// contains filtered or unexported fields
}
PingService groups the ping namespace methods.
func (*PingService) Once ¶
func (s *PingService) Once(ctx context.Context, req *models.PingOnceRequest) (*models.PingResult, error)
Once Run a single ping probe
type RateLimitError ¶
RateLimitError is HTTP 429. RetryAfterSeconds holds the parsed Retry-After header in seconds, or nil when the server did not send it (or sent a value the SDK could not parse — see parseRetryAfter). A missing hint never masks the error itself: the typed 429 is always returned with the status and body.
func (*RateLimitError) Unwrap ¶
func (e *RateLimitError) Unwrap() error
type RerankersGetParams ¶
type RerankersGetParams struct {
// IncludeCredentials Whether to return stored credentials. Also accepts include_credentials. Requires READ_RERANKER_CREDENTIALS in addition to READ_RERANKER.
IncludeCredentials *bool `json:"-"`
}
RerankersGetParams holds the optional query parameters for RerankersService.Get.
type RerankersListParams ¶
type RerankersListParams struct {
// OwnerID Filter the already-authorized result set by owner principal UUID. Omitting this parameter does not bypass per-reranker READ_RERANKER filtering.
OwnerID *string `json:"-"`
// ProviderType Filter rerankers by provider type. Allowed values match the ProviderType schema.
ProviderType *models.ProviderType `json:"-"`
// Label Filter by label key-value pairs. Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
Label map[string]string `json:"-"`
}
RerankersListParams holds the optional query parameters for RerankersService.List.
type RerankersService ¶
type RerankersService struct {
// contains filtered or unexported fields
}
RerankersService groups the rerankers namespace methods.
func (*RerankersService) Create ¶
func (s *RerankersService) Create(ctx context.Context, req *models.RerankerCreationRequest, apiKey string) (*models.RerankerResponse, error)
Create Create a new reranker
func (*RerankersService) Delete ¶
func (s *RerankersService) Delete(ctx context.Context, id string) error
Delete Delete a reranker
func (*RerankersService) Get ¶
func (s *RerankersService) Get(ctx context.Context, id string, params *RerankersGetParams) (*models.RerankerResponse, error)
Get Get a reranker by ID
func (*RerankersService) List ¶
func (s *RerankersService) List(ctx context.Context, params *RerankersListParams) (*models.ListRerankersResponse, error)
List List rerankers
func (*RerankersService) Update ¶
func (s *RerankersService) Update(ctx context.Context, id string, req *models.UpdateRerankerRequest) (*models.RerankerResponse, error)
Update Update a reranker
type RetrieveOptions ¶
type RetrieveOptions struct {
// SpaceIDs is the shorthand for "these spaces, no per-space configuration":
// each id becomes an unfiltered SpaceKey. Mutually exclusive with SpaceKeys.
SpaceIDs []string
// SpaceKeys is the full per-space configuration — each entry carries its own
// optional Filter (metadata filter expression) and EmbedderWeights. Use this
// instead of SpaceIDs when different spaces need different filters; mutually
// exclusive with it. Filter is forwarded verbatim (grammar is a server concern).
SpaceKeys []models.SpaceKey
// Context supplies optional additional context for the search (text or binary),
// e.g. recent conversation turns. Forwarded verbatim.
Context []models.ContextItem
FetchMemory *bool
FetchMemoryContent *bool
RequestedSize *int32
// ChatPostProcessor flat keys. LLM-bound keys apply only when LLMID is set,
// RelevanceThreshold only when RerankerID is set, and the pipeline keys only
// when either is set — Retrieve rejects orphans rather than letting the server
// silently drop them.
LLMID *string
RerankerID *string
LLMTemp *float64
GenTokenBudget *int32
RelevanceThreshold *float64
MaxResults *int32
Prompt *string
SysPrompt *string
ChronologicalResort *bool
}
RetrieveOptions holds the flat convenience parameters for MemoriesService.Retrieve. SpaceIDs is expanded into unfiltered SpaceKeys, SpaceKeys is forwarded verbatim for per-space filters, Context is carried through, and the flat ChatPostProcessor keys are assembled into a PostProcessor. Exactly one of SpaceIDs / SpaceKeys is required; every other field is optional. For full control over the request body use RetrieveRaw.
type ServiceIdentitiesGetParams ¶
type ServiceIdentitiesGetParams struct {
// IncludeDeleted Permit an authorized read of a permanent tombstone
IncludeDeleted *bool `json:"-"`
}
ServiceIdentitiesGetParams holds the optional query parameters for ServiceIdentitiesService.Get.
type ServiceIdentitiesListParams ¶
type ServiceIdentitiesListParams struct {
// OwnerPrincipalID Exact current administrative-owner principal UUID
OwnerPrincipalID *string `json:"-"`
// IncludeDeleted Include readable permanent tombstones
IncludeDeleted *bool `json:"-"`
// MaxResults Page size; defaults to 50 and must be between 1 and 1000
MaxResults *int32 `json:"-"`
// NextToken Opaque continuation token
NextToken *string `json:"-"`
// Label Filter by label key-value pairs. Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
Label map[string]string `json:"-"`
}
ServiceIdentitiesListParams holds the optional query parameters for ServiceIdentitiesService.List.
type ServiceIdentitiesService ¶
type ServiceIdentitiesService struct {
// contains filtered or unexported fields
}
ServiceIdentitiesService groups the service_identities namespace methods.
func (*ServiceIdentitiesService) Create ¶
func (s *ServiceIdentitiesService) Create(ctx context.Context, req *models.CreateServiceIdentityRequest) (*models.ServiceIdentityResponse, error)
Create Create a service identity
func (*ServiceIdentitiesService) Delete ¶
func (s *ServiceIdentitiesService) Delete(ctx context.Context, id string) error
Delete Delete a service identity
func (*ServiceIdentitiesService) Get ¶
func (s *ServiceIdentitiesService) Get(ctx context.Context, id string, params *ServiceIdentitiesGetParams) (*models.ServiceIdentityResponse, error)
Get Get a service identity
func (*ServiceIdentitiesService) List ¶
func (s *ServiceIdentitiesService) List(ctx context.Context, params *ServiceIdentitiesListParams) (*Page[models.ServiceIdentityResponse], error)
List List service identities
func (*ServiceIdentitiesService) TransferOwnership ¶
func (s *ServiceIdentitiesService) TransferOwnership(ctx context.Context, id string, req *models.TransferOwnershipRequest) (*models.TransferServiceIdentityOwnershipResponse, error)
TransferOwnership Transfer service-identity ownership
func (*ServiceIdentitiesService) Update ¶
func (s *ServiceIdentitiesService) Update(ctx context.Context, id string, req *models.UpdateServiceIdentityRequest) (*models.ServiceIdentityResponse, error)
Update Update a service identity
type SpacesListParams ¶
type SpacesListParams struct {
// OwnerID Filter the already-authorized result set by owner principal UUID. Omitting this parameter does not bypass per-space READ_SPACE filtering.
OwnerID *string `json:"-"`
// NameFilter Filter spaces by name using glob pattern matching
NameFilter *string `json:"-"`
// MaxResults Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000])
MaxResults *int32 `json:"-"`
// NextToken Pagination token for retrieving the next set of results
NextToken *string `json:"-"`
// SortBy Field to sort by: 'created_time', 'updated_time', or 'name' (default: 'created_time'). Unsupported values return INVALID_ARGUMENT.
SortBy *string `json:"-"`
// SortOrder Sort order (ASCENDING or DESCENDING, default: DESCENDING)
SortOrder *models.SortOrder `json:"-"`
// Label Filter by label key-value pairs. Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
Label map[string]string `json:"-"`
}
SpacesListParams holds the optional query parameters for SpacesService.List.
type SpacesService ¶
type SpacesService struct {
// contains filtered or unexported fields
}
SpacesService groups the spaces namespace methods.
func (*SpacesService) Create ¶
func (s *SpacesService) Create(ctx context.Context, req *models.SpaceCreationRequest) (*models.Space, error)
Create Create a new Space
func (*SpacesService) Delete ¶
func (s *SpacesService) Delete(ctx context.Context, id string) error
Delete Delete a space
func (*SpacesService) List ¶
func (s *SpacesService) List(ctx context.Context, params *SpacesListParams) (*Page[models.Space], error)
List List spaces
func (*SpacesService) TransferOwnership ¶
func (s *SpacesService) TransferOwnership(ctx context.Context, id string, req *models.TransferOwnershipRequest) (*models.TransferSpaceOwnershipResponse, error)
TransferOwnership Transfer ownership of a space
type Stream ¶
type Stream[T any] struct { // contains filtered or unexported fields }
Stream is a lazily-consumed NDJSON event stream. Iterate it with Events and always Close it (the underlying HTTP response holds a connection):
stream, err := client.Ping().Stream(ctx, req)
if err != nil { ... }
defer stream.Close()
for ev, err := range stream.Events() {
if err != nil { ... }
// handle ev
}
func (*Stream[T]) Close ¶
Close releases the underlying HTTP response. Safe to call multiple times: the body is closed exactly once (Events() also closes on iteration end, and the documented usage adds a defer Close()), so concurrent/duplicate calls are a no-op after the first.
func (*Stream[T]) Events ¶
Events returns a range-over-func iterator over each NDJSON event.
All-null oneOf frames — the server's *_NOT_SET sentinel, serialized as `{}` or `{"retrievedItem":{}}` — are skipped silently so a single empty frame doesn't tear down the stream (inv-stream-tolerates-null-oneof-frames). A non-empty line that fails to parse surfaces as a *GoodmemError; a transport read failure surfaces as a *NetworkError. The response is closed when iteration ends.
type SystemService ¶
type SystemService struct {
// contains filtered or unexported fields
}
SystemService groups the system namespace methods.
func (*SystemService) Info ¶
func (s *SystemService) Info(ctx context.Context) (*models.SystemInfoResponse, error)
Info Retrieve server build metadata
func (*SystemService) Init ¶
func (s *SystemService) Init(ctx context.Context) (*models.SystemInitResponse, error)
Init Initialize the system
type UnprocessableEntityError ¶
type UnprocessableEntityError struct{ *APIError }
UnprocessableEntityError is HTTP 422.
func (*UnprocessableEntityError) Unwrap ¶
func (e *UnprocessableEntityError) Unwrap() error
type UserEnrollmentsService ¶
type UserEnrollmentsService struct {
// contains filtered or unexported fields
}
UserEnrollmentsService groups the user_enrollments namespace methods.
func (*UserEnrollmentsService) Complete ¶
func (s *UserEnrollmentsService) Complete(ctx context.Context, req *models.CompleteUserEnrollmentRequest) (*models.CompleteUserEnrollmentResponse, error)
Complete Complete human-user enrollment
type UsersGetByUsernameParams ¶
type UsersGetByUsernameParams struct {
// IncludeDeleted Permit an authorized read of a permanent tombstone
IncludeDeleted *bool `json:"-"`
}
UsersGetByUsernameParams holds the optional query parameters for UsersService.GetByUsername.
type UsersGetOptions ¶
type UsersGetOptions struct {
ID *string `json:"-"`
Email *string `json:"-"`
IncludeDeleted *bool `json:"includeDeleted,omitempty"`
}
UsersGetOptions selects one lookup key for UsersService.Get; set exactly one field.
type UsersListEnrollmentsParams ¶
type UsersListEnrollmentsParams struct {
// MaxResults Page size; defaults to 50 and must be between 1 and 1000
MaxResults *int32 `json:"-"`
// NextToken Opaque continuation token
NextToken *string `json:"-"`
}
UsersListEnrollmentsParams holds the optional query parameters for UsersService.ListEnrollments.
type UsersListParams ¶
type UsersListParams struct {
// IncludeDeleted Include readable permanent tombstones
IncludeDeleted *bool `json:"-"`
// IncludeEnrollmentSummary Request non-secret enrollment posture on active rows where the caller also has MANAGE_USER_ENROLLMENT
IncludeEnrollmentSummary *bool `json:"-"`
// MaxResults Page size; defaults to 50 and must be between 1 and 1000
MaxResults *int32 `json:"-"`
// NextToken Opaque continuation token
NextToken *string `json:"-"`
// Label Filter by label key-value pairs. Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).
Label map[string]string `json:"-"`
}
UsersListParams holds the optional query parameters for UsersService.List.
type UsersService ¶
type UsersService struct {
// contains filtered or unexported fields
}
UsersService groups the users namespace methods.
func (*UsersService) Create ¶
func (s *UsersService) Create(ctx context.Context, req *models.CreateUserRequest) (*models.UserResponse, error)
Create Create a human user
func (*UsersService) CreateEnrollment ¶
func (s *UsersService) CreateEnrollment(ctx context.Context, userID string, req *models.CreateUserEnrollmentRequest) (*models.CreateUserEnrollmentResponse, error)
CreateEnrollment Create a human-user enrollment
func (*UsersService) Delete ¶
func (s *UsersService) Delete(ctx context.Context, id string) error
Delete Delete a human user
func (*UsersService) Get ¶
func (s *UsersService) Get(ctx context.Context, opts *UsersGetOptions) (*models.UserResponse, error)
Get Get a user by ID
func (*UsersService) GetByUsername ¶
func (s *UsersService) GetByUsername(ctx context.Context, username string, params *UsersGetByUsernameParams) (*models.UserResponse, error)
GetByUsername Get user by username
func (*UsersService) GetEnrollment ¶
func (s *UsersService) GetEnrollment(ctx context.Context, userID string, enrollmentID string) (*models.UserEnrollmentResponse, error)
GetEnrollment Get a human-user enrollment
func (*UsersService) List ¶
func (s *UsersService) List(ctx context.Context, params *UsersListParams) (*Page[models.UserResponse], error)
List List human users
func (*UsersService) ListEnrollments ¶
func (s *UsersService) ListEnrollments(ctx context.Context, userID string, params *UsersListEnrollmentsParams) (*Page[models.UserEnrollmentResponse], error)
ListEnrollments List a human user's enrollments
func (*UsersService) Me ¶
func (s *UsersService) Me(ctx context.Context) (*models.UserResponse, error)
Me Get current user profile
func (*UsersService) RevokeEnrollment ¶
func (s *UsersService) RevokeEnrollment(ctx context.Context, userID string, enrollmentID string) error
RevokeEnrollment Revoke a human-user enrollment
func (*UsersService) Update ¶
func (s *UsersService) Update(ctx context.Context, id string, req *models.UpdateUserRequest) (*models.UserResponse, error)
Update Update a human user
Source Files
¶
- client.go
- doc.go
- errors.go
- gen_api_access_policy.go
- gen_api_admin.go
- gen_api_apikeys.go
- gen_api_decision_models.go
- gen_api_embedders.go
- gen_api_instance.go
- gen_api_llms.go
- gen_api_memories.go
- gen_api_ocr.go
- gen_api_ping.go
- gen_api_rerankers.go
- gen_api_service_identities.go
- gen_api_spaces.go
- gen_api_system.go
- gen_api_user_enrollments.go
- gen_api_users.go
- gen_convenience.go
- pagination.go
- registries.go
- retrieve.go
- streaming.go
- transport.go
- uploads.go