Documentation
¶
Overview ¶
Package oapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Copyright 2025 The Antfly Contributors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- func NewAddPermissionToUserRequest(server string, userName UserNamePathParameter, ...) (*http.Request, error)
- func NewAddPermissionToUserRequestWithBody(server string, userName UserNamePathParameter, contentType string, ...) (*http.Request, error)
- func NewAnswerAgentRequest(server string, body AnswerAgentJSONRequestBody) (*http.Request, error)
- func NewAnswerAgentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewBackupRequest(server string, body BackupJSONRequestBody) (*http.Request, error)
- func NewBackupRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewBackupTableRequest(server string, tableName string, body BackupTableJSONRequestBody) (*http.Request, error)
- func NewBackupTableRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
- func NewBatchWriteRequest(server string, tableName string, body BatchWriteJSONRequestBody) (*http.Request, error)
- func NewBatchWriteRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
- func NewCommitTransactionRequest(server string, body CommitTransactionJSONRequestBody) (*http.Request, error)
- func NewCommitTransactionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewCreateApiKeyRequest(server string, userName UserNamePathParameter, ...) (*http.Request, error)
- func NewCreateApiKeyRequestWithBody(server string, userName UserNamePathParameter, contentType string, ...) (*http.Request, error)
- func NewCreateIndexRequest(server string, tableName string, indexName string, ...) (*http.Request, error)
- func NewCreateIndexRequestWithBody(server string, tableName string, indexName string, contentType string, ...) (*http.Request, error)
- func NewCreateTableRequest(server string, tableName string, body CreateTableJSONRequestBody) (*http.Request, error)
- func NewCreateTableRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
- func NewCreateUserRequest(server string, userName UserNamePathParameter, body CreateUserJSONRequestBody) (*http.Request, error)
- func NewCreateUserRequestWithBody(server string, userName UserNamePathParameter, contentType string, ...) (*http.Request, error)
- func NewDeleteApiKeyRequest(server string, userName UserNamePathParameter, keyId KeyIdPathParameter) (*http.Request, error)
- func NewDeleteSecretRequest(server string, key string) (*http.Request, error)
- func NewDeleteUserRequest(server string, userName UserNamePathParameter) (*http.Request, error)
- func NewDropIndexRequest(server string, tableName string, indexName string) (*http.Request, error)
- func NewDropTableRequest(server string, tableName string) (*http.Request, error)
- func NewEvaluateRequest(server string, body EvaluateJSONRequestBody) (*http.Request, error)
- func NewEvaluateRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGetCurrentUserRequest(server string) (*http.Request, error)
- func NewGetIndexRequest(server string, tableName string, indexName string) (*http.Request, error)
- func NewGetStatusRequest(server string) (*http.Request, error)
- func NewGetTableRequest(server string, tableName string) (*http.Request, error)
- func NewGetUserByNameRequest(server string, userName UserNamePathParameter) (*http.Request, error)
- func NewGetUserPermissionsRequest(server string, userName UserNamePathParameter) (*http.Request, error)
- func NewGlobalQueryRequest(server string, body GlobalQueryJSONRequestBody) (*http.Request, error)
- func NewGlobalQueryRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewLinearMergeRequest(server string, tableName string, body LinearMergeJSONRequestBody) (*http.Request, error)
- func NewLinearMergeRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
- func NewListApiKeysRequest(server string, userName UserNamePathParameter) (*http.Request, error)
- func NewListBackupsRequest(server string, params *ListBackupsParams) (*http.Request, error)
- func NewListIndexesRequest(server string, tableName string) (*http.Request, error)
- func NewListSecretsRequest(server string) (*http.Request, error)
- func NewListTablesRequest(server string, params *ListTablesParams) (*http.Request, error)
- func NewListUsersRequest(server string) (*http.Request, error)
- func NewLookupKeyRequest(server string, tableName string, key string, params *LookupKeyParams) (*http.Request, error)
- func NewMultiBatchWriteRequest(server string, body MultiBatchWriteJSONRequestBody) (*http.Request, error)
- func NewMultiBatchWriteRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPutSecretRequest(server string, key string, body PutSecretJSONRequestBody) (*http.Request, error)
- func NewPutSecretRequestWithBody(server string, key string, contentType string, body io.Reader) (*http.Request, error)
- func NewQueryBuilderAgentRequest(server string, body QueryBuilderAgentJSONRequestBody) (*http.Request, error)
- func NewQueryBuilderAgentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewQueryTableRequest(server string, tableName string, body QueryTableJSONRequestBody) (*http.Request, error)
- func NewQueryTableRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
- func NewRemovePermissionFromUserRequest(server string, userName UserNamePathParameter, ...) (*http.Request, error)
- func NewRestoreRequest(server string, body RestoreJSONRequestBody) (*http.Request, error)
- func NewRestoreRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewRestoreTableRequest(server string, tableName string, body RestoreTableJSONRequestBody) (*http.Request, error)
- func NewRestoreTableRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
- func NewRetrievalAgentRequest(server string, body RetrievalAgentJSONRequestBody) (*http.Request, error)
- func NewRetrievalAgentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewScanKeysRequest(server string, tableName string, body ScanKeysJSONRequestBody) (*http.Request, error)
- func NewScanKeysRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
- func NewUpdateSchemaRequest(server string, tableName string, body UpdateSchemaJSONRequestBody) (*http.Request, error)
- func NewUpdateSchemaRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
- func NewUpdateUserPasswordRequest(server string, userName UserNamePathParameter, ...) (*http.Request, error)
- func NewUpdateUserPasswordRequestWithBody(server string, userName UserNamePathParameter, contentType string, ...) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type AddPermissionToUserJSONRequestBody
- type AddPermissionToUserResponse
- type AggregationBucket
- type AggregationDateRange
- type AggregationRange
- type AggregationRequest
- type AggregationResult
- type AggregationType
- type Analyses
- type AnalysesResult
- type AnswerAgentJSONRequestBody
- type AnswerAgentRequest
- type AnswerAgentResponse
- type AnswerAgentResult
- type AnswerAgentSteps
- type AntflyChunkerConfig
- type AntflyEmbedderConfig
- type AntflyRerankerConfig
- type AntflyType
- type AnthropicGeneratorConfig
- type ApiKey
- type ApiKeyWithSecret
- type AudioChunkOptions
- type BackupInfo
- type BackupJSONRequestBody
- type BackupListResponse
- type BackupRequest
- type BackupResponse
- type BackupTableJSONRequestBody
- type BackupTableResponse
- type BadRequest
- type BatchRequest
- type BatchResponse
- type BatchWriteJSONRequestBody
- type BatchWriteResponse
- type BedrockEmbedderConfig
- type BedrockGeneratorConfig
- type BingSearchConfig
- type BingSearchConfigFreshness
- type BoolFieldQuery
- type BooleanQuery
- type Boost
- type BraveSearchConfig
- type BraveSearchConfigFreshness
- type ByteRange
- type CalendarInterval
- type ChainCondition
- type ChainLink
- type ChatMessage
- type ChatMessageRole
- type ChatToolCall
- type ChatToolName
- type ChatToolResult
- type ChatToolsConfig
- type ChunkOptions
- type ChunkerConfig
- func (t ChunkerConfig) AsAntflyChunkerConfig() (AntflyChunkerConfig, error)
- func (t ChunkerConfig) AsTermiteChunkerConfig() (TermiteChunkerConfig, error)
- func (t *ChunkerConfig) FromAntflyChunkerConfig(v AntflyChunkerConfig) error
- func (t *ChunkerConfig) FromTermiteChunkerConfig(v TermiteChunkerConfig) error
- func (t ChunkerConfig) MarshalJSON() ([]byte, error)
- func (t *ChunkerConfig) MergeAntflyChunkerConfig(v AntflyChunkerConfig) error
- func (t *ChunkerConfig) MergeTermiteChunkerConfig(v TermiteChunkerConfig) error
- func (t *ChunkerConfig) UnmarshalJSON(b []byte) error
- type ChunkerProvider
- type ClarificationRequest
- type ClassificationStepConfig
- type ClassificationTransformationResult
- type Client
- func (c *Client) AddPermissionToUser(ctx context.Context, userName UserNamePathParameter, ...) (*http.Response, error)
- func (c *Client) AddPermissionToUserWithBody(ctx context.Context, userName UserNamePathParameter, contentType string, ...) (*http.Response, error)
- func (c *Client) AnswerAgent(ctx context.Context, body AnswerAgentJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) AnswerAgentWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) Backup(ctx context.Context, body BackupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) BackupTable(ctx context.Context, tableName string, body BackupTableJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) BackupTableWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) BackupWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) BatchWrite(ctx context.Context, tableName string, body BatchWriteJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) BatchWriteWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) CommitTransaction(ctx context.Context, body CommitTransactionJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CommitTransactionWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) CreateApiKey(ctx context.Context, userName UserNamePathParameter, ...) (*http.Response, error)
- func (c *Client) CreateApiKeyWithBody(ctx context.Context, userName UserNamePathParameter, contentType string, ...) (*http.Response, error)
- func (c *Client) CreateIndex(ctx context.Context, tableName string, indexName string, ...) (*http.Response, error)
- func (c *Client) CreateIndexWithBody(ctx context.Context, tableName string, indexName string, contentType string, ...) (*http.Response, error)
- func (c *Client) CreateTable(ctx context.Context, tableName string, body CreateTableJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateTableWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) CreateUser(ctx context.Context, userName UserNamePathParameter, ...) (*http.Response, error)
- func (c *Client) CreateUserWithBody(ctx context.Context, userName UserNamePathParameter, contentType string, ...) (*http.Response, error)
- func (c *Client) DeleteApiKey(ctx context.Context, userName UserNamePathParameter, keyId KeyIdPathParameter, ...) (*http.Response, error)
- func (c *Client) DeleteSecret(ctx context.Context, key string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) DeleteUser(ctx context.Context, userName UserNamePathParameter, ...) (*http.Response, error)
- func (c *Client) DropIndex(ctx context.Context, tableName string, indexName string, ...) (*http.Response, error)
- func (c *Client) DropTable(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) Evaluate(ctx context.Context, body EvaluateJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) EvaluateWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GetCurrentUser(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetIndex(ctx context.Context, tableName string, indexName string, ...) (*http.Response, error)
- func (c *Client) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetTable(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetUserByName(ctx context.Context, userName UserNamePathParameter, ...) (*http.Response, error)
- func (c *Client) GetUserPermissions(ctx context.Context, userName UserNamePathParameter, ...) (*http.Response, error)
- func (c *Client) GlobalQuery(ctx context.Context, body GlobalQueryJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) GlobalQueryWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) LinearMerge(ctx context.Context, tableName string, body LinearMergeJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) LinearMergeWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) ListApiKeys(ctx context.Context, userName UserNamePathParameter, ...) (*http.Response, error)
- func (c *Client) ListBackups(ctx context.Context, params *ListBackupsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListIndexes(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListSecrets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListTables(ctx context.Context, params *ListTablesParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListUsers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) LookupKey(ctx context.Context, tableName string, key string, params *LookupKeyParams, ...) (*http.Response, error)
- func (c *Client) MultiBatchWrite(ctx context.Context, body MultiBatchWriteJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) MultiBatchWriteWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PutSecret(ctx context.Context, key string, body PutSecretJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PutSecretWithBody(ctx context.Context, key string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) QueryBuilderAgent(ctx context.Context, body QueryBuilderAgentJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) QueryBuilderAgentWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) QueryTable(ctx context.Context, tableName string, body QueryTableJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) QueryTableWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) RemovePermissionFromUser(ctx context.Context, userName UserNamePathParameter, ...) (*http.Response, error)
- func (c *Client) Restore(ctx context.Context, body RestoreJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) RestoreTable(ctx context.Context, tableName string, body RestoreTableJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) RestoreTableWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) RestoreWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) RetrievalAgent(ctx context.Context, body RetrievalAgentJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) RetrievalAgentWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) ScanKeys(ctx context.Context, tableName string, body ScanKeysJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) ScanKeysWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) UpdateSchema(ctx context.Context, tableName string, body UpdateSchemaJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) UpdateSchemaWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) UpdateUserPassword(ctx context.Context, userName UserNamePathParameter, ...) (*http.Response, error)
- func (c *Client) UpdateUserPasswordWithBody(ctx context.Context, userName UserNamePathParameter, contentType string, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) AddPermissionToUserWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, ...) (*AddPermissionToUserResponse, error)
- func (c *ClientWithResponses) AddPermissionToUserWithResponse(ctx context.Context, userName UserNamePathParameter, ...) (*AddPermissionToUserResponse, error)
- func (c *ClientWithResponses) AnswerAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*AnswerAgentResponse, error)
- func (c *ClientWithResponses) AnswerAgentWithResponse(ctx context.Context, body AnswerAgentJSONRequestBody, ...) (*AnswerAgentResponse, error)
- func (c *ClientWithResponses) BackupTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*BackupTableResponse, error)
- func (c *ClientWithResponses) BackupTableWithResponse(ctx context.Context, tableName string, body BackupTableJSONRequestBody, ...) (*BackupTableResponse, error)
- func (c *ClientWithResponses) BackupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*BackupResponse, error)
- func (c *ClientWithResponses) BackupWithResponse(ctx context.Context, body BackupJSONRequestBody, reqEditors ...RequestEditorFn) (*BackupResponse, error)
- func (c *ClientWithResponses) BatchWriteWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*BatchWriteResponse, error)
- func (c *ClientWithResponses) BatchWriteWithResponse(ctx context.Context, tableName string, body BatchWriteJSONRequestBody, ...) (*BatchWriteResponse, error)
- func (c *ClientWithResponses) CommitTransactionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*CommitTransactionResponse, error)
- func (c *ClientWithResponses) CommitTransactionWithResponse(ctx context.Context, body CommitTransactionJSONRequestBody, ...) (*CommitTransactionResponse, error)
- func (c *ClientWithResponses) CreateApiKeyWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, ...) (*CreateApiKeyResponse, error)
- func (c *ClientWithResponses) CreateApiKeyWithResponse(ctx context.Context, userName UserNamePathParameter, ...) (*CreateApiKeyResponse, error)
- func (c *ClientWithResponses) CreateIndexWithBodyWithResponse(ctx context.Context, tableName string, indexName string, contentType string, ...) (*CreateIndexResponse, error)
- func (c *ClientWithResponses) CreateIndexWithResponse(ctx context.Context, tableName string, indexName string, ...) (*CreateIndexResponse, error)
- func (c *ClientWithResponses) CreateTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*CreateTableResponse, error)
- func (c *ClientWithResponses) CreateTableWithResponse(ctx context.Context, tableName string, body CreateTableJSONRequestBody, ...) (*CreateTableResponse, error)
- func (c *ClientWithResponses) CreateUserWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, ...) (*CreateUserResponse, error)
- func (c *ClientWithResponses) CreateUserWithResponse(ctx context.Context, userName UserNamePathParameter, ...) (*CreateUserResponse, error)
- func (c *ClientWithResponses) DeleteApiKeyWithResponse(ctx context.Context, userName UserNamePathParameter, keyId KeyIdPathParameter, ...) (*DeleteApiKeyResponse, error)
- func (c *ClientWithResponses) DeleteSecretWithResponse(ctx context.Context, key string, reqEditors ...RequestEditorFn) (*DeleteSecretResponse, error)
- func (c *ClientWithResponses) DeleteUserWithResponse(ctx context.Context, userName UserNamePathParameter, ...) (*DeleteUserResponse, error)
- func (c *ClientWithResponses) DropIndexWithResponse(ctx context.Context, tableName string, indexName string, ...) (*DropIndexResponse, error)
- func (c *ClientWithResponses) DropTableWithResponse(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*DropTableResponse, error)
- func (c *ClientWithResponses) EvaluateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*EvaluateResponse, error)
- func (c *ClientWithResponses) EvaluateWithResponse(ctx context.Context, body EvaluateJSONRequestBody, ...) (*EvaluateResponse, error)
- func (c *ClientWithResponses) GetCurrentUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCurrentUserResponse, error)
- func (c *ClientWithResponses) GetIndexWithResponse(ctx context.Context, tableName string, indexName string, ...) (*GetIndexResponse, error)
- func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
- func (c *ClientWithResponses) GetTableWithResponse(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*GetTableResponse, error)
- func (c *ClientWithResponses) GetUserByNameWithResponse(ctx context.Context, userName UserNamePathParameter, ...) (*GetUserByNameResponse, error)
- func (c *ClientWithResponses) GetUserPermissionsWithResponse(ctx context.Context, userName UserNamePathParameter, ...) (*GetUserPermissionsResponse, error)
- func (c *ClientWithResponses) GlobalQueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*GlobalQueryResponse, error)
- func (c *ClientWithResponses) GlobalQueryWithResponse(ctx context.Context, body GlobalQueryJSONRequestBody, ...) (*GlobalQueryResponse, error)
- func (c *ClientWithResponses) LinearMergeWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*LinearMergeResponse, error)
- func (c *ClientWithResponses) LinearMergeWithResponse(ctx context.Context, tableName string, body LinearMergeJSONRequestBody, ...) (*LinearMergeResponse, error)
- func (c *ClientWithResponses) ListApiKeysWithResponse(ctx context.Context, userName UserNamePathParameter, ...) (*ListApiKeysResponse, error)
- func (c *ClientWithResponses) ListBackupsWithResponse(ctx context.Context, params *ListBackupsParams, reqEditors ...RequestEditorFn) (*ListBackupsResponse, error)
- func (c *ClientWithResponses) ListIndexesWithResponse(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*ListIndexesResponse, error)
- func (c *ClientWithResponses) ListSecretsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListSecretsResponse, error)
- func (c *ClientWithResponses) ListTablesWithResponse(ctx context.Context, params *ListTablesParams, reqEditors ...RequestEditorFn) (*ListTablesResponse, error)
- func (c *ClientWithResponses) ListUsersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListUsersResponse, error)
- func (c *ClientWithResponses) LookupKeyWithResponse(ctx context.Context, tableName string, key string, params *LookupKeyParams, ...) (*LookupKeyResponse, error)
- func (c *ClientWithResponses) MultiBatchWriteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*MultiBatchWriteResponse, error)
- func (c *ClientWithResponses) MultiBatchWriteWithResponse(ctx context.Context, body MultiBatchWriteJSONRequestBody, ...) (*MultiBatchWriteResponse, error)
- func (c *ClientWithResponses) PutSecretWithBodyWithResponse(ctx context.Context, key string, contentType string, body io.Reader, ...) (*PutSecretResponse, error)
- func (c *ClientWithResponses) PutSecretWithResponse(ctx context.Context, key string, body PutSecretJSONRequestBody, ...) (*PutSecretResponse, error)
- func (c *ClientWithResponses) QueryBuilderAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*QueryBuilderAgentResponse, error)
- func (c *ClientWithResponses) QueryBuilderAgentWithResponse(ctx context.Context, body QueryBuilderAgentJSONRequestBody, ...) (*QueryBuilderAgentResponse, error)
- func (c *ClientWithResponses) QueryTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*QueryTableResponse, error)
- func (c *ClientWithResponses) QueryTableWithResponse(ctx context.Context, tableName string, body QueryTableJSONRequestBody, ...) (*QueryTableResponse, error)
- func (c *ClientWithResponses) RemovePermissionFromUserWithResponse(ctx context.Context, userName UserNamePathParameter, ...) (*RemovePermissionFromUserResponse, error)
- func (c *ClientWithResponses) RestoreTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*RestoreTableResponse, error)
- func (c *ClientWithResponses) RestoreTableWithResponse(ctx context.Context, tableName string, body RestoreTableJSONRequestBody, ...) (*RestoreTableResponse, error)
- func (c *ClientWithResponses) RestoreWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*RestoreResponse, error)
- func (c *ClientWithResponses) RestoreWithResponse(ctx context.Context, body RestoreJSONRequestBody, ...) (*RestoreResponse, error)
- func (c *ClientWithResponses) RetrievalAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*RetrievalAgentResponse, error)
- func (c *ClientWithResponses) RetrievalAgentWithResponse(ctx context.Context, body RetrievalAgentJSONRequestBody, ...) (*RetrievalAgentResponse, error)
- func (c *ClientWithResponses) ScanKeysWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*ScanKeysResponse, error)
- func (c *ClientWithResponses) ScanKeysWithResponse(ctx context.Context, tableName string, body ScanKeysJSONRequestBody, ...) (*ScanKeysResponse, error)
- func (c *ClientWithResponses) UpdateSchemaWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, ...) (*UpdateSchemaResponse, error)
- func (c *ClientWithResponses) UpdateSchemaWithResponse(ctx context.Context, tableName string, body UpdateSchemaJSONRequestBody, ...) (*UpdateSchemaResponse, error)
- func (c *ClientWithResponses) UpdateUserPasswordWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, ...) (*UpdateUserPasswordResponse, error)
- func (c *ClientWithResponses) UpdateUserPasswordWithResponse(ctx context.Context, userName UserNamePathParameter, ...) (*UpdateUserPasswordResponse, error)
- type ClientWithResponsesInterface
- type ClusterBackupRequest
- type ClusterBackupResponse
- type ClusterBackupResponseStatus
- type ClusterHealth
- type ClusterRestoreRequest
- type ClusterRestoreRequestRestoreMode
- type ClusterRestoreResponse
- type ClusterRestoreResponseStatus
- type ClusterStatus
- type CohereEmbedderConfig
- type CohereEmbedderConfigInputType
- type CohereEmbedderConfigTruncate
- type CohereGeneratorConfig
- type CohereRerankerConfig
- type CommitTransactionJSONRequestBody
- type CommitTransactionResponse
- type ConfidenceStepConfig
- type ConjunctionQuery
- type CreateApiKeyJSONRequestBody
- type CreateApiKeyRequest
- type CreateApiKeyResponse
- type CreateIndexJSONRequestBody
- type CreateIndexResponse
- type CreateTableJSONRequestBody
- type CreateTableRequest
- type CreateTableResponse
- type CreateUserJSONRequestBody
- type CreateUserRequest
- type CreateUserResponse
- type Credentials
- type DateRangeStringQuery
- type DeleteApiKeyResponse
- type DeleteSecretResponse
- type DeleteUserResponse
- type DisjunctionQuery
- type DistanceMetric
- type DistanceRange
- type DistanceUnit
- type DocIdQuery
- type DocumentSchema
- type DropIndexResponse
- type DropTableResponse
- type DuckDuckGoSearchConfig
- type DynamicTemplate
- type DynamicTemplateMatchMappingType
- type Edge
- type EdgeDirection
- type EdgeTypeConfig
- type EdgeTypeConfigTopology
- type EdgesResponse
- type EmbedderConfig
- func (t EmbedderConfig) AsAntflyEmbedderConfig() (AntflyEmbedderConfig, error)
- func (t EmbedderConfig) AsBedrockEmbedderConfig() (BedrockEmbedderConfig, error)
- func (t EmbedderConfig) AsCohereEmbedderConfig() (CohereEmbedderConfig, error)
- func (t EmbedderConfig) AsGoogleEmbedderConfig() (GoogleEmbedderConfig, error)
- func (t EmbedderConfig) AsOllamaEmbedderConfig() (OllamaEmbedderConfig, error)
- func (t EmbedderConfig) AsOpenAIEmbedderConfig() (OpenAIEmbedderConfig, error)
- func (t EmbedderConfig) AsOpenRouterEmbedderConfig() (OpenRouterEmbedderConfig, error)
- func (t EmbedderConfig) AsTermiteEmbedderConfig() (TermiteEmbedderConfig, error)
- func (t EmbedderConfig) AsVertexEmbedderConfig() (VertexEmbedderConfig, error)
- func (t *EmbedderConfig) FromAntflyEmbedderConfig(v AntflyEmbedderConfig) error
- func (t *EmbedderConfig) FromBedrockEmbedderConfig(v BedrockEmbedderConfig) error
- func (t *EmbedderConfig) FromCohereEmbedderConfig(v CohereEmbedderConfig) error
- func (t *EmbedderConfig) FromGoogleEmbedderConfig(v GoogleEmbedderConfig) error
- func (t *EmbedderConfig) FromOllamaEmbedderConfig(v OllamaEmbedderConfig) error
- func (t *EmbedderConfig) FromOpenAIEmbedderConfig(v OpenAIEmbedderConfig) error
- func (t *EmbedderConfig) FromOpenRouterEmbedderConfig(v OpenRouterEmbedderConfig) error
- func (t *EmbedderConfig) FromTermiteEmbedderConfig(v TermiteEmbedderConfig) error
- func (t *EmbedderConfig) FromVertexEmbedderConfig(v VertexEmbedderConfig) error
- func (t EmbedderConfig) MarshalJSON() ([]byte, error)
- func (t *EmbedderConfig) MergeAntflyEmbedderConfig(v AntflyEmbedderConfig) error
- func (t *EmbedderConfig) MergeBedrockEmbedderConfig(v BedrockEmbedderConfig) error
- func (t *EmbedderConfig) MergeCohereEmbedderConfig(v CohereEmbedderConfig) error
- func (t *EmbedderConfig) MergeGoogleEmbedderConfig(v GoogleEmbedderConfig) error
- func (t *EmbedderConfig) MergeOllamaEmbedderConfig(v OllamaEmbedderConfig) error
- func (t *EmbedderConfig) MergeOpenAIEmbedderConfig(v OpenAIEmbedderConfig) error
- func (t *EmbedderConfig) MergeOpenRouterEmbedderConfig(v OpenRouterEmbedderConfig) error
- func (t *EmbedderConfig) MergeTermiteEmbedderConfig(v TermiteEmbedderConfig) error
- func (t *EmbedderConfig) MergeVertexEmbedderConfig(v VertexEmbedderConfig) error
- func (t *EmbedderConfig) UnmarshalJSON(b []byte) error
- type EmbedderProvider
- type Embedding
- func (t Embedding) AsEmbedding0() (Embedding0, error)
- func (t Embedding) AsEmbedding1() (Embedding1, error)
- func (t *Embedding) FromEmbedding0(v Embedding0) error
- func (t *Embedding) FromEmbedding1(v Embedding1) error
- func (t Embedding) MarshalJSON() ([]byte, error)
- func (t *Embedding) MergeEmbedding0(v Embedding0) error
- func (t *Embedding) MergeEmbedding1(v Embedding1) error
- func (t *Embedding) UnmarshalJSON(b []byte) error
- type Embedding0
- type Embedding1
- type EmbeddingsIndexConfig
- type EmbeddingsIndexStats
- type Error
- type EvalConfig
- type EvalOptions
- type EvalRequest
- type EvalResult
- type EvalScores
- type EvalSummary
- type EvaluateJSONRequestBody
- type EvaluateResponse
- type EvaluatorName
- type EvaluatorScore
- type FailedOperation
- type FailedOperationOperation
- type FetchConfig
- type FieldStatistics
- type FilterSpec
- type FilterSpecOperator
- type FollowupStepConfig
- type ForeignColumn
- type ForeignSource
- type ForeignSourceType
- type FullTextIndexConfig
- type FullTextIndexStats
- type Fuzziness
- func (t Fuzziness) AsFuzziness0() (Fuzziness0, error)
- func (t Fuzziness) AsFuzziness1() (Fuzziness1, error)
- func (t *Fuzziness) FromFuzziness0(v Fuzziness0) error
- func (t *Fuzziness) FromFuzziness1(v Fuzziness1) error
- func (t Fuzziness) MarshalJSON() ([]byte, error)
- func (t *Fuzziness) MergeFuzziness0(v Fuzziness0) error
- func (t *Fuzziness) MergeFuzziness1(v Fuzziness1) error
- func (t *Fuzziness) UnmarshalJSON(b []byte) error
- type Fuzziness0
- type Fuzziness1
- type FuzzyQuery
- type GenerationStepConfig
- type GeneratorConfig
- func (t GeneratorConfig) AsAnthropicGeneratorConfig() (AnthropicGeneratorConfig, error)
- func (t GeneratorConfig) AsBedrockGeneratorConfig() (BedrockGeneratorConfig, error)
- func (t GeneratorConfig) AsCohereGeneratorConfig() (CohereGeneratorConfig, error)
- func (t GeneratorConfig) AsGoogleGeneratorConfig() (GoogleGeneratorConfig, error)
- func (t GeneratorConfig) AsOllamaGeneratorConfig() (OllamaGeneratorConfig, error)
- func (t GeneratorConfig) AsOpenAIGeneratorConfig() (OpenAIGeneratorConfig, error)
- func (t GeneratorConfig) AsOpenRouterGeneratorConfig() (OpenRouterGeneratorConfig, error)
- func (t GeneratorConfig) AsTermiteGeneratorConfig() (TermiteGeneratorConfig, error)
- func (t GeneratorConfig) AsVertexGeneratorConfig() (VertexGeneratorConfig, error)
- func (t *GeneratorConfig) FromAnthropicGeneratorConfig(v AnthropicGeneratorConfig) error
- func (t *GeneratorConfig) FromBedrockGeneratorConfig(v BedrockGeneratorConfig) error
- func (t *GeneratorConfig) FromCohereGeneratorConfig(v CohereGeneratorConfig) error
- func (t *GeneratorConfig) FromGoogleGeneratorConfig(v GoogleGeneratorConfig) error
- func (t *GeneratorConfig) FromOllamaGeneratorConfig(v OllamaGeneratorConfig) error
- func (t *GeneratorConfig) FromOpenAIGeneratorConfig(v OpenAIGeneratorConfig) error
- func (t *GeneratorConfig) FromOpenRouterGeneratorConfig(v OpenRouterGeneratorConfig) error
- func (t *GeneratorConfig) FromTermiteGeneratorConfig(v TermiteGeneratorConfig) error
- func (t *GeneratorConfig) FromVertexGeneratorConfig(v VertexGeneratorConfig) error
- func (t GeneratorConfig) MarshalJSON() ([]byte, error)
- func (t *GeneratorConfig) MergeAnthropicGeneratorConfig(v AnthropicGeneratorConfig) error
- func (t *GeneratorConfig) MergeBedrockGeneratorConfig(v BedrockGeneratorConfig) error
- func (t *GeneratorConfig) MergeCohereGeneratorConfig(v CohereGeneratorConfig) error
- func (t *GeneratorConfig) MergeGoogleGeneratorConfig(v GoogleGeneratorConfig) error
- func (t *GeneratorConfig) MergeOllamaGeneratorConfig(v OllamaGeneratorConfig) error
- func (t *GeneratorConfig) MergeOpenAIGeneratorConfig(v OpenAIGeneratorConfig) error
- func (t *GeneratorConfig) MergeOpenRouterGeneratorConfig(v OpenRouterGeneratorConfig) error
- func (t *GeneratorConfig) MergeTermiteGeneratorConfig(v TermiteGeneratorConfig) error
- func (t *GeneratorConfig) MergeVertexGeneratorConfig(v VertexGeneratorConfig) error
- func (t *GeneratorConfig) UnmarshalJSON(b []byte) error
- type GeneratorProvider
- type GeoBoundingBoxQuery
- type GeoBoundingPolygonQuery
- type GeoDistanceQuery
- type GeoPoint
- type GeoShape
- type GeoShapeGeometry
- type GeoShapeGeometryRelation
- type GeoShapeQuery
- type GetCurrentUserResponse
- type GetIndexResponse
- type GetStatusResponse
- type GetTableResponse
- type GetUserByNameResponse
- type GetUserPermissionsResponse
- type GlobalQueryJSONRequestBody
- type GlobalQueryResponse
- type GoogleEmbedderConfig
- type GoogleGeneratorConfig
- type GoogleSearchConfig
- type GoogleSearchConfigSearchType
- type GraphIndexConfig
- type GraphIndexStats
- type GraphNodeSelector
- type GraphQuery
- type GraphQueryParams
- type GraphQueryResult
- type GraphQueryType
- type GraphResultNode
- type GroundTruth
- type HttpRequestDoer
- type IPRangeQuery
- type IncompleteDetails
- type IncompleteDetailsReason
- type IndexConfig
- func (t IndexConfig) AsEmbeddingsIndexConfig() (EmbeddingsIndexConfig, error)
- func (t IndexConfig) AsFullTextIndexConfig() (FullTextIndexConfig, error)
- func (t IndexConfig) AsGraphIndexConfig() (GraphIndexConfig, error)
- func (t *IndexConfig) FromEmbeddingsIndexConfig(v EmbeddingsIndexConfig) error
- func (t *IndexConfig) FromFullTextIndexConfig(v FullTextIndexConfig) error
- func (t *IndexConfig) FromGraphIndexConfig(v GraphIndexConfig) error
- func (t IndexConfig) MarshalJSON() ([]byte, error)
- func (t *IndexConfig) MergeEmbeddingsIndexConfig(v EmbeddingsIndexConfig) error
- func (t *IndexConfig) MergeFullTextIndexConfig(v FullTextIndexConfig) error
- func (t *IndexConfig) MergeGraphIndexConfig(v GraphIndexConfig) error
- func (t *IndexConfig) UnmarshalJSON(b []byte) error
- type IndexStats
- func (t IndexStats) AsEmbeddingsIndexStats() (EmbeddingsIndexStats, error)
- func (t IndexStats) AsFullTextIndexStats() (FullTextIndexStats, error)
- func (t IndexStats) AsGraphIndexStats() (GraphIndexStats, error)
- func (t *IndexStats) FromEmbeddingsIndexStats(v EmbeddingsIndexStats) error
- func (t *IndexStats) FromFullTextIndexStats(v FullTextIndexStats) error
- func (t *IndexStats) FromGraphIndexStats(v GraphIndexStats) error
- func (t IndexStats) MarshalJSON() ([]byte, error)
- func (t *IndexStats) MergeEmbeddingsIndexStats(v EmbeddingsIndexStats) error
- func (t *IndexStats) MergeFullTextIndexStats(v FullTextIndexStats) error
- func (t *IndexStats) MergeGraphIndexStats(v GraphIndexStats) error
- func (t *IndexStats) UnmarshalJSON(b []byte) error
- type IndexStatus
- type IndexType
- type InternalServerError
- type JoinClause
- type JoinCondition
- type JoinFilters
- type JoinOperator
- type JoinResult
- type JoinStrategy
- type JoinType
- type KeyIdPathParameter
- type KeyRange
- type LinearMergeJSONRequestBody
- type LinearMergePageStatus
- type LinearMergeRequest
- type LinearMergeResponse
- type LinearMergeResult
- type ListApiKeysResponse
- type ListBackupsParams
- type ListBackupsResponse
- type ListIndexesResponse
- type ListSecretsResponse
- type ListTablesParams
- type ListTablesResponse
- type ListUsersResponse
- type LookupKeyParams
- type LookupKeyResponse
- type MatchAllQuery
- type MatchNoneQuery
- type MatchPhraseQuery
- type MatchQuery
- type MatchQueryOperator
- type MergeConfig
- type MergeStrategy
- type MultiBatchRequest
- type MultiBatchResponse
- type MultiBatchWriteJSONRequestBody
- type MultiBatchWriteResponse
- type MultiPhraseQuery
- type NodeFilter
- type NotFound
- type NumericRangeQuery
- type OllamaEmbedderConfig
- type OllamaGeneratorConfig
- type OllamaRerankerConfig
- type OpenAIEmbedderConfig
- type OpenAIGeneratorConfig
- type OpenRouterEmbedderConfig
- type OpenRouterGeneratorConfig
- type Path
- type PathEdge
- type PathFindRequest
- type PathFindResult
- type PathFindWeightMode
- type PathWeightMode
- type PatternEdgeStep
- type PatternMatch
- type PatternStep
- type Permission
- type PermissionType
- type PhraseQuery
- type PrefixQuery
- type PruneStats
- type Pruner
- type PutSecretJSONRequestBody
- type PutSecretResponse
- type Query
- func (t Query) AsBoolFieldQuery() (BoolFieldQuery, error)
- func (t Query) AsBooleanQuery() (BooleanQuery, error)
- func (t Query) AsConjunctionQuery() (ConjunctionQuery, error)
- func (t Query) AsDateRangeStringQuery() (DateRangeStringQuery, error)
- func (t Query) AsDisjunctionQuery() (DisjunctionQuery, error)
- func (t Query) AsDocIdQuery() (DocIdQuery, error)
- func (t Query) AsFuzzyQuery() (FuzzyQuery, error)
- func (t Query) AsGeoBoundingBoxQuery() (GeoBoundingBoxQuery, error)
- func (t Query) AsGeoBoundingPolygonQuery() (GeoBoundingPolygonQuery, error)
- func (t Query) AsGeoDistanceQuery() (GeoDistanceQuery, error)
- func (t Query) AsGeoShapeQuery() (GeoShapeQuery, error)
- func (t Query) AsIPRangeQuery() (IPRangeQuery, error)
- func (t Query) AsMatchAllQuery() (MatchAllQuery, error)
- func (t Query) AsMatchNoneQuery() (MatchNoneQuery, error)
- func (t Query) AsMatchPhraseQuery() (MatchPhraseQuery, error)
- func (t Query) AsMatchQuery() (MatchQuery, error)
- func (t Query) AsMultiPhraseQuery() (MultiPhraseQuery, error)
- func (t Query) AsNumericRangeQuery() (NumericRangeQuery, error)
- func (t Query) AsPhraseQuery() (PhraseQuery, error)
- func (t Query) AsPrefixQuery() (PrefixQuery, error)
- func (t Query) AsQueryStringQuery() (QueryStringQuery, error)
- func (t Query) AsRegexpQuery() (RegexpQuery, error)
- func (t Query) AsTermQuery() (TermQuery, error)
- func (t Query) AsTermRangeQuery() (TermRangeQuery, error)
- func (t Query) AsWildcardQuery() (WildcardQuery, error)
- func (t *Query) FromBoolFieldQuery(v BoolFieldQuery) error
- func (t *Query) FromBooleanQuery(v BooleanQuery) error
- func (t *Query) FromConjunctionQuery(v ConjunctionQuery) error
- func (t *Query) FromDateRangeStringQuery(v DateRangeStringQuery) error
- func (t *Query) FromDisjunctionQuery(v DisjunctionQuery) error
- func (t *Query) FromDocIdQuery(v DocIdQuery) error
- func (t *Query) FromFuzzyQuery(v FuzzyQuery) error
- func (t *Query) FromGeoBoundingBoxQuery(v GeoBoundingBoxQuery) error
- func (t *Query) FromGeoBoundingPolygonQuery(v GeoBoundingPolygonQuery) error
- func (t *Query) FromGeoDistanceQuery(v GeoDistanceQuery) error
- func (t *Query) FromGeoShapeQuery(v GeoShapeQuery) error
- func (t *Query) FromIPRangeQuery(v IPRangeQuery) error
- func (t *Query) FromMatchAllQuery(v MatchAllQuery) error
- func (t *Query) FromMatchNoneQuery(v MatchNoneQuery) error
- func (t *Query) FromMatchPhraseQuery(v MatchPhraseQuery) error
- func (t *Query) FromMatchQuery(v MatchQuery) error
- func (t *Query) FromMultiPhraseQuery(v MultiPhraseQuery) error
- func (t *Query) FromNumericRangeQuery(v NumericRangeQuery) error
- func (t *Query) FromPhraseQuery(v PhraseQuery) error
- func (t *Query) FromPrefixQuery(v PrefixQuery) error
- func (t *Query) FromQueryStringQuery(v QueryStringQuery) error
- func (t *Query) FromRegexpQuery(v RegexpQuery) error
- func (t *Query) FromTermQuery(v TermQuery) error
- func (t *Query) FromTermRangeQuery(v TermRangeQuery) error
- func (t *Query) FromWildcardQuery(v WildcardQuery) error
- func (t Query) MarshalJSON() ([]byte, error)
- func (t *Query) MergeBoolFieldQuery(v BoolFieldQuery) error
- func (t *Query) MergeBooleanQuery(v BooleanQuery) error
- func (t *Query) MergeConjunctionQuery(v ConjunctionQuery) error
- func (t *Query) MergeDateRangeStringQuery(v DateRangeStringQuery) error
- func (t *Query) MergeDisjunctionQuery(v DisjunctionQuery) error
- func (t *Query) MergeDocIdQuery(v DocIdQuery) error
- func (t *Query) MergeFuzzyQuery(v FuzzyQuery) error
- func (t *Query) MergeGeoBoundingBoxQuery(v GeoBoundingBoxQuery) error
- func (t *Query) MergeGeoBoundingPolygonQuery(v GeoBoundingPolygonQuery) error
- func (t *Query) MergeGeoDistanceQuery(v GeoDistanceQuery) error
- func (t *Query) MergeGeoShapeQuery(v GeoShapeQuery) error
- func (t *Query) MergeIPRangeQuery(v IPRangeQuery) error
- func (t *Query) MergeMatchAllQuery(v MatchAllQuery) error
- func (t *Query) MergeMatchNoneQuery(v MatchNoneQuery) error
- func (t *Query) MergeMatchPhraseQuery(v MatchPhraseQuery) error
- func (t *Query) MergeMatchQuery(v MatchQuery) error
- func (t *Query) MergeMultiPhraseQuery(v MultiPhraseQuery) error
- func (t *Query) MergeNumericRangeQuery(v NumericRangeQuery) error
- func (t *Query) MergePhraseQuery(v PhraseQuery) error
- func (t *Query) MergePrefixQuery(v PrefixQuery) error
- func (t *Query) MergeQueryStringQuery(v QueryStringQuery) error
- func (t *Query) MergeRegexpQuery(v RegexpQuery) error
- func (t *Query) MergeTermQuery(v TermQuery) error
- func (t *Query) MergeTermRangeQuery(v TermRangeQuery) error
- func (t *Query) MergeWildcardQuery(v WildcardQuery) error
- func (t *Query) UnmarshalJSON(b []byte) error
- type QueryBuilderAgentJSONRequestBody
- type QueryBuilderAgentResponse
- type QueryBuilderRequest
- type QueryBuilderResult
- type QueryHit
- type QueryHits
- type QueryRequest
- type QueryRequestExpandStrategy
- type QueryResponses
- type QueryResult
- type QueryStrategy
- type QueryStringQuery
- type QueryTableJSONRequestBody
- type QueryTableResponse
- type RegexpQuery
- type RemovePermissionFromUserParams
- type RemovePermissionFromUserResponse
- type ReplicationRoute
- type ReplicationSource
- type ReplicationSourceType
- type ReplicationTransformOp
- type RequestEditorFn
- type RerankerConfig
- func (t RerankerConfig) AsAntflyRerankerConfig() (AntflyRerankerConfig, error)
- func (t RerankerConfig) AsCohereRerankerConfig() (CohereRerankerConfig, error)
- func (t RerankerConfig) AsOllamaRerankerConfig() (OllamaRerankerConfig, error)
- func (t RerankerConfig) AsTermiteRerankerConfig() (TermiteRerankerConfig, error)
- func (t RerankerConfig) AsVertexRerankerConfig() (VertexRerankerConfig, error)
- func (t *RerankerConfig) FromAntflyRerankerConfig(v AntflyRerankerConfig) error
- func (t *RerankerConfig) FromCohereRerankerConfig(v CohereRerankerConfig) error
- func (t *RerankerConfig) FromOllamaRerankerConfig(v OllamaRerankerConfig) error
- func (t *RerankerConfig) FromTermiteRerankerConfig(v TermiteRerankerConfig) error
- func (t *RerankerConfig) FromVertexRerankerConfig(v VertexRerankerConfig) error
- func (t RerankerConfig) MarshalJSON() ([]byte, error)
- func (t *RerankerConfig) MergeAntflyRerankerConfig(v AntflyRerankerConfig) error
- func (t *RerankerConfig) MergeCohereRerankerConfig(v CohereRerankerConfig) error
- func (t *RerankerConfig) MergeOllamaRerankerConfig(v OllamaRerankerConfig) error
- func (t *RerankerConfig) MergeTermiteRerankerConfig(v TermiteRerankerConfig) error
- func (t *RerankerConfig) MergeVertexRerankerConfig(v VertexRerankerConfig) error
- func (t *RerankerConfig) UnmarshalJSON(b []byte) error
- type RerankerProvider
- type ResourceType
- type RestoreJSONRequestBody
- type RestoreRequest
- type RestoreResponse
- type RestoreTableJSONRequestBody
- type RestoreTableResponse
- type RetrievalAgentJSONRequestBody
- type RetrievalAgentRequest
- type RetrievalAgentResponse
- type RetrievalAgentResult
- type RetrievalAgentStatus
- type RetrievalAgentSteps
- type RetrievalAgentUsage
- type RetrievalQueryRequest
- type RetrievalQueryRequestExpandStrategy
- type RetrievalReasoningStep
- type RetrievalReasoningStepStatus
- type RetrievalStrategy
- type RetryConfig
- type RouteType
- type ScanKeysJSONRequestBody
- type ScanKeysRequest
- type ScanKeysResponse
- type SchemasAntflyType
- type SecretEntry
- type SecretList
- type SecretStatus
- type SecretWriteRequest
- type SemanticQueryMode
- type SerperSearchConfig
- type SerperSearchConfigSearchType
- type SerperSearchConfigTimePeriod
- type ShardConfig
- type SignificanceAlgorithm
- type SortDirection
- type StorageStatus
- type SuccessMessage
- type SyncLevel
- type Table
- type TableBackupStatus
- type TableBackupStatusStatus
- type TableRestoreStatus
- type TableRestoreStatusStatus
- type TableSchema
- type TableStatistics
- type TableStatus
- type TavilySearchConfig
- type TavilySearchConfigSearchDepth
- type TemplateFieldMapping
- type TermQuery
- type TermRangeQuery
- type TermiteChunkerConfig
- type TermiteEmbedderConfig
- type TermiteGeneratorConfig
- type TermiteRerankerConfig
- type TextChunkOptions
- type TransactionCommitRequest
- type TransactionCommitResponse
- type TransactionCommitResponseStatus
- type TransactionReadItem
- type Transform
- type TransformOp
- type TransformOpType
- type TraversalResult
- type TraversalRules
- type TraverseResponse
- type TreeSearchConfig
- type UpdatePasswordRequest
- type UpdateSchemaJSONRequestBody
- type UpdateSchemaResponse
- type UpdateUserPasswordJSONRequestBody
- type UpdateUserPasswordResponse
- type User
- type UserNamePathParameter
- type ValidationError
- type ValidationResult
- type VertexEmbedderConfig
- type VertexGeneratorConfig
- type VertexRerankerConfig
- type WebSearchConfig
- type WebSearchProvider
- type WildcardQuery
Constants ¶
const ( ApiKeyAuthScopes = "ApiKeyAuth.Scopes" BasicAuthScopes = "BasicAuth.Scopes" BearerAuthScopes = "BearerAuth.Scopes" )
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func NewAddPermissionToUserRequest ¶
func NewAddPermissionToUserRequest(server string, userName UserNamePathParameter, body AddPermissionToUserJSONRequestBody) (*http.Request, error)
NewAddPermissionToUserRequest calls the generic AddPermissionToUser builder with application/json body
func NewAddPermissionToUserRequestWithBody ¶
func NewAddPermissionToUserRequestWithBody(server string, userName UserNamePathParameter, contentType string, body io.Reader) (*http.Request, error)
NewAddPermissionToUserRequestWithBody generates requests for AddPermissionToUser with any type of body
func NewAnswerAgentRequest ¶
func NewAnswerAgentRequest(server string, body AnswerAgentJSONRequestBody) (*http.Request, error)
NewAnswerAgentRequest calls the generic AnswerAgent builder with application/json body
func NewAnswerAgentRequestWithBody ¶
func NewAnswerAgentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewAnswerAgentRequestWithBody generates requests for AnswerAgent with any type of body
func NewBackupRequest ¶
func NewBackupRequest(server string, body BackupJSONRequestBody) (*http.Request, error)
NewBackupRequest calls the generic Backup builder with application/json body
func NewBackupRequestWithBody ¶
func NewBackupRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewBackupRequestWithBody generates requests for Backup with any type of body
func NewBackupTableRequest ¶
func NewBackupTableRequest(server string, tableName string, body BackupTableJSONRequestBody) (*http.Request, error)
NewBackupTableRequest calls the generic BackupTable builder with application/json body
func NewBackupTableRequestWithBody ¶
func NewBackupTableRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
NewBackupTableRequestWithBody generates requests for BackupTable with any type of body
func NewBatchWriteRequest ¶
func NewBatchWriteRequest(server string, tableName string, body BatchWriteJSONRequestBody) (*http.Request, error)
NewBatchWriteRequest calls the generic BatchWrite builder with application/json body
func NewBatchWriteRequestWithBody ¶
func NewBatchWriteRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
NewBatchWriteRequestWithBody generates requests for BatchWrite with any type of body
func NewCommitTransactionRequest ¶
func NewCommitTransactionRequest(server string, body CommitTransactionJSONRequestBody) (*http.Request, error)
NewCommitTransactionRequest calls the generic CommitTransaction builder with application/json body
func NewCommitTransactionRequestWithBody ¶
func NewCommitTransactionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCommitTransactionRequestWithBody generates requests for CommitTransaction with any type of body
func NewCreateApiKeyRequest ¶
func NewCreateApiKeyRequest(server string, userName UserNamePathParameter, body CreateApiKeyJSONRequestBody) (*http.Request, error)
NewCreateApiKeyRequest calls the generic CreateApiKey builder with application/json body
func NewCreateApiKeyRequestWithBody ¶
func NewCreateApiKeyRequestWithBody(server string, userName UserNamePathParameter, contentType string, body io.Reader) (*http.Request, error)
NewCreateApiKeyRequestWithBody generates requests for CreateApiKey with any type of body
func NewCreateIndexRequest ¶
func NewCreateIndexRequest(server string, tableName string, indexName string, body CreateIndexJSONRequestBody) (*http.Request, error)
NewCreateIndexRequest calls the generic CreateIndex builder with application/json body
func NewCreateIndexRequestWithBody ¶
func NewCreateIndexRequestWithBody(server string, tableName string, indexName string, contentType string, body io.Reader) (*http.Request, error)
NewCreateIndexRequestWithBody generates requests for CreateIndex with any type of body
func NewCreateTableRequest ¶
func NewCreateTableRequest(server string, tableName string, body CreateTableJSONRequestBody) (*http.Request, error)
NewCreateTableRequest calls the generic CreateTable builder with application/json body
func NewCreateTableRequestWithBody ¶
func NewCreateTableRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
NewCreateTableRequestWithBody generates requests for CreateTable with any type of body
func NewCreateUserRequest ¶
func NewCreateUserRequest(server string, userName UserNamePathParameter, body CreateUserJSONRequestBody) (*http.Request, error)
NewCreateUserRequest calls the generic CreateUser builder with application/json body
func NewCreateUserRequestWithBody ¶
func NewCreateUserRequestWithBody(server string, userName UserNamePathParameter, contentType string, body io.Reader) (*http.Request, error)
NewCreateUserRequestWithBody generates requests for CreateUser with any type of body
func NewDeleteApiKeyRequest ¶
func NewDeleteApiKeyRequest(server string, userName UserNamePathParameter, keyId KeyIdPathParameter) (*http.Request, error)
NewDeleteApiKeyRequest generates requests for DeleteApiKey
func NewDeleteSecretRequest ¶
NewDeleteSecretRequest generates requests for DeleteSecret
func NewDeleteUserRequest ¶
func NewDeleteUserRequest(server string, userName UserNamePathParameter) (*http.Request, error)
NewDeleteUserRequest generates requests for DeleteUser
func NewDropIndexRequest ¶
NewDropIndexRequest generates requests for DropIndex
func NewDropTableRequest ¶
NewDropTableRequest generates requests for DropTable
func NewEvaluateRequest ¶
func NewEvaluateRequest(server string, body EvaluateJSONRequestBody) (*http.Request, error)
NewEvaluateRequest calls the generic Evaluate builder with application/json body
func NewEvaluateRequestWithBody ¶
func NewEvaluateRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewEvaluateRequestWithBody generates requests for Evaluate with any type of body
func NewGetCurrentUserRequest ¶
NewGetCurrentUserRequest generates requests for GetCurrentUser
func NewGetIndexRequest ¶
NewGetIndexRequest generates requests for GetIndex
func NewGetStatusRequest ¶
NewGetStatusRequest generates requests for GetStatus
func NewGetTableRequest ¶
NewGetTableRequest generates requests for GetTable
func NewGetUserByNameRequest ¶
func NewGetUserByNameRequest(server string, userName UserNamePathParameter) (*http.Request, error)
NewGetUserByNameRequest generates requests for GetUserByName
func NewGetUserPermissionsRequest ¶
func NewGetUserPermissionsRequest(server string, userName UserNamePathParameter) (*http.Request, error)
NewGetUserPermissionsRequest generates requests for GetUserPermissions
func NewGlobalQueryRequest ¶
func NewGlobalQueryRequest(server string, body GlobalQueryJSONRequestBody) (*http.Request, error)
NewGlobalQueryRequest calls the generic GlobalQuery builder with application/json body
func NewGlobalQueryRequestWithBody ¶
func NewGlobalQueryRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewGlobalQueryRequestWithBody generates requests for GlobalQuery with any type of body
func NewLinearMergeRequest ¶
func NewLinearMergeRequest(server string, tableName string, body LinearMergeJSONRequestBody) (*http.Request, error)
NewLinearMergeRequest calls the generic LinearMerge builder with application/json body
func NewLinearMergeRequestWithBody ¶
func NewLinearMergeRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
NewLinearMergeRequestWithBody generates requests for LinearMerge with any type of body
func NewListApiKeysRequest ¶
func NewListApiKeysRequest(server string, userName UserNamePathParameter) (*http.Request, error)
NewListApiKeysRequest generates requests for ListApiKeys
func NewListBackupsRequest ¶
func NewListBackupsRequest(server string, params *ListBackupsParams) (*http.Request, error)
NewListBackupsRequest generates requests for ListBackups
func NewListIndexesRequest ¶
NewListIndexesRequest generates requests for ListIndexes
func NewListSecretsRequest ¶
NewListSecretsRequest generates requests for ListSecrets
func NewListTablesRequest ¶
func NewListTablesRequest(server string, params *ListTablesParams) (*http.Request, error)
NewListTablesRequest generates requests for ListTables
func NewListUsersRequest ¶
NewListUsersRequest generates requests for ListUsers
func NewLookupKeyRequest ¶
func NewLookupKeyRequest(server string, tableName string, key string, params *LookupKeyParams) (*http.Request, error)
NewLookupKeyRequest generates requests for LookupKey
func NewMultiBatchWriteRequest ¶
func NewMultiBatchWriteRequest(server string, body MultiBatchWriteJSONRequestBody) (*http.Request, error)
NewMultiBatchWriteRequest calls the generic MultiBatchWrite builder with application/json body
func NewMultiBatchWriteRequestWithBody ¶
func NewMultiBatchWriteRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewMultiBatchWriteRequestWithBody generates requests for MultiBatchWrite with any type of body
func NewPutSecretRequest ¶
func NewPutSecretRequest(server string, key string, body PutSecretJSONRequestBody) (*http.Request, error)
NewPutSecretRequest calls the generic PutSecret builder with application/json body
func NewPutSecretRequestWithBody ¶
func NewPutSecretRequestWithBody(server string, key string, contentType string, body io.Reader) (*http.Request, error)
NewPutSecretRequestWithBody generates requests for PutSecret with any type of body
func NewQueryBuilderAgentRequest ¶
func NewQueryBuilderAgentRequest(server string, body QueryBuilderAgentJSONRequestBody) (*http.Request, error)
NewQueryBuilderAgentRequest calls the generic QueryBuilderAgent builder with application/json body
func NewQueryBuilderAgentRequestWithBody ¶
func NewQueryBuilderAgentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewQueryBuilderAgentRequestWithBody generates requests for QueryBuilderAgent with any type of body
func NewQueryTableRequest ¶
func NewQueryTableRequest(server string, tableName string, body QueryTableJSONRequestBody) (*http.Request, error)
NewQueryTableRequest calls the generic QueryTable builder with application/json body
func NewQueryTableRequestWithBody ¶
func NewQueryTableRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
NewQueryTableRequestWithBody generates requests for QueryTable with any type of body
func NewRemovePermissionFromUserRequest ¶
func NewRemovePermissionFromUserRequest(server string, userName UserNamePathParameter, params *RemovePermissionFromUserParams) (*http.Request, error)
NewRemovePermissionFromUserRequest generates requests for RemovePermissionFromUser
func NewRestoreRequest ¶
func NewRestoreRequest(server string, body RestoreJSONRequestBody) (*http.Request, error)
NewRestoreRequest calls the generic Restore builder with application/json body
func NewRestoreRequestWithBody ¶
func NewRestoreRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewRestoreRequestWithBody generates requests for Restore with any type of body
func NewRestoreTableRequest ¶
func NewRestoreTableRequest(server string, tableName string, body RestoreTableJSONRequestBody) (*http.Request, error)
NewRestoreTableRequest calls the generic RestoreTable builder with application/json body
func NewRestoreTableRequestWithBody ¶
func NewRestoreTableRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
NewRestoreTableRequestWithBody generates requests for RestoreTable with any type of body
func NewRetrievalAgentRequest ¶
func NewRetrievalAgentRequest(server string, body RetrievalAgentJSONRequestBody) (*http.Request, error)
NewRetrievalAgentRequest calls the generic RetrievalAgent builder with application/json body
func NewRetrievalAgentRequestWithBody ¶
func NewRetrievalAgentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewRetrievalAgentRequestWithBody generates requests for RetrievalAgent with any type of body
func NewScanKeysRequest ¶
func NewScanKeysRequest(server string, tableName string, body ScanKeysJSONRequestBody) (*http.Request, error)
NewScanKeysRequest calls the generic ScanKeys builder with application/json body
func NewScanKeysRequestWithBody ¶
func NewScanKeysRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
NewScanKeysRequestWithBody generates requests for ScanKeys with any type of body
func NewUpdateSchemaRequest ¶
func NewUpdateSchemaRequest(server string, tableName string, body UpdateSchemaJSONRequestBody) (*http.Request, error)
NewUpdateSchemaRequest calls the generic UpdateSchema builder with application/json body
func NewUpdateSchemaRequestWithBody ¶
func NewUpdateSchemaRequestWithBody(server string, tableName string, contentType string, body io.Reader) (*http.Request, error)
NewUpdateSchemaRequestWithBody generates requests for UpdateSchema with any type of body
func NewUpdateUserPasswordRequest ¶
func NewUpdateUserPasswordRequest(server string, userName UserNamePathParameter, body UpdateUserPasswordJSONRequestBody) (*http.Request, error)
NewUpdateUserPasswordRequest calls the generic UpdateUserPassword builder with application/json body
func NewUpdateUserPasswordRequestWithBody ¶
func NewUpdateUserPasswordRequestWithBody(server string, userName UserNamePathParameter, contentType string, body io.Reader) (*http.Request, error)
NewUpdateUserPasswordRequestWithBody generates requests for UpdateUserPassword with any type of body
Types ¶
type AddPermissionToUserJSONRequestBody ¶
type AddPermissionToUserJSONRequestBody = Permission
AddPermissionToUserJSONRequestBody defines body for AddPermissionToUser for application/json ContentType.
type AddPermissionToUserResponse ¶
type AddPermissionToUserResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *SuccessMessage
JSON400 *Error
JSON404 *Error
JSON500 *Error
}
func ParseAddPermissionToUserResponse ¶
func ParseAddPermissionToUserResponse(rsp *http.Response) (*AddPermissionToUserResponse, error)
ParseAddPermissionToUserResponse parses an HTTP response from a AddPermissionToUserWithResponse call
func (AddPermissionToUserResponse) Status ¶
func (r AddPermissionToUserResponse) Status() string
Status returns HTTPResponse.Status
func (AddPermissionToUserResponse) StatusCode ¶
func (r AddPermissionToUserResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type AggregationBucket ¶
type AggregationBucket struct {
// BgCount Background count (for significant_terms)
BgCount *int `json:"bg_count,omitempty"`
// DocCount Number of documents in this bucket
DocCount int `json:"doc_count"`
// From Lower bound for range buckets
From *float64 `json:"from,omitempty"`
// FromAsString Formatted lower bound
FromAsString *string `json:"from_as_string,omitempty"`
// Key Bucket key (term, range name, date, etc.)
Key string `json:"key"`
// KeyAsString Formatted key for display (e.g., formatted dates)
KeyAsString *string `json:"key_as_string,omitempty"`
// Score Significance score (for significant_terms)
Score *float64 `json:"score,omitempty"`
// SubAggregations Results of nested sub-aggregations
SubAggregations map[string]AggregationResult `json:"sub_aggregations,omitempty,omitzero"`
// To Upper bound for range buckets
To *float64 `json:"to,omitempty"`
// ToAsString Formatted upper bound
ToAsString *string `json:"to_as_string,omitempty"`
}
AggregationBucket defines model for AggregationBucket.
type AggregationDateRange ¶
type AggregationDateRange struct {
// From Start date (ISO 8601 or relative like "now-7d")
From *string `json:"from,omitempty"`
// Name Name of the date range bucket
Name string `json:"name"`
// To End date (ISO 8601 or relative like "now")
To *string `json:"to,omitempty"`
}
AggregationDateRange defines model for AggregationDateRange.
type AggregationRange ¶
type AggregationRange struct {
// From Lower bound (inclusive)
From *float64 `json:"from,omitempty"`
// Name Name of the range bucket
Name string `json:"name"`
// To Upper bound (exclusive)
To *float64 `json:"to,omitempty"`
}
AggregationRange defines model for AggregationRange.
type AggregationRequest ¶
type AggregationRequest struct {
// Algorithm Significance algorithm for significant_terms aggregations
Algorithm *SignificanceAlgorithm `json:"algorithm,omitempty"`
// BackgroundFilter Background filter for significant_terms aggregations
BackgroundFilter json.RawMessage `json:"background_filter,omitempty,omitzero"`
// CalendarInterval Calendar-aware interval for date_histogram aggregations
CalendarInterval *CalendarInterval `json:"calendar_interval,omitempty"`
// DateRanges Date ranges for date_range aggregations
DateRanges []AggregationDateRange `json:"date_ranges,omitempty,omitzero"`
// DistanceRanges Distance ranges for geo_distance aggregations
DistanceRanges []DistanceRange `json:"distance_ranges,omitempty,omitzero"`
// Field Field to aggregate on
Field string `json:"field"`
// Interval Fixed interval for histogram aggregations
Interval *float64 `json:"interval,omitempty"`
// MinDocCount Minimum document count for a bucket to be included
MinDocCount *int `json:"min_doc_count,omitempty"`
// Origin Origin for geohash_grid aggregation (format: "lat,lon")
// Example: "37.7749,-122.4194"
Origin *string `json:"origin,omitempty"`
// Precision Geohash precision (1-12) for geohash_grid aggregations
Precision *int `json:"precision,omitempty"`
// Ranges Ranges for range aggregations
Ranges []AggregationRange `json:"ranges,omitempty,omitzero"`
// Size Maximum number of buckets to return (for bucketing aggregations)
Size *int `json:"size,omitempty"`
// SubAggregations Nested sub-aggregations
SubAggregations map[string]AggregationRequest `json:"sub_aggregations,omitempty,omitzero"`
// Type Type of aggregation to compute:
// - Metrics: sum, avg, min, max, count, sumsquares, stats, cardinality
// - Bucketing: terms, range, date_range, histogram, date_histogram
// - Geo: geohash_grid, geo_distance
// - Analytics: significant_terms
Type AggregationType `json:"type"`
// Unit Distance unit for geo_distance aggregations
Unit *DistanceUnit `json:"unit,omitempty"`
}
AggregationRequest defines model for AggregationRequest.
type AggregationResult ¶
type AggregationResult struct {
// Avg Average for stats aggregations
Avg *float64 `json:"avg,omitempty"`
// Buckets Buckets for bucketing aggregations (terms, range, histogram, etc.)
Buckets []AggregationBucket `json:"buckets,omitempty,omitzero"`
// Count Document count for stats aggregations
Count *int `json:"count,omitempty"`
// Max Maximum value for stats aggregations
Max *float64 `json:"max,omitempty"`
// Min Minimum value for stats aggregations
Min *float64 `json:"min,omitempty"`
// StdDeviation Standard deviation for stats aggregations
StdDeviation *float64 `json:"std_deviation,omitempty"`
// Sum Sum for stats aggregations
Sum *float64 `json:"sum,omitempty"`
// SumOfSquares Sum of squares for stats aggregations
SumOfSquares *float64 `json:"sum_of_squares,omitempty"`
// Value Single value for metric aggregations (sum, avg, min, max, count, cardinality)
Value *float64 `json:"value,omitempty"`
// Variance Variance for stats aggregations
Variance *float64 `json:"variance,omitempty"`
}
AggregationResult defines model for AggregationResult.
type AggregationType ¶
type AggregationType string
AggregationType Type of aggregation to compute: - Metrics: sum, avg, min, max, count, sumsquares, stats, cardinality - Bucketing: terms, range, date_range, histogram, date_histogram - Geo: geohash_grid, geo_distance - Analytics: significant_terms
const ( AggregationTypeAvg AggregationType = "avg" AggregationTypeCardinality AggregationType = "cardinality" AggregationTypeCount AggregationType = "count" AggregationTypeDateHistogram AggregationType = "date_histogram" AggregationTypeDateRange AggregationType = "date_range" AggregationTypeGeoDistance AggregationType = "geo_distance" AggregationTypeGeohashGrid AggregationType = "geohash_grid" AggregationTypeHistogram AggregationType = "histogram" AggregationTypeMax AggregationType = "max" AggregationTypeMin AggregationType = "min" AggregationTypeRange AggregationType = "range" AggregationTypeSignificantTerms AggregationType = "significant_terms" AggregationTypeStats AggregationType = "stats" AggregationTypeSum AggregationType = "sum" AggregationTypeSumsquares AggregationType = "sumsquares" AggregationTypeTerms AggregationType = "terms" )
Defines values for AggregationType.
type Analyses ¶
type Analyses struct {
Pca bool `json:"pca,omitempty,omitzero"`
Tsne bool `json:"tsne,omitempty,omitzero"`
}
Analyses defines model for Analyses.
type AnalysesResult ¶
type AnalysesResult struct {
Pca []float64 `json:"pca,omitempty,omitzero"`
Tsne []float64 `json:"tsne,omitempty,omitzero"`
}
AnalysesResult defines model for AnalysesResult.
type AnswerAgentJSONRequestBody ¶
type AnswerAgentJSONRequestBody = AnswerAgentRequest
AnswerAgentJSONRequestBody defines body for AnswerAgent for application/json ContentType.
type AnswerAgentRequest ¶
type AnswerAgentRequest struct {
// AgentKnowledge Domain-specific knowledge for the agent
AgentKnowledge string `json:"agent_knowledge,omitempty,omitzero"`
// Chain Chain of generators
Chain []ChainLink `json:"chain,omitempty,omitzero"`
// Eval Configuration for inline evaluation of query results.
// Add to RAGRequest, QueryRequest, or AnswerAgentRequest.
Eval EvalConfig `json:"eval,omitempty,omitzero"`
// Generator A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Generator GeneratorConfig `json:"generator,omitempty,omitzero"`
// MaxContextTokens Maximum tokens for document context
MaxContextTokens int `json:"max_context_tokens,omitempty,omitzero"`
// Queries Queries to execute. Each query specifies its own table.
Queries []QueryRequest `json:"queries"`
// Query User's natural language query
Query string `json:"query"`
// ReserveTokens Tokens to reserve for overhead
ReserveTokens int `json:"reserve_tokens,omitempty,omitzero"`
// Steps DEPRECATED: Use RetrievalAgentSteps instead.
// Configuration for the answer agent's pipeline steps.
// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
Steps AnswerAgentSteps `json:"steps,omitempty,omitzero"`
// WithStreaming DEPRECATED: Use stream on RetrievalAgentRequest instead.
// Enable SSE streaming vs JSON response.
WithStreaming bool `json:"with_streaming,omitempty,omitzero"`
// WithoutGeneration DEPRECATED: Omit steps.generation on RetrievalAgentRequest instead.
// If true, skip the generation step.
WithoutGeneration bool `json:"without_generation,omitempty,omitzero"`
}
AnswerAgentRequest DEPRECATED: Use RetrievalAgentRequest instead. Request for the answer agent. Accepts the old request format and internally delegates to the retrieval agent.
type AnswerAgentResponse ¶
type AnswerAgentResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *AnswerAgentResult
JSON400 *Error
JSON500 *Error
}
func ParseAnswerAgentResponse ¶
func ParseAnswerAgentResponse(rsp *http.Response) (*AnswerAgentResponse, error)
ParseAnswerAgentResponse parses an HTTP response from a AnswerAgentWithResponse call
func (AnswerAgentResponse) Status ¶
func (r AnswerAgentResponse) Status() string
Status returns HTTPResponse.Status
func (AnswerAgentResponse) StatusCode ¶
func (r AnswerAgentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type AnswerAgentResult ¶
type AnswerAgentResult struct {
// Answer DEPRECATED: Use generation on RetrievalAgentResult instead.
// Generated answer in markdown format.
Answer string `json:"answer,omitempty,omitzero"`
// AnswerConfidence DEPRECATED: Use generation_confidence on RetrievalAgentResult instead.
// Confidence in the generated answer.
AnswerConfidence float32 `json:"answer_confidence,omitempty,omitzero"`
// ClassificationTransformation Query classification and transformation result combining all query enhancements including strategy selection and semantic optimization
ClassificationTransformation ClassificationTransformationResult `json:"classification_transformation,omitempty,omitzero"`
// ContextRelevance Relevance of retrieved documents to the query
ContextRelevance float32 `json:"context_relevance,omitempty,omitzero"`
// EvalResult Complete evaluation result
EvalResult EvalResult `json:"eval_result,omitempty,omitzero"`
// FollowupQuestions Suggested follow-up questions
FollowupQuestions []string `json:"followup_questions,omitempty,omitzero"`
// QueryResults DEPRECATED: Use hits on RetrievalAgentResult instead.
// Query results grouped by table.
QueryResults []QueryResult `json:"query_results,omitempty,omitzero"`
}
AnswerAgentResult DEPRECATED: Use RetrievalAgentResult instead. Result from the answer agent.
type AnswerAgentSteps ¶
type AnswerAgentSteps struct {
// Answer Configuration for the generation step. This step generates the final
// response from retrieved documents using the reasoning as context.
Answer GenerationStepConfig `json:"answer,omitempty,omitzero"`
// Classification Configuration for the classification step. This step analyzes the query,
// selects the optimal retrieval strategy, and generates semantic transformations.
Classification ClassificationStepConfig `json:"classification,omitempty,omitzero"`
// Confidence Configuration for confidence assessment. Evaluates answer quality and
// resource relevance. Can use a model calibrated for scoring tasks.
Confidence ConfidenceStepConfig `json:"confidence,omitempty,omitzero"`
// Followup Configuration for generating follow-up questions. Uses a separate generator
// call which can use a cheaper/faster model.
Followup FollowupStepConfig `json:"followup,omitempty,omitzero"`
}
AnswerAgentSteps DEPRECATED: Use RetrievalAgentSteps instead. Configuration for the answer agent's pipeline steps.
type AntflyChunkerConfig ¶
type AntflyChunkerConfig = ChunkOptions
AntflyChunkerConfig Per-request configuration for chunking. All fields are optional - zero/omitted values use chunker defaults.
type AntflyEmbedderConfig ¶
type AntflyEmbedderConfig = map[string]interface{}
AntflyEmbedderConfig Configuration for the built-in Antfly embedding provider.
Uses an embedded INT8-quantized all-MiniLM-L6-v2 ONNX model bundled directly in the binary. No external service, API key, or model download required.
**Model:** all-MiniLM-L6-v2 (384 dimensions, text-only)
**Features:** - Zero configuration — works out of the box - No network access required - Pure Go inference via GoMLX
type AntflyRerankerConfig ¶
type AntflyRerankerConfig = map[string]interface{}
AntflyRerankerConfig Configuration for the built-in Antfly reranking provider.
Uses an embedded INT8-quantized cross-encoder/ms-marco-MiniLM-L-6-v2 ONNX model bundled directly in the binary. No external service, API key, or model download required.
**Model:** cross-encoder/ms-marco-MiniLM-L-6-v2 (6-layer MiniLM cross-encoder)
**Features:** - Zero configuration — works out of the box - No network access required - Pure Go inference via GoMLX
type AntflyType ¶
type AntflyType string
AntflyType defines model for AntflyType.
const ( AntflyTypeBlob AntflyType = "blob" AntflyTypeBoolean AntflyType = "boolean" AntflyTypeDatetime AntflyType = "datetime" AntflyTypeEmbedding AntflyType = "embedding" AntflyTypeGeopoint AntflyType = "geopoint" AntflyTypeGeoshape AntflyType = "geoshape" AntflyTypeHtml AntflyType = "html" AntflyTypeKeyword AntflyType = "keyword" AntflyTypeLink AntflyType = "link" AntflyTypeNumeric AntflyType = "numeric" AntflyTypeSearchAsYouType AntflyType = "search_as_you_type" AntflyTypeText AntflyType = "text" )
Defines values for AntflyType.
type AnthropicGeneratorConfig ¶
type AnthropicGeneratorConfig struct {
// ApiKey The Anthropic API key. If not provided, falls back to ANTHROPIC_API_KEY environment variable.
ApiKey string `json:"api_key,omitempty,omitzero"`
// MaxTokens Maximum number of tokens to generate in the response.
MaxTokens int `json:"max_tokens,omitempty,omitzero"`
// Model The full model ID of the Anthropic model to use (e.g., 'claude-sonnet-4-5-20250929', 'claude-opus-4-5-20251101').
Model string `json:"model"`
// Temperature Controls randomness in generation (0.0-1.0). Higher values make output more random.
Temperature float32 `json:"temperature,omitempty,omitzero"`
// TopK Top-k sampling parameter. Only sample from the top K options for each subsequent token.
TopK int `json:"top_k,omitempty,omitzero"`
// TopP Nucleus sampling parameter (0.0-1.0). Alternative to temperature.
TopP float32 `json:"top_p,omitempty,omitzero"`
// Url The URL of the Anthropic API endpoint (optional, uses default if not specified).
Url string `json:"url,omitempty,omitzero"`
}
AnthropicGeneratorConfig Configuration for the Anthropic generative AI provider (Claude models).
API key via `api_key` field or `ANTHROPIC_API_KEY` environment variable.
**Example Models:** claude-sonnet-4-5-20250929 (default), claude-opus-4-5-20251101, claude-3-5-haiku-20241022
**Docs:** https://docs.anthropic.com/en/docs/about-claude/models/overview
type ApiKey ¶
type ApiKey struct {
// CreatedAt When the API key was created.
CreatedAt time.Time `json:"created_at"`
// ExpiresAt When the API key expires. Null means never.
ExpiresAt time.Time `json:"expires_at,omitzero"`
// KeyId Unique identifier for the API key.
KeyId string `json:"key_id"`
// Name Human-readable name for the API key.
Name string `json:"name"`
// Permissions Optional permission scoping. If empty, inherits owner's full permissions.
Permissions []Permission `json:"permissions,omitzero"`
// Username Owner of the API key.
Username string `json:"username"`
}
ApiKey Public metadata for an API key (secrets are never returned after creation).
type ApiKeyWithSecret ¶
type ApiKeyWithSecret struct {
// CreatedAt When the API key was created.
CreatedAt time.Time `json:"created_at"`
// Encoded Pre-encoded credential ready for the Authorization header: base64(key_id:key_secret).
Encoded string `json:"encoded"`
// ExpiresAt When the API key expires. Null means never.
ExpiresAt time.Time `json:"expires_at,omitzero"`
// KeyId Unique identifier for the API key.
KeyId string `json:"key_id"`
// KeySecret Cleartext secret for the API key. Store securely — it cannot be retrieved again.
KeySecret string `json:"key_secret"`
// Name Human-readable name for the API key.
Name string `json:"name"`
// Permissions Optional permission scoping. If empty, inherits owner's full permissions.
Permissions []Permission `json:"permissions,omitzero"`
// Username Owner of the API key.
Username string `json:"username"`
}
ApiKeyWithSecret defines model for ApiKeyWithSecret.
type AudioChunkOptions ¶
type AudioChunkOptions struct {
// OverlapDurationMs Overlap duration in milliseconds between audio chunks (default: 0).
OverlapDurationMs int `json:"overlap_duration_ms,omitempty,omitzero"`
// WindowDurationMs Window duration in milliseconds for fixed-window audio chunking (default: 30000).
WindowDurationMs int `json:"window_duration_ms,omitempty,omitzero"`
}
AudioChunkOptions Options specific to audio chunking.
type BackupInfo ¶
type BackupInfo struct {
// AntflyVersion Antfly version that created the backup
AntflyVersion string `json:"antfly_version,omitempty,omitzero"`
// BackupId The backup identifier
BackupId string `json:"backup_id"`
// Location Storage location of the backup
Location string `json:"location"`
// Tables Tables included in the backup
Tables []string `json:"tables"`
// Timestamp When the backup was created
Timestamp time.Time `json:"timestamp"`
}
BackupInfo defines model for BackupInfo.
type BackupJSONRequestBody ¶
type BackupJSONRequestBody = ClusterBackupRequest
BackupJSONRequestBody defines body for Backup for application/json ContentType.
type BackupListResponse ¶
type BackupListResponse struct {
// Backups List of available backups
Backups []BackupInfo `json:"backups"`
}
BackupListResponse defines model for BackupListResponse.
type BackupRequest ¶
type BackupRequest struct {
// BackupId Unique identifier for this backup. Used to reference the backup for restore operations.
// Choose a meaningful name that includes date/version information.
BackupId string `json:"backup_id"`
// Location Storage location for the backup. Supports multiple backends:
// - Local filesystem: `file:///path/to/backup`
// - Amazon S3: `s3://bucket-name/path/to/backup`
//
// The backup includes all table data, indexes, and metadata for the specified table.
Location string `json:"location"`
}
BackupRequest defines model for BackupRequest.
type BackupResponse ¶
type BackupResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ClusterBackupResponse
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseBackupResponse ¶
func ParseBackupResponse(rsp *http.Response) (*BackupResponse, error)
ParseBackupResponse parses an HTTP response from a BackupWithResponse call
func (BackupResponse) Status ¶
func (r BackupResponse) Status() string
Status returns HTTPResponse.Status
func (BackupResponse) StatusCode ¶
func (r BackupResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type BackupTableJSONRequestBody ¶
type BackupTableJSONRequestBody = BackupRequest
BackupTableJSONRequestBody defines body for BackupTable for application/json ContentType.
type BackupTableResponse ¶
type BackupTableResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *struct {
Backup string `json:"backup,omitempty,omitzero"`
}
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
func ParseBackupTableResponse ¶
func ParseBackupTableResponse(rsp *http.Response) (*BackupTableResponse, error)
ParseBackupTableResponse parses an HTTP response from a BackupTableWithResponse call
func (BackupTableResponse) Status ¶
func (r BackupTableResponse) Status() string
Status returns HTTPResponse.Status
func (BackupTableResponse) StatusCode ¶
func (r BackupTableResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type BatchRequest ¶
type BatchRequest struct {
// Deletes Array of document IDs to delete. Documents are removed from all indexes.
//
// Notes:
// - Non-existent keys are silently ignored
// - Deletions are processed before inserts in the same batch
// - Keys are permanently removed from storage and indexes
Deletes []string `json:"deletes,omitempty,omitzero"`
// Inserts Map of document IDs to document objects. Each key is the unique identifier for the document.
//
// Best practices:
// - Use consistent key naming schemes (e.g., "user:123", "article:456")
// - Key length affects storage and performance - keep them reasonably short
// - Keys are sorted lexicographically, so choose prefixes that support range scans
Inserts map[string]map[string]interface{} `json:"inserts,omitempty,omitzero"`
// SyncLevel Synchronization level for batch operations:
// - "propose": Wait for Raft proposal acceptance (fastest, default)
// - "write": Wait for Pebble KV write
// - "full_text": Wait for full-text index WAL write
// - "enrichments": Pre-compute enrichments before Raft proposal (synchronous enrichment generation)
// - "aknn": Wait for vector index write with best-effort synchronous embedding (falls back to async on timeout, slowest, most durable)
SyncLevel SyncLevel `json:"sync_level,omitempty,omitzero"`
// Transforms Array of transform operations for in-place document updates using MongoDB-style operators.
//
// Transform operations allow you to modify documents without read-modify-write races:
// - Operations are applied atomically on the server
// - Multiple operations per document are applied in sequence
// - Supports numeric operations ($inc, $mul), array operations ($push, $pull), and more
//
// Common use cases:
// - Increment counters (views, likes, votes)
// - Update timestamps ($currentDate)
// - Manage arrays (add/remove tags, items)
// - Update nested fields without overwriting the entire document
Transforms []Transform `json:"transforms,omitempty,omitzero"`
}
BatchRequest Batch insert, delete, and transform operations in a single request.
**Atomicity**: - **Single shard**: Operations are atomic within shard boundaries - **Multiple shards**: Uses distributed 2-phase commit (2PC) for atomic cross-shard writes
**How distributed transactions work**: 1. Metadata server allocates HLC timestamp and selects coordinator shard 2. Coordinator writes transaction record, participants write intents 3. After all intents succeed, coordinator commits transaction 4. Participants are notified asynchronously to resolve intents 5. Recovery loop ensures notifications complete even after coordinator failure
**Performance**: - Single-shard batches: < 5ms latency - Cross-shard transactions: ~20ms latency - Intent resolution: < 30 seconds worst-case (via recovery loop)
**Guarantees**: - All writes succeed or all fail (atomicity across all shards) - Coordinator failure is recoverable (new leader resumes notifications) - Idempotent resolution (duplicate notifications are safe)
**Benefits**: - Reduces network overhead compared to individual requests - More efficient indexing (updates are batched) - Automatic distributed transactions when operations span shards
The inserts are upserts - existing keys are overwritten, new keys are created.
type BatchResponse ¶
type BatchResponse struct {
// Deleted Number of documents successfully deleted
Deleted int `json:"deleted,omitempty,omitzero"`
// Inserted Number of documents successfully inserted
Inserted int `json:"inserted,omitempty,omitzero"`
// Transformed Number of documents successfully transformed
Transformed int `json:"transformed,omitempty,omitzero"`
}
BatchResponse defines model for BatchResponse.
type BatchWriteJSONRequestBody ¶
type BatchWriteJSONRequestBody = BatchRequest
BatchWriteJSONRequestBody defines body for BatchWrite for application/json ContentType.
type BatchWriteResponse ¶
type BatchWriteResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *BatchResponse
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
func ParseBatchWriteResponse ¶
func ParseBatchWriteResponse(rsp *http.Response) (*BatchWriteResponse, error)
ParseBatchWriteResponse parses an HTTP response from a BatchWriteWithResponse call
func (BatchWriteResponse) Status ¶
func (r BatchWriteResponse) Status() string
Status returns HTTPResponse.Status
func (BatchWriteResponse) StatusCode ¶
func (r BatchWriteResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type BedrockEmbedderConfig ¶
type BedrockEmbedderConfig struct {
// BatchSize The batch size for embedding requests to optimize throughput.
BatchSize int `json:"batch_size,omitempty,omitzero"`
// Model The Bedrock model ID to use (e.g., 'cohere.embed-english-v4', 'amazon.titan-embed-text-v2:0').
Model string `json:"model"`
// Region The AWS region for the Bedrock service (e.g., 'us-east-1').
Region string `json:"region,omitempty,omitzero"`
// StripNewLines Whether to strip new lines from the input text before embedding.
StripNewLines bool `json:"strip_new_lines,omitempty,omitzero"`
}
BedrockEmbedderConfig Configuration for the AWS Bedrock embedding provider.
Uses AWS credentials from environment or IAM roles.
**Example Models:** cohere.embed-english-v4, amazon.titan-embed-text-v2:0
**Docs:** https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html
type BedrockGeneratorConfig ¶
type BedrockGeneratorConfig struct {
// MaxTokens Maximum number of tokens to generate.
MaxTokens int `json:"max_tokens,omitempty,omitzero"`
// Model The Bedrock model ID to use (e.g., 'anthropic.claude-sonnet-4-5-20250929-v1:0').
Model string `json:"model"`
// Region The AWS region for the Bedrock service.
Region string `json:"region,omitempty,omitzero"`
// Temperature Controls randomness in generation (0.0-1.0).
Temperature float32 `json:"temperature,omitempty,omitzero"`
// TopK Top-k sampling parameter.
TopK int `json:"top_k,omitempty,omitzero"`
// TopP Nucleus sampling parameter.
TopP float32 `json:"top_p,omitempty,omitzero"`
}
BedrockGeneratorConfig Configuration for the AWS Bedrock generative AI provider.
Provides access to models from Anthropic, Meta, Amazon, Cohere, Mistral, and others.
**Example Models:** anthropic.claude-sonnet-4-5-20250929-v1:0, meta.llama3-3-70b-instruct-v1:0, amazon.nova-pro-v1:0
**Docs:** https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html
type BingSearchConfig ¶
type BingSearchConfig struct {
// ApiKey Bing Search API key (or set BING_SEARCH_API_KEY env var)
ApiKey string `json:"api_key,omitempty,omitzero"`
// Endpoint Bing API endpoint URL
Endpoint string `json:"endpoint,omitempty,omitzero"`
// Freshness Filter results by freshness
Freshness BingSearchConfigFreshness `json:"freshness,omitempty,omitzero"`
// Language Preferred language for results (e.g., 'en', 'es', 'fr')
Language string `json:"language,omitempty,omitzero"`
// MaxResults Maximum number of search results to return
MaxResults int `json:"max_results,omitempty,omitzero"`
// Provider The web search provider to use.
//
// - **google**: Google Custom Search API (requires CSE setup)
// - **bing**: Microsoft Bing Web Search API
// - **serper**: Serper.dev Google Search API (simpler setup)
// - **tavily**: Tavily AI Search API (optimized for RAG)
// - **brave**: Brave Search API
// - **duckduckgo**: DuckDuckGo Instant Answer API (limited, no API key)
Provider WebSearchProvider `json:"provider"`
// Region Preferred region for results (e.g., 'us', 'uk', 'de')
Region string `json:"region,omitempty,omitzero"`
// SafeSearch Enable safe search filtering
SafeSearch *bool `json:"safe_search,omitempty"`
// TimeoutMs Request timeout in milliseconds
TimeoutMs int `json:"timeout_ms,omitempty,omitzero"`
}
BingSearchConfig defines model for BingSearchConfig.
type BingSearchConfigFreshness ¶
type BingSearchConfigFreshness string
BingSearchConfigFreshness Filter results by freshness
const ( BingSearchConfigFreshnessDay BingSearchConfigFreshness = "Day" BingSearchConfigFreshnessMonth BingSearchConfigFreshness = "Month" BingSearchConfigFreshnessWeek BingSearchConfigFreshness = "Week" )
Defines values for BingSearchConfigFreshness.
type BoolFieldQuery ¶
type BoolFieldQuery struct {
Bool bool `json:"bool"`
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
}
BoolFieldQuery defines model for BoolFieldQuery.
type BooleanQuery ¶
type BooleanQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Filter Query `json:"filter,omitempty,omitzero"`
Must ConjunctionQuery `json:"must,omitempty,omitzero"`
MustNot DisjunctionQuery `json:"must_not,omitempty,omitzero"`
Should DisjunctionQuery `json:"should,omitempty,omitzero"`
}
BooleanQuery defines model for BooleanQuery.
type Boost ¶
type Boost = float64
Boost A floating-point number used to decrease or increase the relevance scores of a query.
type BraveSearchConfig ¶
type BraveSearchConfig struct {
// ApiKey Brave Search API key (or set BRAVE_API_KEY env var)
ApiKey string `json:"api_key,omitempty,omitzero"`
// Freshness Freshness filter: pd=day, pw=week, pm=month, py=year
Freshness BraveSearchConfigFreshness `json:"freshness,omitempty,omitzero"`
// Language Preferred language for results (e.g., 'en', 'es', 'fr')
Language string `json:"language,omitempty,omitzero"`
// MaxResults Maximum number of search results to return
MaxResults int `json:"max_results,omitempty,omitzero"`
// Provider The web search provider to use.
//
// - **google**: Google Custom Search API (requires CSE setup)
// - **bing**: Microsoft Bing Web Search API
// - **serper**: Serper.dev Google Search API (simpler setup)
// - **tavily**: Tavily AI Search API (optimized for RAG)
// - **brave**: Brave Search API
// - **duckduckgo**: DuckDuckGo Instant Answer API (limited, no API key)
Provider WebSearchProvider `json:"provider"`
// Region Preferred region for results (e.g., 'us', 'uk', 'de')
Region string `json:"region,omitempty,omitzero"`
// SafeSearch Enable safe search filtering
SafeSearch *bool `json:"safe_search,omitempty"`
// Spellcheck Enable spellcheck suggestions
Spellcheck bool `json:"spellcheck,omitempty,omitzero"`
// TextDecorations Include text decorations (bold, italic markers)
TextDecorations bool `json:"text_decorations,omitempty,omitzero"`
// TimeoutMs Request timeout in milliseconds
TimeoutMs int `json:"timeout_ms,omitempty,omitzero"`
}
BraveSearchConfig defines model for BraveSearchConfig.
type BraveSearchConfigFreshness ¶
type BraveSearchConfigFreshness string
BraveSearchConfigFreshness Freshness filter: pd=day, pw=week, pm=month, py=year
const ( BraveSearchConfigFreshnessPd BraveSearchConfigFreshness = "pd" BraveSearchConfigFreshnessPm BraveSearchConfigFreshness = "pm" BraveSearchConfigFreshnessPw BraveSearchConfigFreshness = "pw" BraveSearchConfigFreshnessPy BraveSearchConfigFreshness = "py" )
Defines values for BraveSearchConfigFreshness.
type CalendarInterval ¶
type CalendarInterval string
CalendarInterval Calendar-aware interval for date_histogram aggregations
const ( CalendarIntervalDay CalendarInterval = "day" CalendarIntervalHour CalendarInterval = "hour" CalendarIntervalMinute CalendarInterval = "minute" CalendarIntervalMonth CalendarInterval = "month" CalendarIntervalQuarter CalendarInterval = "quarter" CalendarIntervalWeek CalendarInterval = "week" CalendarIntervalYear CalendarInterval = "year" )
Defines values for CalendarInterval.
type ChainCondition ¶
type ChainCondition string
ChainCondition Condition for trying the next generator in chain: - always: Always try next regardless of outcome - on_error: Try next on any error (default) - on_timeout: Try next only on timeout errors - on_rate_limit: Try next only on rate limit errors
const ( ChainConditionAlways ChainCondition = "always" ChainConditionOnError ChainCondition = "on_error" ChainConditionOnRateLimit ChainCondition = "on_rate_limit" ChainConditionOnTimeout ChainCondition = "on_timeout" )
Defines values for ChainCondition.
type ChainLink ¶
type ChainLink struct {
// Condition Condition for trying the next generator in chain:
// - always: Always try next regardless of outcome
// - on_error: Try next on any error (default)
// - on_timeout: Try next only on timeout errors
// - on_rate_limit: Try next only on rate limit errors
Condition ChainCondition `json:"condition,omitempty,omitzero"`
// Generator A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Generator GeneratorConfig `json:"generator"`
// Retry Retry configuration for generator calls
Retry RetryConfig `json:"retry,omitempty,omitzero"`
}
ChainLink A single link in a generator chain with optional retry and condition
type ChatMessage ¶
type ChatMessage struct {
// Content Text content of the message
Content string `json:"content"`
// Role Role of the message sender in the conversation
Role ChatMessageRole `json:"role"`
// ToolCalls Tool calls made by the assistant (only for assistant role)
ToolCalls []ChatToolCall `json:"tool_calls,omitempty,omitzero"`
// ToolResults Results from tool executions (only for tool role)
ToolResults []ChatToolResult `json:"tool_results,omitempty,omitzero"`
}
ChatMessage A message in the conversation history
type ChatMessageRole ¶
type ChatMessageRole string
ChatMessageRole Role of the message sender in the conversation
const ( ChatMessageRoleAssistant ChatMessageRole = "assistant" ChatMessageRoleSystem ChatMessageRole = "system" ChatMessageRoleTool ChatMessageRole = "tool" ChatMessageRoleUser ChatMessageRole = "user" )
Defines values for ChatMessageRole.
type ChatToolCall ¶
type ChatToolCall struct {
// Arguments Arguments passed to the tool as key-value pairs
Arguments map[string]interface{} `json:"arguments"`
// Id Unique identifier for this tool call
Id string `json:"id"`
// Name Name of the tool being called
Name string `json:"name"`
}
ChatToolCall A tool call made by the assistant
type ChatToolName ¶
type ChatToolName string
ChatToolName Available tool names for the chat and retrieval agents. - add_filter: Add search filters (field constraints) - ask_clarification: Ask user for clarification - search: Execute semantic searches (legacy, use semantic_search for retrieval) - websearch: Search the web (requires websearch_config) - fetch: Fetch URL content (subject to security controls) - semantic_search: Execute semantic/vector search against an index - full_text_search: Execute full-text BM25 search against an index - tree_search: Execute tree search with beam search navigation - graph_search: Execute graph traversal search
const ( ChatToolNameAddFilter ChatToolName = "add_filter" ChatToolNameAskClarification ChatToolName = "ask_clarification" ChatToolNameFetch ChatToolName = "fetch" ChatToolNameFullTextSearch ChatToolName = "full_text_search" ChatToolNameGraphSearch ChatToolName = "graph_search" ChatToolNameSearch ChatToolName = "search" ChatToolNameSemanticSearch ChatToolName = "semantic_search" ChatToolNameTreeSearch ChatToolName = "tree_search" ChatToolNameWebsearch ChatToolName = "websearch" )
Defines values for ChatToolName.
type ChatToolResult ¶
type ChatToolResult struct {
// Error Error message if tool execution failed
Error string `json:"error,omitempty,omitzero"`
// Result Result data from the tool execution
Result map[string]interface{} `json:"result"`
// ToolCallId ID of the tool call this result corresponds to
ToolCallId string `json:"tool_call_id"`
}
ChatToolResult Result from executing a tool call
type ChatToolsConfig ¶
type ChatToolsConfig struct {
// EnabledTools List of tools to enable. If empty, defaults to filter, clarification, and search.
EnabledTools []ChatToolName `json:"enabled_tools,omitempty,omitzero"`
// FetchConfig Configuration for URL content fetching.
//
// Uses lib/scraping for downloading and processing. Supports:
// - HTTP/HTTPS URLs with security validation
// - HTML pages (extracts readable text via go-readability)
// - PDF files (extracts text)
// - Images (returns as data URIs)
// - Plain text files
// - S3 URLs (requires s3_credentials)
//
// Security features (from lib/scraping.ContentSecurityConfig):
// - Allowed host whitelist
// - Private IP blocking (SSRF prevention)
// - Download size limits
// - Timeout controls
FetchConfig FetchConfig `json:"fetch_config,omitempty,omitzero"`
// MaxToolIterations Maximum number of tool call iterations per turn.
// Prevents infinite loops in tool execution.
MaxToolIterations int `json:"max_tool_iterations,omitempty,omitzero"`
// WebsearchConfig A unified configuration for web search providers.
//
// Each provider has specific configuration requirements. Use the appropriate
// provider-specific config or set common options at the top level.
//
// **Environment Variables (fallbacks):**
// - GOOGLE_CSE_API_KEY, GOOGLE_CSE_ID
// - BING_SEARCH_API_KEY
// - SERPER_API_KEY
// - TAVILY_API_KEY
// - BRAVE_API_KEY
WebsearchConfig WebSearchConfig `json:"websearch_config,omitempty,omitzero"`
}
ChatToolsConfig Configuration for chat agent tools.
If `enabled_tools` is empty/omitted, defaults to: add_filter, ask_clarification, search.
For models that don't support native tool calling (e.g., Ollama), a prompt-based fallback is used with structured output parsing.
type ChunkOptions ¶
type ChunkOptions struct {
// Audio Options specific to audio chunking.
Audio AudioChunkOptions `json:"audio,omitempty,omitzero"`
// MaxChunks Maximum number of chunks to generate per document.
MaxChunks int `json:"max_chunks,omitempty,omitzero"`
// Text Options specific to text chunking.
Text TextChunkOptions `json:"text,omitempty,omitzero"`
// Threshold Confidence threshold for model-based chunking (0.0-1.0).
Threshold float32 `json:"threshold,omitempty,omitzero"`
}
ChunkOptions Per-request configuration for chunking. All fields are optional - zero/omitted values use chunker defaults.
type ChunkerConfig ¶
type ChunkerConfig struct {
// FullTextIndex Configuration for full-text indexing of chunks in Bleve.
// When present (even if empty), chunks will be stored with :cft: suffix and indexed in Bleve's _chunks field.
// When absent, chunks use :c: suffix and are only used for vector embeddings.
FullTextIndex map[string]interface{} `json:"full_text_index,omitempty,omitzero"`
// Provider The chunking provider to use.
Provider ChunkerProvider `json:"provider"`
// StoreChunks Controls whether chunk data is persisted to storage. When false (default), chunks are generated in memory and only embeddings are stored. When true, both chunks and embeddings are stored.
StoreChunks bool `json:"store_chunks,omitempty,omitzero"`
// contains filtered or unexported fields
}
ChunkerConfig defines model for ChunkerConfig.
func (ChunkerConfig) AsAntflyChunkerConfig ¶
func (t ChunkerConfig) AsAntflyChunkerConfig() (AntflyChunkerConfig, error)
AsAntflyChunkerConfig returns the union data inside the ChunkerConfig as a AntflyChunkerConfig
func (ChunkerConfig) AsTermiteChunkerConfig ¶
func (t ChunkerConfig) AsTermiteChunkerConfig() (TermiteChunkerConfig, error)
AsTermiteChunkerConfig returns the union data inside the ChunkerConfig as a TermiteChunkerConfig
func (*ChunkerConfig) FromAntflyChunkerConfig ¶
func (t *ChunkerConfig) FromAntflyChunkerConfig(v AntflyChunkerConfig) error
FromAntflyChunkerConfig overwrites any union data inside the ChunkerConfig as the provided AntflyChunkerConfig
func (*ChunkerConfig) FromTermiteChunkerConfig ¶
func (t *ChunkerConfig) FromTermiteChunkerConfig(v TermiteChunkerConfig) error
FromTermiteChunkerConfig overwrites any union data inside the ChunkerConfig as the provided TermiteChunkerConfig
func (ChunkerConfig) MarshalJSON ¶
func (t ChunkerConfig) MarshalJSON() ([]byte, error)
func (*ChunkerConfig) MergeAntflyChunkerConfig ¶
func (t *ChunkerConfig) MergeAntflyChunkerConfig(v AntflyChunkerConfig) error
MergeAntflyChunkerConfig performs a merge with any union data inside the ChunkerConfig, using the provided AntflyChunkerConfig
func (*ChunkerConfig) MergeTermiteChunkerConfig ¶
func (t *ChunkerConfig) MergeTermiteChunkerConfig(v TermiteChunkerConfig) error
MergeTermiteChunkerConfig performs a merge with any union data inside the ChunkerConfig, using the provided TermiteChunkerConfig
func (*ChunkerConfig) UnmarshalJSON ¶
func (t *ChunkerConfig) UnmarshalJSON(b []byte) error
type ChunkerProvider ¶
type ChunkerProvider string
ChunkerProvider The chunking provider to use.
const ( ChunkerProviderAntfly ChunkerProvider = "antfly" ChunkerProviderMock ChunkerProvider = "mock" ChunkerProviderTermite ChunkerProvider = "termite" )
Defines values for ChunkerProvider.
type ClarificationRequest ¶
type ClarificationRequest struct {
// Options Optional list of choices for the user
Options []string `json:"options,omitempty,omitzero"`
// Question The clarifying question to ask the user
Question string `json:"question"`
// Reason Why clarification is needed
Reason string `json:"reason,omitempty,omitzero"`
}
ClarificationRequest Request for clarification from the user
type ClassificationStepConfig ¶
type ClassificationStepConfig struct {
// Chain Chain of generators to try in order. Mutually exclusive with 'generator'.
Chain []ChainLink `json:"chain,omitempty,omitzero"`
// Enabled Enable query classification and strategy selection
Enabled bool `json:"enabled,omitempty,omitzero"`
// ForceSemanticMode Mode for semantic query generation:
// - rewrite: Transform query into expanded keywords/concepts optimized for vector search (Level 2 optimization)
// - hypothetical: Generate a hypothetical answer that would appear in relevant documents (HyDE - Level 3 optimization)
ForceSemanticMode SemanticQueryMode `json:"force_semantic_mode,omitempty,omitzero"`
// ForceStrategy Strategy for query transformation and retrieval:
// - simple: Direct query with multi-phrase expansion. Best for straightforward factual queries.
// - decompose: Break complex queries into sub-questions, retrieve for each. Best for multi-part questions.
// - step_back: Generate broader background query first, then specific query. Best for questions needing context.
// - hyde: Generate hypothetical answer document, embed that for retrieval. Best for abstract/conceptual questions.
ForceStrategy QueryStrategy `json:"force_strategy,omitempty,omitzero"`
// Generator A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Generator GeneratorConfig `json:"generator,omitempty,omitzero"`
// MultiPhraseCount Number of alternative query phrasings to generate
MultiPhraseCount int `json:"multi_phrase_count,omitempty,omitzero"`
// WithReasoning Include pre-retrieval reasoning explaining query analysis and strategy selection
WithReasoning bool `json:"with_reasoning,omitempty,omitzero"`
}
ClassificationStepConfig Configuration for the classification step. This step analyzes the query, selects the optimal retrieval strategy, and generates semantic transformations.
type ClassificationTransformationResult ¶
type ClassificationTransformationResult struct {
// Confidence Classification confidence (0.0 to 1.0)
Confidence float32 `json:"confidence"`
// ImprovedQuery Clarified query with added context for answer generation (human-readable)
ImprovedQuery string `json:"improved_query"`
// MultiPhrases Alternative phrasings of the query for expanded retrieval coverage
MultiPhrases []string `json:"multi_phrases,omitempty,omitzero"`
// Reasoning Pre-retrieval reasoning explaining query analysis and strategy selection (only present when with_classification_reasoning is enabled)
Reasoning string `json:"reasoning,omitempty,omitzero"`
// RouteType Classification of query type: question (specific factual query) or search (exploratory query)
RouteType RouteType `json:"route_type"`
// SemanticMode Mode for semantic query generation:
// - rewrite: Transform query into expanded keywords/concepts optimized for vector search (Level 2 optimization)
// - hypothetical: Generate a hypothetical answer that would appear in relevant documents (HyDE - Level 3 optimization)
SemanticMode SemanticQueryMode `json:"semantic_mode"`
// SemanticQuery Optimized query for vector/semantic search. Content style depends on semantic_mode: keywords for 'rewrite', hypothetical answer for 'hypothetical'
SemanticQuery string `json:"semantic_query"`
// StepBackQuery Broader background query for context (only present when strategy is 'step_back')
StepBackQuery string `json:"step_back_query,omitempty,omitzero"`
// Strategy Strategy for query transformation and retrieval:
// - simple: Direct query with multi-phrase expansion. Best for straightforward factual queries.
// - decompose: Break complex queries into sub-questions, retrieve for each. Best for multi-part questions.
// - step_back: Generate broader background query first, then specific query. Best for questions needing context.
// - hyde: Generate hypothetical answer document, embed that for retrieval. Best for abstract/conceptual questions.
Strategy QueryStrategy `json:"strategy"`
// SubQuestions Decomposed sub-questions (only present when strategy is 'decompose')
SubQuestions []string `json:"sub_questions,omitempty,omitzero"`
}
ClassificationTransformationResult Query classification and transformation result combining all query enhancements including strategy selection and semantic optimization
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) AddPermissionToUser ¶
func (c *Client) AddPermissionToUser(ctx context.Context, userName UserNamePathParameter, body AddPermissionToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) AddPermissionToUserWithBody ¶
func (*Client) AnswerAgent ¶
func (c *Client) AnswerAgent(ctx context.Context, body AnswerAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) AnswerAgentWithBody ¶
func (*Client) Backup ¶
func (c *Client) Backup(ctx context.Context, body BackupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) BackupTable ¶
func (c *Client) BackupTable(ctx context.Context, tableName string, body BackupTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) BackupTableWithBody ¶
func (*Client) BackupWithBody ¶
func (*Client) BatchWrite ¶
func (c *Client) BatchWrite(ctx context.Context, tableName string, body BatchWriteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) BatchWriteWithBody ¶
func (*Client) CommitTransaction ¶
func (c *Client) CommitTransaction(ctx context.Context, body CommitTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CommitTransactionWithBody ¶
func (*Client) CreateApiKey ¶
func (c *Client) CreateApiKey(ctx context.Context, userName UserNamePathParameter, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateApiKeyWithBody ¶
func (*Client) CreateIndex ¶
func (c *Client) CreateIndex(ctx context.Context, tableName string, indexName string, body CreateIndexJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateIndexWithBody ¶
func (*Client) CreateTable ¶
func (c *Client) CreateTable(ctx context.Context, tableName string, body CreateTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateTableWithBody ¶
func (*Client) CreateUser ¶
func (c *Client) CreateUser(ctx context.Context, userName UserNamePathParameter, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateUserWithBody ¶
func (*Client) DeleteApiKey ¶
func (c *Client) DeleteApiKey(ctx context.Context, userName UserNamePathParameter, keyId KeyIdPathParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) DeleteSecret ¶
func (*Client) DeleteUser ¶
func (c *Client) DeleteUser(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) Evaluate ¶
func (c *Client) Evaluate(ctx context.Context, body EvaluateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) EvaluateWithBody ¶
func (*Client) GetCurrentUser ¶
func (*Client) GetUserByName ¶
func (c *Client) GetUserByName(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetUserPermissions ¶
func (c *Client) GetUserPermissions(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GlobalQuery ¶
func (c *Client) GlobalQuery(ctx context.Context, body GlobalQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GlobalQueryWithBody ¶
func (*Client) LinearMerge ¶
func (c *Client) LinearMerge(ctx context.Context, tableName string, body LinearMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) LinearMergeWithBody ¶
func (*Client) ListApiKeys ¶
func (c *Client) ListApiKeys(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) ListBackups ¶
func (c *Client) ListBackups(ctx context.Context, params *ListBackupsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) ListIndexes ¶
func (*Client) ListSecrets ¶
func (*Client) ListTables ¶
func (c *Client) ListTables(ctx context.Context, params *ListTablesParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) LookupKey ¶
func (c *Client) LookupKey(ctx context.Context, tableName string, key string, params *LookupKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) MultiBatchWrite ¶
func (c *Client) MultiBatchWrite(ctx context.Context, body MultiBatchWriteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) MultiBatchWriteWithBody ¶
func (*Client) PutSecret ¶
func (c *Client) PutSecret(ctx context.Context, key string, body PutSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PutSecretWithBody ¶
func (*Client) QueryBuilderAgent ¶
func (c *Client) QueryBuilderAgent(ctx context.Context, body QueryBuilderAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) QueryBuilderAgentWithBody ¶
func (*Client) QueryTable ¶
func (c *Client) QueryTable(ctx context.Context, tableName string, body QueryTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) QueryTableWithBody ¶
func (*Client) RemovePermissionFromUser ¶
func (c *Client) RemovePermissionFromUser(ctx context.Context, userName UserNamePathParameter, params *RemovePermissionFromUserParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) Restore ¶
func (c *Client) Restore(ctx context.Context, body RestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) RestoreTable ¶
func (c *Client) RestoreTable(ctx context.Context, tableName string, body RestoreTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) RestoreTableWithBody ¶
func (*Client) RestoreWithBody ¶
func (*Client) RetrievalAgent ¶
func (c *Client) RetrievalAgent(ctx context.Context, body RetrievalAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) RetrievalAgentWithBody ¶
func (*Client) ScanKeys ¶
func (c *Client) ScanKeys(ctx context.Context, tableName string, body ScanKeysJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) ScanKeysWithBody ¶
func (*Client) UpdateSchema ¶
func (c *Client) UpdateSchema(ctx context.Context, tableName string, body UpdateSchemaJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) UpdateSchemaWithBody ¶
func (*Client) UpdateUserPassword ¶
func (c *Client) UpdateUserPassword(ctx context.Context, userName UserNamePathParameter, body UpdateUserPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) UpdateUserPasswordWithBody ¶
type ClientInterface ¶
type ClientInterface interface {
// AnswerAgentWithBody request with any body
AnswerAgentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
AnswerAgent(ctx context.Context, body AnswerAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// QueryBuilderAgentWithBody request with any body
QueryBuilderAgentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
QueryBuilderAgent(ctx context.Context, body QueryBuilderAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// RetrievalAgentWithBody request with any body
RetrievalAgentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
RetrievalAgent(ctx context.Context, body RetrievalAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// BackupWithBody request with any body
BackupWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
Backup(ctx context.Context, body BackupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListBackups request
ListBackups(ctx context.Context, params *ListBackupsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// MultiBatchWriteWithBody request with any body
MultiBatchWriteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
MultiBatchWrite(ctx context.Context, body MultiBatchWriteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// EvaluateWithBody request with any body
EvaluateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
Evaluate(ctx context.Context, body EvaluateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GlobalQueryWithBody request with any body
GlobalQueryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
GlobalQuery(ctx context.Context, body GlobalQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// RestoreWithBody request with any body
RestoreWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
Restore(ctx context.Context, body RestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListSecrets request
ListSecrets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteSecret request
DeleteSecret(ctx context.Context, key string, reqEditors ...RequestEditorFn) (*http.Response, error)
// PutSecretWithBody request with any body
PutSecretWithBody(ctx context.Context, key string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PutSecret(ctx context.Context, key string, body PutSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetStatus request
GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListTables request
ListTables(ctx context.Context, params *ListTablesParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// DropTable request
DropTable(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTable request
GetTable(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateTableWithBody request with any body
CreateTableWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateTable(ctx context.Context, tableName string, body CreateTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// BackupTableWithBody request with any body
BackupTableWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
BackupTable(ctx context.Context, tableName string, body BackupTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// BatchWriteWithBody request with any body
BatchWriteWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
BatchWrite(ctx context.Context, tableName string, body BatchWriteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListIndexes request
ListIndexes(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*http.Response, error)
// DropIndex request
DropIndex(ctx context.Context, tableName string, indexName string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetIndex request
GetIndex(ctx context.Context, tableName string, indexName string, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateIndexWithBody request with any body
CreateIndexWithBody(ctx context.Context, tableName string, indexName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateIndex(ctx context.Context, tableName string, indexName string, body CreateIndexJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ScanKeysWithBody request with any body
ScanKeysWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
ScanKeys(ctx context.Context, tableName string, body ScanKeysJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// LookupKey request
LookupKey(ctx context.Context, tableName string, key string, params *LookupKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// LinearMergeWithBody request with any body
LinearMergeWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
LinearMerge(ctx context.Context, tableName string, body LinearMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// QueryTableWithBody request with any body
QueryTableWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
QueryTable(ctx context.Context, tableName string, body QueryTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// RestoreTableWithBody request with any body
RestoreTableWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
RestoreTable(ctx context.Context, tableName string, body RestoreTableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateSchemaWithBody request with any body
UpdateSchemaWithBody(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
UpdateSchema(ctx context.Context, tableName string, body UpdateSchemaJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// CommitTransactionWithBody request with any body
CommitTransactionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CommitTransaction(ctx context.Context, body CommitTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListUsers request
ListUsers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetCurrentUser request
GetCurrentUser(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteUser request
DeleteUser(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUserByName request
GetUserByName(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateUserWithBody request with any body
CreateUserWithBody(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateUser(ctx context.Context, userName UserNamePathParameter, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListApiKeys request
ListApiKeys(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateApiKeyWithBody request with any body
CreateApiKeyWithBody(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateApiKey(ctx context.Context, userName UserNamePathParameter, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteApiKey request
DeleteApiKey(ctx context.Context, userName UserNamePathParameter, keyId KeyIdPathParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateUserPasswordWithBody request with any body
UpdateUserPasswordWithBody(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
UpdateUserPassword(ctx context.Context, userName UserNamePathParameter, body UpdateUserPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// RemovePermissionFromUser request
RemovePermissionFromUser(ctx context.Context, userName UserNamePathParameter, params *RemovePermissionFromUserParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUserPermissions request
GetUserPermissions(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
// AddPermissionToUserWithBody request with any body
AddPermissionToUserWithBody(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
AddPermissionToUser(ctx context.Context, userName UserNamePathParameter, body AddPermissionToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) AddPermissionToUserWithBodyWithResponse ¶
func (c *ClientWithResponses) AddPermissionToUserWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddPermissionToUserResponse, error)
AddPermissionToUserWithBodyWithResponse request with arbitrary body returning *AddPermissionToUserResponse
func (*ClientWithResponses) AddPermissionToUserWithResponse ¶
func (c *ClientWithResponses) AddPermissionToUserWithResponse(ctx context.Context, userName UserNamePathParameter, body AddPermissionToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*AddPermissionToUserResponse, error)
func (*ClientWithResponses) AnswerAgentWithBodyWithResponse ¶
func (c *ClientWithResponses) AnswerAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AnswerAgentResponse, error)
AnswerAgentWithBodyWithResponse request with arbitrary body returning *AnswerAgentResponse
func (*ClientWithResponses) AnswerAgentWithResponse ¶
func (c *ClientWithResponses) AnswerAgentWithResponse(ctx context.Context, body AnswerAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*AnswerAgentResponse, error)
func (*ClientWithResponses) BackupTableWithBodyWithResponse ¶
func (c *ClientWithResponses) BackupTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*BackupTableResponse, error)
BackupTableWithBodyWithResponse request with arbitrary body returning *BackupTableResponse
func (*ClientWithResponses) BackupTableWithResponse ¶
func (c *ClientWithResponses) BackupTableWithResponse(ctx context.Context, tableName string, body BackupTableJSONRequestBody, reqEditors ...RequestEditorFn) (*BackupTableResponse, error)
func (*ClientWithResponses) BackupWithBodyWithResponse ¶
func (c *ClientWithResponses) BackupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*BackupResponse, error)
BackupWithBodyWithResponse request with arbitrary body returning *BackupResponse
func (*ClientWithResponses) BackupWithResponse ¶
func (c *ClientWithResponses) BackupWithResponse(ctx context.Context, body BackupJSONRequestBody, reqEditors ...RequestEditorFn) (*BackupResponse, error)
func (*ClientWithResponses) BatchWriteWithBodyWithResponse ¶
func (c *ClientWithResponses) BatchWriteWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*BatchWriteResponse, error)
BatchWriteWithBodyWithResponse request with arbitrary body returning *BatchWriteResponse
func (*ClientWithResponses) BatchWriteWithResponse ¶
func (c *ClientWithResponses) BatchWriteWithResponse(ctx context.Context, tableName string, body BatchWriteJSONRequestBody, reqEditors ...RequestEditorFn) (*BatchWriteResponse, error)
func (*ClientWithResponses) CommitTransactionWithBodyWithResponse ¶
func (c *ClientWithResponses) CommitTransactionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CommitTransactionResponse, error)
CommitTransactionWithBodyWithResponse request with arbitrary body returning *CommitTransactionResponse
func (*ClientWithResponses) CommitTransactionWithResponse ¶
func (c *ClientWithResponses) CommitTransactionWithResponse(ctx context.Context, body CommitTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*CommitTransactionResponse, error)
func (*ClientWithResponses) CreateApiKeyWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateApiKeyWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error)
CreateApiKeyWithBodyWithResponse request with arbitrary body returning *CreateApiKeyResponse
func (*ClientWithResponses) CreateApiKeyWithResponse ¶
func (c *ClientWithResponses) CreateApiKeyWithResponse(ctx context.Context, userName UserNamePathParameter, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error)
func (*ClientWithResponses) CreateIndexWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateIndexWithBodyWithResponse(ctx context.Context, tableName string, indexName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateIndexResponse, error)
CreateIndexWithBodyWithResponse request with arbitrary body returning *CreateIndexResponse
func (*ClientWithResponses) CreateIndexWithResponse ¶
func (c *ClientWithResponses) CreateIndexWithResponse(ctx context.Context, tableName string, indexName string, body CreateIndexJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateIndexResponse, error)
func (*ClientWithResponses) CreateTableWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTableResponse, error)
CreateTableWithBodyWithResponse request with arbitrary body returning *CreateTableResponse
func (*ClientWithResponses) CreateTableWithResponse ¶
func (c *ClientWithResponses) CreateTableWithResponse(ctx context.Context, tableName string, body CreateTableJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTableResponse, error)
func (*ClientWithResponses) CreateUserWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateUserWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)
CreateUserWithBodyWithResponse request with arbitrary body returning *CreateUserResponse
func (*ClientWithResponses) CreateUserWithResponse ¶
func (c *ClientWithResponses) CreateUserWithResponse(ctx context.Context, userName UserNamePathParameter, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)
func (*ClientWithResponses) DeleteApiKeyWithResponse ¶
func (c *ClientWithResponses) DeleteApiKeyWithResponse(ctx context.Context, userName UserNamePathParameter, keyId KeyIdPathParameter, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error)
DeleteApiKeyWithResponse request returning *DeleteApiKeyResponse
func (*ClientWithResponses) DeleteSecretWithResponse ¶
func (c *ClientWithResponses) DeleteSecretWithResponse(ctx context.Context, key string, reqEditors ...RequestEditorFn) (*DeleteSecretResponse, error)
DeleteSecretWithResponse request returning *DeleteSecretResponse
func (*ClientWithResponses) DeleteUserWithResponse ¶
func (c *ClientWithResponses) DeleteUserWithResponse(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*DeleteUserResponse, error)
DeleteUserWithResponse request returning *DeleteUserResponse
func (*ClientWithResponses) DropIndexWithResponse ¶
func (c *ClientWithResponses) DropIndexWithResponse(ctx context.Context, tableName string, indexName string, reqEditors ...RequestEditorFn) (*DropIndexResponse, error)
DropIndexWithResponse request returning *DropIndexResponse
func (*ClientWithResponses) DropTableWithResponse ¶
func (c *ClientWithResponses) DropTableWithResponse(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*DropTableResponse, error)
DropTableWithResponse request returning *DropTableResponse
func (*ClientWithResponses) EvaluateWithBodyWithResponse ¶
func (c *ClientWithResponses) EvaluateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EvaluateResponse, error)
EvaluateWithBodyWithResponse request with arbitrary body returning *EvaluateResponse
func (*ClientWithResponses) EvaluateWithResponse ¶
func (c *ClientWithResponses) EvaluateWithResponse(ctx context.Context, body EvaluateJSONRequestBody, reqEditors ...RequestEditorFn) (*EvaluateResponse, error)
func (*ClientWithResponses) GetCurrentUserWithResponse ¶
func (c *ClientWithResponses) GetCurrentUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCurrentUserResponse, error)
GetCurrentUserWithResponse request returning *GetCurrentUserResponse
func (*ClientWithResponses) GetIndexWithResponse ¶
func (c *ClientWithResponses) GetIndexWithResponse(ctx context.Context, tableName string, indexName string, reqEditors ...RequestEditorFn) (*GetIndexResponse, error)
GetIndexWithResponse request returning *GetIndexResponse
func (*ClientWithResponses) GetStatusWithResponse ¶
func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
GetStatusWithResponse request returning *GetStatusResponse
func (*ClientWithResponses) GetTableWithResponse ¶
func (c *ClientWithResponses) GetTableWithResponse(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*GetTableResponse, error)
GetTableWithResponse request returning *GetTableResponse
func (*ClientWithResponses) GetUserByNameWithResponse ¶
func (c *ClientWithResponses) GetUserByNameWithResponse(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*GetUserByNameResponse, error)
GetUserByNameWithResponse request returning *GetUserByNameResponse
func (*ClientWithResponses) GetUserPermissionsWithResponse ¶
func (c *ClientWithResponses) GetUserPermissionsWithResponse(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*GetUserPermissionsResponse, error)
GetUserPermissionsWithResponse request returning *GetUserPermissionsResponse
func (*ClientWithResponses) GlobalQueryWithBodyWithResponse ¶
func (c *ClientWithResponses) GlobalQueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GlobalQueryResponse, error)
GlobalQueryWithBodyWithResponse request with arbitrary body returning *GlobalQueryResponse
func (*ClientWithResponses) GlobalQueryWithResponse ¶
func (c *ClientWithResponses) GlobalQueryWithResponse(ctx context.Context, body GlobalQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*GlobalQueryResponse, error)
func (*ClientWithResponses) LinearMergeWithBodyWithResponse ¶
func (c *ClientWithResponses) LinearMergeWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LinearMergeResponse, error)
LinearMergeWithBodyWithResponse request with arbitrary body returning *LinearMergeResponse
func (*ClientWithResponses) LinearMergeWithResponse ¶
func (c *ClientWithResponses) LinearMergeWithResponse(ctx context.Context, tableName string, body LinearMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*LinearMergeResponse, error)
func (*ClientWithResponses) ListApiKeysWithResponse ¶
func (c *ClientWithResponses) ListApiKeysWithResponse(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*ListApiKeysResponse, error)
ListApiKeysWithResponse request returning *ListApiKeysResponse
func (*ClientWithResponses) ListBackupsWithResponse ¶
func (c *ClientWithResponses) ListBackupsWithResponse(ctx context.Context, params *ListBackupsParams, reqEditors ...RequestEditorFn) (*ListBackupsResponse, error)
ListBackupsWithResponse request returning *ListBackupsResponse
func (*ClientWithResponses) ListIndexesWithResponse ¶
func (c *ClientWithResponses) ListIndexesWithResponse(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*ListIndexesResponse, error)
ListIndexesWithResponse request returning *ListIndexesResponse
func (*ClientWithResponses) ListSecretsWithResponse ¶
func (c *ClientWithResponses) ListSecretsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListSecretsResponse, error)
ListSecretsWithResponse request returning *ListSecretsResponse
func (*ClientWithResponses) ListTablesWithResponse ¶
func (c *ClientWithResponses) ListTablesWithResponse(ctx context.Context, params *ListTablesParams, reqEditors ...RequestEditorFn) (*ListTablesResponse, error)
ListTablesWithResponse request returning *ListTablesResponse
func (*ClientWithResponses) ListUsersWithResponse ¶
func (c *ClientWithResponses) ListUsersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListUsersResponse, error)
ListUsersWithResponse request returning *ListUsersResponse
func (*ClientWithResponses) LookupKeyWithResponse ¶
func (c *ClientWithResponses) LookupKeyWithResponse(ctx context.Context, tableName string, key string, params *LookupKeyParams, reqEditors ...RequestEditorFn) (*LookupKeyResponse, error)
LookupKeyWithResponse request returning *LookupKeyResponse
func (*ClientWithResponses) MultiBatchWriteWithBodyWithResponse ¶
func (c *ClientWithResponses) MultiBatchWriteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MultiBatchWriteResponse, error)
MultiBatchWriteWithBodyWithResponse request with arbitrary body returning *MultiBatchWriteResponse
func (*ClientWithResponses) MultiBatchWriteWithResponse ¶
func (c *ClientWithResponses) MultiBatchWriteWithResponse(ctx context.Context, body MultiBatchWriteJSONRequestBody, reqEditors ...RequestEditorFn) (*MultiBatchWriteResponse, error)
func (*ClientWithResponses) PutSecretWithBodyWithResponse ¶
func (c *ClientWithResponses) PutSecretWithBodyWithResponse(ctx context.Context, key string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutSecretResponse, error)
PutSecretWithBodyWithResponse request with arbitrary body returning *PutSecretResponse
func (*ClientWithResponses) PutSecretWithResponse ¶
func (c *ClientWithResponses) PutSecretWithResponse(ctx context.Context, key string, body PutSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*PutSecretResponse, error)
func (*ClientWithResponses) QueryBuilderAgentWithBodyWithResponse ¶
func (c *ClientWithResponses) QueryBuilderAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueryBuilderAgentResponse, error)
QueryBuilderAgentWithBodyWithResponse request with arbitrary body returning *QueryBuilderAgentResponse
func (*ClientWithResponses) QueryBuilderAgentWithResponse ¶
func (c *ClientWithResponses) QueryBuilderAgentWithResponse(ctx context.Context, body QueryBuilderAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*QueryBuilderAgentResponse, error)
func (*ClientWithResponses) QueryTableWithBodyWithResponse ¶
func (c *ClientWithResponses) QueryTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueryTableResponse, error)
QueryTableWithBodyWithResponse request with arbitrary body returning *QueryTableResponse
func (*ClientWithResponses) QueryTableWithResponse ¶
func (c *ClientWithResponses) QueryTableWithResponse(ctx context.Context, tableName string, body QueryTableJSONRequestBody, reqEditors ...RequestEditorFn) (*QueryTableResponse, error)
func (*ClientWithResponses) RemovePermissionFromUserWithResponse ¶
func (c *ClientWithResponses) RemovePermissionFromUserWithResponse(ctx context.Context, userName UserNamePathParameter, params *RemovePermissionFromUserParams, reqEditors ...RequestEditorFn) (*RemovePermissionFromUserResponse, error)
RemovePermissionFromUserWithResponse request returning *RemovePermissionFromUserResponse
func (*ClientWithResponses) RestoreTableWithBodyWithResponse ¶
func (c *ClientWithResponses) RestoreTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RestoreTableResponse, error)
RestoreTableWithBodyWithResponse request with arbitrary body returning *RestoreTableResponse
func (*ClientWithResponses) RestoreTableWithResponse ¶
func (c *ClientWithResponses) RestoreTableWithResponse(ctx context.Context, tableName string, body RestoreTableJSONRequestBody, reqEditors ...RequestEditorFn) (*RestoreTableResponse, error)
func (*ClientWithResponses) RestoreWithBodyWithResponse ¶
func (c *ClientWithResponses) RestoreWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RestoreResponse, error)
RestoreWithBodyWithResponse request with arbitrary body returning *RestoreResponse
func (*ClientWithResponses) RestoreWithResponse ¶
func (c *ClientWithResponses) RestoreWithResponse(ctx context.Context, body RestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*RestoreResponse, error)
func (*ClientWithResponses) RetrievalAgentWithBodyWithResponse ¶
func (c *ClientWithResponses) RetrievalAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RetrievalAgentResponse, error)
RetrievalAgentWithBodyWithResponse request with arbitrary body returning *RetrievalAgentResponse
func (*ClientWithResponses) RetrievalAgentWithResponse ¶
func (c *ClientWithResponses) RetrievalAgentWithResponse(ctx context.Context, body RetrievalAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*RetrievalAgentResponse, error)
func (*ClientWithResponses) ScanKeysWithBodyWithResponse ¶
func (c *ClientWithResponses) ScanKeysWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ScanKeysResponse, error)
ScanKeysWithBodyWithResponse request with arbitrary body returning *ScanKeysResponse
func (*ClientWithResponses) ScanKeysWithResponse ¶
func (c *ClientWithResponses) ScanKeysWithResponse(ctx context.Context, tableName string, body ScanKeysJSONRequestBody, reqEditors ...RequestEditorFn) (*ScanKeysResponse, error)
func (*ClientWithResponses) UpdateSchemaWithBodyWithResponse ¶
func (c *ClientWithResponses) UpdateSchemaWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSchemaResponse, error)
UpdateSchemaWithBodyWithResponse request with arbitrary body returning *UpdateSchemaResponse
func (*ClientWithResponses) UpdateSchemaWithResponse ¶
func (c *ClientWithResponses) UpdateSchemaWithResponse(ctx context.Context, tableName string, body UpdateSchemaJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSchemaResponse, error)
func (*ClientWithResponses) UpdateUserPasswordWithBodyWithResponse ¶
func (c *ClientWithResponses) UpdateUserPasswordWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUserPasswordResponse, error)
UpdateUserPasswordWithBodyWithResponse request with arbitrary body returning *UpdateUserPasswordResponse
func (*ClientWithResponses) UpdateUserPasswordWithResponse ¶
func (c *ClientWithResponses) UpdateUserPasswordWithResponse(ctx context.Context, userName UserNamePathParameter, body UpdateUserPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUserPasswordResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// AnswerAgentWithBodyWithResponse request with any body
AnswerAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AnswerAgentResponse, error)
AnswerAgentWithResponse(ctx context.Context, body AnswerAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*AnswerAgentResponse, error)
// QueryBuilderAgentWithBodyWithResponse request with any body
QueryBuilderAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueryBuilderAgentResponse, error)
QueryBuilderAgentWithResponse(ctx context.Context, body QueryBuilderAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*QueryBuilderAgentResponse, error)
// RetrievalAgentWithBodyWithResponse request with any body
RetrievalAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RetrievalAgentResponse, error)
RetrievalAgentWithResponse(ctx context.Context, body RetrievalAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*RetrievalAgentResponse, error)
// BackupWithBodyWithResponse request with any body
BackupWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*BackupResponse, error)
BackupWithResponse(ctx context.Context, body BackupJSONRequestBody, reqEditors ...RequestEditorFn) (*BackupResponse, error)
// ListBackupsWithResponse request
ListBackupsWithResponse(ctx context.Context, params *ListBackupsParams, reqEditors ...RequestEditorFn) (*ListBackupsResponse, error)
// MultiBatchWriteWithBodyWithResponse request with any body
MultiBatchWriteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MultiBatchWriteResponse, error)
MultiBatchWriteWithResponse(ctx context.Context, body MultiBatchWriteJSONRequestBody, reqEditors ...RequestEditorFn) (*MultiBatchWriteResponse, error)
// EvaluateWithBodyWithResponse request with any body
EvaluateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EvaluateResponse, error)
EvaluateWithResponse(ctx context.Context, body EvaluateJSONRequestBody, reqEditors ...RequestEditorFn) (*EvaluateResponse, error)
// GlobalQueryWithBodyWithResponse request with any body
GlobalQueryWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GlobalQueryResponse, error)
GlobalQueryWithResponse(ctx context.Context, body GlobalQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*GlobalQueryResponse, error)
// RestoreWithBodyWithResponse request with any body
RestoreWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RestoreResponse, error)
RestoreWithResponse(ctx context.Context, body RestoreJSONRequestBody, reqEditors ...RequestEditorFn) (*RestoreResponse, error)
// ListSecretsWithResponse request
ListSecretsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListSecretsResponse, error)
// DeleteSecretWithResponse request
DeleteSecretWithResponse(ctx context.Context, key string, reqEditors ...RequestEditorFn) (*DeleteSecretResponse, error)
// PutSecretWithBodyWithResponse request with any body
PutSecretWithBodyWithResponse(ctx context.Context, key string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutSecretResponse, error)
PutSecretWithResponse(ctx context.Context, key string, body PutSecretJSONRequestBody, reqEditors ...RequestEditorFn) (*PutSecretResponse, error)
// GetStatusWithResponse request
GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
// ListTablesWithResponse request
ListTablesWithResponse(ctx context.Context, params *ListTablesParams, reqEditors ...RequestEditorFn) (*ListTablesResponse, error)
// DropTableWithResponse request
DropTableWithResponse(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*DropTableResponse, error)
// GetTableWithResponse request
GetTableWithResponse(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*GetTableResponse, error)
// CreateTableWithBodyWithResponse request with any body
CreateTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTableResponse, error)
CreateTableWithResponse(ctx context.Context, tableName string, body CreateTableJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTableResponse, error)
// BackupTableWithBodyWithResponse request with any body
BackupTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*BackupTableResponse, error)
BackupTableWithResponse(ctx context.Context, tableName string, body BackupTableJSONRequestBody, reqEditors ...RequestEditorFn) (*BackupTableResponse, error)
// BatchWriteWithBodyWithResponse request with any body
BatchWriteWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*BatchWriteResponse, error)
BatchWriteWithResponse(ctx context.Context, tableName string, body BatchWriteJSONRequestBody, reqEditors ...RequestEditorFn) (*BatchWriteResponse, error)
// ListIndexesWithResponse request
ListIndexesWithResponse(ctx context.Context, tableName string, reqEditors ...RequestEditorFn) (*ListIndexesResponse, error)
// DropIndexWithResponse request
DropIndexWithResponse(ctx context.Context, tableName string, indexName string, reqEditors ...RequestEditorFn) (*DropIndexResponse, error)
// GetIndexWithResponse request
GetIndexWithResponse(ctx context.Context, tableName string, indexName string, reqEditors ...RequestEditorFn) (*GetIndexResponse, error)
// CreateIndexWithBodyWithResponse request with any body
CreateIndexWithBodyWithResponse(ctx context.Context, tableName string, indexName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateIndexResponse, error)
CreateIndexWithResponse(ctx context.Context, tableName string, indexName string, body CreateIndexJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateIndexResponse, error)
// ScanKeysWithBodyWithResponse request with any body
ScanKeysWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ScanKeysResponse, error)
ScanKeysWithResponse(ctx context.Context, tableName string, body ScanKeysJSONRequestBody, reqEditors ...RequestEditorFn) (*ScanKeysResponse, error)
// LookupKeyWithResponse request
LookupKeyWithResponse(ctx context.Context, tableName string, key string, params *LookupKeyParams, reqEditors ...RequestEditorFn) (*LookupKeyResponse, error)
// LinearMergeWithBodyWithResponse request with any body
LinearMergeWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*LinearMergeResponse, error)
LinearMergeWithResponse(ctx context.Context, tableName string, body LinearMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*LinearMergeResponse, error)
// QueryTableWithBodyWithResponse request with any body
QueryTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueryTableResponse, error)
QueryTableWithResponse(ctx context.Context, tableName string, body QueryTableJSONRequestBody, reqEditors ...RequestEditorFn) (*QueryTableResponse, error)
// RestoreTableWithBodyWithResponse request with any body
RestoreTableWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RestoreTableResponse, error)
RestoreTableWithResponse(ctx context.Context, tableName string, body RestoreTableJSONRequestBody, reqEditors ...RequestEditorFn) (*RestoreTableResponse, error)
// UpdateSchemaWithBodyWithResponse request with any body
UpdateSchemaWithBodyWithResponse(ctx context.Context, tableName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSchemaResponse, error)
UpdateSchemaWithResponse(ctx context.Context, tableName string, body UpdateSchemaJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSchemaResponse, error)
// CommitTransactionWithBodyWithResponse request with any body
CommitTransactionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CommitTransactionResponse, error)
CommitTransactionWithResponse(ctx context.Context, body CommitTransactionJSONRequestBody, reqEditors ...RequestEditorFn) (*CommitTransactionResponse, error)
// ListUsersWithResponse request
ListUsersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListUsersResponse, error)
// GetCurrentUserWithResponse request
GetCurrentUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCurrentUserResponse, error)
// DeleteUserWithResponse request
DeleteUserWithResponse(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*DeleteUserResponse, error)
// GetUserByNameWithResponse request
GetUserByNameWithResponse(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*GetUserByNameResponse, error)
// CreateUserWithBodyWithResponse request with any body
CreateUserWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)
CreateUserWithResponse(ctx context.Context, userName UserNamePathParameter, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)
// ListApiKeysWithResponse request
ListApiKeysWithResponse(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*ListApiKeysResponse, error)
// CreateApiKeyWithBodyWithResponse request with any body
CreateApiKeyWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error)
CreateApiKeyWithResponse(ctx context.Context, userName UserNamePathParameter, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error)
// DeleteApiKeyWithResponse request
DeleteApiKeyWithResponse(ctx context.Context, userName UserNamePathParameter, keyId KeyIdPathParameter, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error)
// UpdateUserPasswordWithBodyWithResponse request with any body
UpdateUserPasswordWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUserPasswordResponse, error)
UpdateUserPasswordWithResponse(ctx context.Context, userName UserNamePathParameter, body UpdateUserPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUserPasswordResponse, error)
// RemovePermissionFromUserWithResponse request
RemovePermissionFromUserWithResponse(ctx context.Context, userName UserNamePathParameter, params *RemovePermissionFromUserParams, reqEditors ...RequestEditorFn) (*RemovePermissionFromUserResponse, error)
// GetUserPermissionsWithResponse request
GetUserPermissionsWithResponse(ctx context.Context, userName UserNamePathParameter, reqEditors ...RequestEditorFn) (*GetUserPermissionsResponse, error)
// AddPermissionToUserWithBodyWithResponse request with any body
AddPermissionToUserWithBodyWithResponse(ctx context.Context, userName UserNamePathParameter, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddPermissionToUserResponse, error)
AddPermissionToUserWithResponse(ctx context.Context, userName UserNamePathParameter, body AddPermissionToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*AddPermissionToUserResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type ClusterBackupRequest ¶
type ClusterBackupRequest struct {
// BackupId Unique identifier for this backup. Used to reference the backup for restore operations.
// Choose a meaningful name that includes date/version information.
BackupId string `json:"backup_id"`
// Location Storage location for the backup. Supports multiple backends:
// - Local filesystem: `file:///path/to/backup`
// - Amazon S3: `s3://bucket-name/path/to/backup`
//
// The backup includes all table data, indexes, and metadata.
Location string `json:"location"`
// TableNames Optional list of tables to backup. If omitted, all tables are backed up.
TableNames []string `json:"table_names,omitempty,omitzero"`
}
ClusterBackupRequest defines model for ClusterBackupRequest.
type ClusterBackupResponse ¶
type ClusterBackupResponse struct {
// BackupId The backup identifier
BackupId string `json:"backup_id"`
// Status Overall backup status
Status ClusterBackupResponseStatus `json:"status"`
// Tables Status of each table backup
Tables []TableBackupStatus `json:"tables"`
}
ClusterBackupResponse defines model for ClusterBackupResponse.
type ClusterBackupResponseStatus ¶
type ClusterBackupResponseStatus string
ClusterBackupResponseStatus Overall backup status
const ( ClusterBackupResponseStatusCompleted ClusterBackupResponseStatus = "completed" ClusterBackupResponseStatusFailed ClusterBackupResponseStatus = "failed" ClusterBackupResponseStatusPartial ClusterBackupResponseStatus = "partial" )
Defines values for ClusterBackupResponseStatus.
type ClusterHealth ¶
type ClusterHealth string
ClusterHealth Overall health status of the cluster
const ( ClusterHealthDegraded ClusterHealth = "degraded" ClusterHealthError ClusterHealth = "error" ClusterHealthHealthy ClusterHealth = "healthy" ClusterHealthUnhealthy ClusterHealth = "unhealthy" ClusterHealthUnknown ClusterHealth = "unknown" )
Defines values for ClusterHealth.
type ClusterRestoreRequest ¶
type ClusterRestoreRequest struct {
// BackupId Unique identifier of the backup to restore from.
BackupId string `json:"backup_id"`
// Location Storage location where the backup is stored.
Location string `json:"location"`
// RestoreMode How to handle existing tables:
// - `fail_if_exists`: Abort if any table already exists (default)
// - `skip_if_exists`: Skip existing tables, restore others
// - `overwrite`: Drop and recreate existing tables
RestoreMode ClusterRestoreRequestRestoreMode `json:"restore_mode,omitempty,omitzero"`
// TableNames Optional list of tables to restore. If omitted, all tables in the backup are restored.
TableNames []string `json:"table_names,omitempty,omitzero"`
}
ClusterRestoreRequest defines model for ClusterRestoreRequest.
type ClusterRestoreRequestRestoreMode ¶
type ClusterRestoreRequestRestoreMode string
ClusterRestoreRequestRestoreMode How to handle existing tables: - `fail_if_exists`: Abort if any table already exists (default) - `skip_if_exists`: Skip existing tables, restore others - `overwrite`: Drop and recreate existing tables
const ( ClusterRestoreRequestRestoreModeFailIfExists ClusterRestoreRequestRestoreMode = "fail_if_exists" ClusterRestoreRequestRestoreModeOverwrite ClusterRestoreRequestRestoreMode = "overwrite" ClusterRestoreRequestRestoreModeSkipIfExists ClusterRestoreRequestRestoreMode = "skip_if_exists" )
Defines values for ClusterRestoreRequestRestoreMode.
type ClusterRestoreResponse ¶
type ClusterRestoreResponse struct {
// Status Overall restore status
Status ClusterRestoreResponseStatus `json:"status"`
// Tables Status of each table restore
Tables []TableRestoreStatus `json:"tables"`
}
ClusterRestoreResponse defines model for ClusterRestoreResponse.
type ClusterRestoreResponseStatus ¶
type ClusterRestoreResponseStatus string
ClusterRestoreResponseStatus Overall restore status
const ( ClusterRestoreResponseStatusFailed ClusterRestoreResponseStatus = "failed" ClusterRestoreResponseStatusPartial ClusterRestoreResponseStatus = "partial" ClusterRestoreResponseStatusTriggered ClusterRestoreResponseStatus = "triggered" )
Defines values for ClusterRestoreResponseStatus.
type ClusterStatus ¶
type ClusterStatus struct {
// AuthEnabled Indicates whether authentication is enabled for the cluster
AuthEnabled bool `json:"auth_enabled,omitempty"`
// Health Overall health status of the cluster
Health ClusterHealth `json:"health"`
// Message Optional message providing details about the health status
Message string `json:"message,omitempty,omitzero"`
// SwarmMode Indicates whether the cluster is running in single-node swarm mode
SwarmMode bool `json:"swarm_mode,omitempty"`
AdditionalProperties map[string]interface{} `json:"-"`
}
ClusterStatus defines model for ClusterStatus.
func (ClusterStatus) Get ¶
func (a ClusterStatus) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for ClusterStatus. Returns the specified element and whether it was found
func (ClusterStatus) MarshalJSON ¶
func (a ClusterStatus) MarshalJSON() ([]byte, error)
Override default JSON handling for ClusterStatus to handle AdditionalProperties
func (*ClusterStatus) Set ¶
func (a *ClusterStatus) Set(fieldName string, value interface{})
Setter for additional properties for ClusterStatus
func (*ClusterStatus) UnmarshalJSON ¶
func (a *ClusterStatus) UnmarshalJSON(b []byte) error
Override default JSON handling for ClusterStatus to handle AdditionalProperties
type CohereEmbedderConfig ¶
type CohereEmbedderConfig struct {
// ApiKey The Cohere API key. Can also be set via COHERE_API_KEY environment variable.
ApiKey string `json:"api_key,omitempty,omitzero"`
// InputType Specifies the type of input for optimized embeddings.
InputType CohereEmbedderConfigInputType `json:"input_type,omitempty,omitzero"`
// Model The name of the Cohere embedding model to use.
Model string `json:"model"`
// Truncate How to handle inputs longer than the max token length.
Truncate CohereEmbedderConfigTruncate `json:"truncate,omitempty,omitzero"`
}
CohereEmbedderConfig Configuration for the Cohere embedding provider.
API key via `api_key` field or `COHERE_API_KEY` environment variable.
**Example Models:** embed-english-v3.0 (default, 1024 dims), embed-multilingual-v3.0
**Docs:** https://docs.cohere.com/reference/embed
type CohereEmbedderConfigInputType ¶
type CohereEmbedderConfigInputType string
CohereEmbedderConfigInputType Specifies the type of input for optimized embeddings.
const ( CohereEmbedderConfigInputTypeClassification CohereEmbedderConfigInputType = "classification" CohereEmbedderConfigInputTypeClustering CohereEmbedderConfigInputType = "clustering" CohereEmbedderConfigInputTypeSearchDocument CohereEmbedderConfigInputType = "search_document" CohereEmbedderConfigInputTypeSearchQuery CohereEmbedderConfigInputType = "search_query" )
Defines values for CohereEmbedderConfigInputType.
type CohereEmbedderConfigTruncate ¶
type CohereEmbedderConfigTruncate string
CohereEmbedderConfigTruncate How to handle inputs longer than the max token length.
const ( CohereEmbedderConfigTruncateEND CohereEmbedderConfigTruncate = "END" CohereEmbedderConfigTruncateNONE CohereEmbedderConfigTruncate = "NONE" CohereEmbedderConfigTruncateSTART CohereEmbedderConfigTruncate = "START" )
Defines values for CohereEmbedderConfigTruncate.
type CohereGeneratorConfig ¶
type CohereGeneratorConfig struct {
// ApiKey The Cohere API key. If not provided, falls back to COHERE_API_KEY environment variable.
ApiKey string `json:"api_key,omitempty,omitzero"`
// FrequencyPenalty Penalty for token frequency (0.0-1.0).
FrequencyPenalty float32 `json:"frequency_penalty,omitempty,omitzero"`
// MaxTokens Maximum number of tokens to generate in the response.
MaxTokens int `json:"max_tokens,omitempty,omitzero"`
// Model The name of the Cohere model to use.
Model string `json:"model"`
// PresencePenalty Penalty for token presence (0.0-1.0).
PresencePenalty float32 `json:"presence_penalty,omitempty,omitzero"`
// Temperature Controls randomness in generation (0.0-1.0). Higher values make output more random.
Temperature float32 `json:"temperature,omitempty,omitzero"`
// TopK Top-k sampling parameter. Only sample from the top K options for each subsequent token.
TopK int `json:"top_k,omitempty,omitzero"`
// TopP Nucleus sampling parameter (0.0-1.0). Alternative to temperature.
TopP float32 `json:"top_p,omitempty,omitzero"`
}
CohereGeneratorConfig Configuration for the Cohere generative AI provider (Command models).
API key via `api_key` field or `COHERE_API_KEY` environment variable.
**Example Models:** command-r-plus (default), command-r, command-a-03-2025
**Docs:** https://docs.cohere.com/reference/chat
type CohereRerankerConfig ¶
type CohereRerankerConfig struct {
// ApiKey The Cohere API key. Can also be set via COHERE_API_KEY environment variable.
ApiKey string `json:"api_key,omitempty,omitzero"`
// MaxChunksPerDoc Maximum number of chunks per document for long document handling.
MaxChunksPerDoc int `json:"max_chunks_per_doc,omitempty,omitzero"`
// Model The name of the Cohere reranking model to use.
Model string `json:"model"`
// TopN Number of most relevant documents to return. If not specified, returns all documents with scores.
TopN int `json:"top_n,omitempty,omitzero"`
}
CohereRerankerConfig Configuration for the Cohere reranking provider.
API key via `api_key` field or `COHERE_API_KEY` environment variable.
**Example Models:** rerank-english-v3.0 (default), rerank-multilingual-v3.0
**Docs:** https://docs.cohere.com/reference/rerank
type CommitTransactionJSONRequestBody ¶
type CommitTransactionJSONRequestBody = TransactionCommitRequest
CommitTransactionJSONRequestBody defines body for CommitTransaction for application/json ContentType.
type CommitTransactionResponse ¶
type CommitTransactionResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TransactionCommitResponse
JSON400 *BadRequest
JSON404 *NotFound
JSON409 *TransactionCommitResponse
JSON500 *InternalServerError
}
func ParseCommitTransactionResponse ¶
func ParseCommitTransactionResponse(rsp *http.Response) (*CommitTransactionResponse, error)
ParseCommitTransactionResponse parses an HTTP response from a CommitTransactionWithResponse call
func (CommitTransactionResponse) Status ¶
func (r CommitTransactionResponse) Status() string
Status returns HTTPResponse.Status
func (CommitTransactionResponse) StatusCode ¶
func (r CommitTransactionResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ConfidenceStepConfig ¶
type ConfidenceStepConfig struct {
// Chain Chain of generators to try in order. Mutually exclusive with 'generator'.
Chain []ChainLink `json:"chain,omitempty,omitzero"`
// Context Custom guidance for confidence assessment approach
Context string `json:"context,omitempty,omitzero"`
// Enabled Enable confidence scoring
Enabled bool `json:"enabled,omitempty,omitzero"`
// Generator A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Generator GeneratorConfig `json:"generator,omitempty,omitzero"`
}
ConfidenceStepConfig Configuration for confidence assessment. Evaluates answer quality and resource relevance. Can use a model calibrated for scoring tasks.
type ConjunctionQuery ¶
type ConjunctionQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Conjuncts []Query `json:"conjuncts"`
}
ConjunctionQuery defines model for ConjunctionQuery.
type CreateApiKeyJSONRequestBody ¶
type CreateApiKeyJSONRequestBody = CreateApiKeyRequest
CreateApiKeyJSONRequestBody defines body for CreateApiKey for application/json ContentType.
type CreateApiKeyRequest ¶
type CreateApiKeyRequest struct {
// ExpiresIn Duration until expiration (e.g., '720h' for 30 days). Empty means never.
ExpiresIn string `json:"expires_in,omitempty,omitzero"`
// Name Human-readable name for the API key.
Name string `json:"name"`
// Permissions Optional permission scoping. Each permission must be a subset of the creator's permissions.
Permissions []Permission `json:"permissions,omitzero"`
}
CreateApiKeyRequest Request to create a new API key.
type CreateApiKeyResponse ¶
type CreateApiKeyResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *ApiKeyWithSecret
JSON400 *Error
JSON403 *Error
JSON404 *Error
JSON500 *Error
}
func ParseCreateApiKeyResponse ¶
func ParseCreateApiKeyResponse(rsp *http.Response) (*CreateApiKeyResponse, error)
ParseCreateApiKeyResponse parses an HTTP response from a CreateApiKeyWithResponse call
func (CreateApiKeyResponse) Status ¶
func (r CreateApiKeyResponse) Status() string
Status returns HTTPResponse.Status
func (CreateApiKeyResponse) StatusCode ¶
func (r CreateApiKeyResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CreateIndexJSONRequestBody ¶
type CreateIndexJSONRequestBody = IndexConfig
CreateIndexJSONRequestBody defines body for CreateIndex for application/json ContentType.
type CreateIndexResponse ¶
type CreateIndexResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseCreateIndexResponse ¶
func ParseCreateIndexResponse(rsp *http.Response) (*CreateIndexResponse, error)
ParseCreateIndexResponse parses an HTTP response from a CreateIndexWithResponse call
func (CreateIndexResponse) Status ¶
func (r CreateIndexResponse) Status() string
Status returns HTTPResponse.Status
func (CreateIndexResponse) StatusCode ¶
func (r CreateIndexResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CreateTableJSONRequestBody ¶
type CreateTableJSONRequestBody = CreateTableRequest
CreateTableJSONRequestBody defines body for CreateTable for application/json ContentType.
type CreateTableRequest ¶
type CreateTableRequest struct {
// Description Optional human-readable description of the table and its purpose.
// Useful for documentation and team collaboration.
Description string `json:"description,omitempty,omitzero"`
// Indexes Map of index name to index configuration. Indexes enable different query capabilities:
// - Full-text indexes for BM25 search
// - Vector indexes for semantic similarity
// - Multimodal indexes for images/audio/video
//
// You can add multiple indexes to support different query patterns.
Indexes map[string]IndexConfig `json:"indexes,omitempty,omitzero"`
// NumShards Number of shards to create for the table. Data is partitioned across shards based on key ranges.
//
// **Sizing Guidelines:**
// - Small datasets (<100K docs): 1-3 shards
// - Medium datasets (100K-1M docs): 3-10 shards
// - Large datasets (>1M docs): 10+ shards
//
// More shards enable better parallelism but increase overhead. Choose based on expected data size and query patterns.
//
// **When to Add More Shards:**
//
// Antfly supports **online shard reallocation** without downtime. Add more shards when:
// - Individual shards exceed size thresholds (configurable)
// - Query latency increases due to large shard size
// - Need better parallelism for write-heavy workloads
//
// Use the internal `/reallocate` endpoint to trigger automatic shard splitting:
// “`bash
// POST /_internal/v1/reallocate
// “`
//
// This enqueues a reallocation request that the leader processes asynchronously, splitting
// large shards and redistributing data without service interruption.
//
// **Advantages over Elasticsearch:**
// - Automatic shard splitting (no manual reindexing required)
// - Online operation (no downtime)
// - Transparent to applications (keys remain accessible during reallocation)
NumShards uint `json:"num_shards,omitempty,omitzero"`
// ReplicationSources PostgreSQL CDC replication sources. Streams INSERT/UPDATE/DELETE changes from
// PostgreSQL tables into this Antfly table via logical replication.
//
// Multiple sources can feed into a single table (e.g., `users` + `scores` → Antfly `users`).
// Each source uses `on_update`/`on_delete` transforms to control how PG events map to
// Antfly document operations. Requires `wal_level=logical` on the PostgreSQL source.
ReplicationSources []ReplicationSource `json:"replication_sources,omitempty,omitzero"`
// Schema Schema definition for a table with multiple document types
Schema TableSchema `json:"schema,omitempty,omitzero"`
}
CreateTableRequest defines model for CreateTableRequest.
type CreateTableResponse ¶
type CreateTableResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Table
JSON400 *BadRequest
}
func ParseCreateTableResponse ¶
func ParseCreateTableResponse(rsp *http.Response) (*CreateTableResponse, error)
ParseCreateTableResponse parses an HTTP response from a CreateTableWithResponse call
func (CreateTableResponse) Status ¶
func (r CreateTableResponse) Status() string
Status returns HTTPResponse.Status
func (CreateTableResponse) StatusCode ¶
func (r CreateTableResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CreateUserJSONRequestBody ¶
type CreateUserJSONRequestBody = CreateUserRequest
CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.
type CreateUserRequest ¶
type CreateUserRequest struct {
// InitialPolicies Optional list of initial permissions for the user.
InitialPolicies []Permission `json:"initial_policies,omitzero"`
Password string `json:"password"`
// Username Username for the new user. If provided in the path, this field can be omitted or must match the path parameter.
Username string `json:"username,omitempty,omitzero"`
}
CreateUserRequest defines model for CreateUserRequest.
type CreateUserResponse ¶
type CreateUserResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *User
JSON400 *Error
JSON409 *Error
JSON500 *Error
}
func ParseCreateUserResponse ¶
func ParseCreateUserResponse(rsp *http.Response) (*CreateUserResponse, error)
ParseCreateUserResponse parses an HTTP response from a CreateUserWithResponse call
func (CreateUserResponse) Status ¶
func (r CreateUserResponse) Status() string
Status returns HTTPResponse.Status
func (CreateUserResponse) StatusCode ¶
func (r CreateUserResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Credentials ¶
type Credentials struct {
// AccessKeyId AWS access key ID. Supports keystore syntax for secret lookup. Falls back to AWS_ACCESS_KEY_ID environment variable if not set.
AccessKeyId string `json:"access_key_id,omitempty,omitzero"`
// Endpoint S3-compatible endpoint (e.g., 's3.amazonaws.com' or 'localhost:9000' for MinIO)
Endpoint string `json:"endpoint,omitempty,omitzero"`
// SecretAccessKey AWS secret access key. Supports keystore syntax for secret lookup. Falls back to AWS_SECRET_ACCESS_KEY environment variable if not set.
SecretAccessKey string `json:"secret_access_key,omitempty,omitzero"`
// SessionToken Optional AWS session token for temporary credentials. Supports keystore syntax for secret lookup.
SessionToken string `json:"session_token,omitempty,omitzero"`
// UseSsl Enable SSL/TLS for S3 connections (default: true for AWS, false for local MinIO)
UseSsl bool `json:"use_ssl,omitempty,omitzero"`
}
Credentials defines model for Credentials.
type DateRangeStringQuery ¶
type DateRangeStringQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
DatetimeParser string `json:"datetime_parser,omitempty,omitzero"`
End time.Time `json:"end,omitempty,omitzero"`
Field string `json:"field,omitempty,omitzero"`
InclusiveEnd bool `json:"inclusive_end,omitzero"`
InclusiveStart bool `json:"inclusive_start,omitzero"`
Start time.Time `json:"start,omitempty,omitzero"`
}
DateRangeStringQuery defines model for DateRangeStringQuery.
type DeleteApiKeyResponse ¶
type DeleteApiKeyResponse struct {
Body []byte
HTTPResponse *http.Response
JSON404 *Error
JSON500 *Error
}
func ParseDeleteApiKeyResponse ¶
func ParseDeleteApiKeyResponse(rsp *http.Response) (*DeleteApiKeyResponse, error)
ParseDeleteApiKeyResponse parses an HTTP response from a DeleteApiKeyWithResponse call
func (DeleteApiKeyResponse) Status ¶
func (r DeleteApiKeyResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteApiKeyResponse) StatusCode ¶
func (r DeleteApiKeyResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DeleteSecretResponse ¶
type DeleteSecretResponse struct {
Body []byte
HTTPResponse *http.Response
JSON401 *Error
JSON404 *NotFound
JSON503 *Error
}
func ParseDeleteSecretResponse ¶
func ParseDeleteSecretResponse(rsp *http.Response) (*DeleteSecretResponse, error)
ParseDeleteSecretResponse parses an HTTP response from a DeleteSecretWithResponse call
func (DeleteSecretResponse) Status ¶
func (r DeleteSecretResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteSecretResponse) StatusCode ¶
func (r DeleteSecretResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DeleteUserResponse ¶
type DeleteUserResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *Error
JSON404 *Error
JSON500 *Error
}
func ParseDeleteUserResponse ¶
func ParseDeleteUserResponse(rsp *http.Response) (*DeleteUserResponse, error)
ParseDeleteUserResponse parses an HTTP response from a DeleteUserWithResponse call
func (DeleteUserResponse) Status ¶
func (r DeleteUserResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteUserResponse) StatusCode ¶
func (r DeleteUserResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DisjunctionQuery ¶
type DisjunctionQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Disjuncts []Query `json:"disjuncts"`
Min float64 `json:"min,omitempty,omitzero"`
}
DisjunctionQuery defines model for DisjunctionQuery.
type DistanceMetric ¶
type DistanceMetric string
DistanceMetric Distance metric for the vector index (dense only). Use "cosine" for models trained with cosine similarity (e.g. CLIP, OpenAI). Use "inner_product" for models trained with dot product similarity. Use "l2_squared" (default) for models trained with Euclidean distance.
const ( DistanceMetricCosine DistanceMetric = "cosine" DistanceMetricInnerProduct DistanceMetric = "inner_product" DistanceMetricL2Squared DistanceMetric = "l2_squared" )
Defines values for DistanceMetric.
type DistanceRange ¶
type DistanceRange struct {
// From Minimum distance (inclusive)
From *float64 `json:"from,omitempty"`
// Name Name of the distance range bucket
Name string `json:"name"`
// To Maximum distance (exclusive)
To *float64 `json:"to,omitempty"`
}
DistanceRange defines model for DistanceRange.
type DistanceUnit ¶
type DistanceUnit string
DistanceUnit Distance unit for geo aggregations: - m: meters - km: kilometers - mi: miles - ft: feet - yd: yards
const ( DistanceUnitFt DistanceUnit = "ft" DistanceUnitKm DistanceUnit = "km" DistanceUnitM DistanceUnit = "m" DistanceUnitMi DistanceUnit = "mi" DistanceUnitYd DistanceUnit = "yd" )
Defines values for DistanceUnit.
type DocIdQuery ¶
type DocIdQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Ids []string `json:"ids"`
}
DocIdQuery defines model for DocIdQuery.
type DocumentSchema ¶
type DocumentSchema struct {
// Description A description of the document type.
Description string `json:"description,omitempty,omitzero"`
// Schema A valid JSON Schema defining the document's structure.
// This is used to infer indexing rules and field types.
Schema map[string]interface{} `json:"schema,omitempty,omitzero"`
}
DocumentSchema Defines the structure of a document type
func (*DocumentSchema) Validate ¶
func (d *DocumentSchema) Validate(document any) (*ValidationResult, error)
Validate validates a document against the DocumentSchema. It compiles the JSON schema and validates the document structure, types, and constraints. Returns a ValidationResult containing the validation status and any errors.
Example usage:
schema := oapi.DocumentSchema{
Schema: map[string]interface{}{
"type": "object",
"properties": map[string]interface{}{
"name": map[string]interface{}{"type": "string"},
"age": map[string]interface{}{"type": "number"},
},
"required": []string{"name"},
},
}
doc := map[string]interface{}{
"name": "Alice",
"age": 30,
}
result, err := schema.Validate(doc)
if err != nil {
// Handle compilation error
}
if !result.Valid {
// Handle validation errors
for _, e := range result.Errors {
fmt.Printf("%s: %s\n", e.Field, e.Message)
}
}
type DropIndexResponse ¶
type DropIndexResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseDropIndexResponse ¶
func ParseDropIndexResponse(rsp *http.Response) (*DropIndexResponse, error)
ParseDropIndexResponse parses an HTTP response from a DropIndexWithResponse call
func (DropIndexResponse) Status ¶
func (r DropIndexResponse) Status() string
Status returns HTTPResponse.Status
func (DropIndexResponse) StatusCode ¶
func (r DropIndexResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DropTableResponse ¶
type DropTableResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseDropTableResponse ¶
func ParseDropTableResponse(rsp *http.Response) (*DropTableResponse, error)
ParseDropTableResponse parses an HTTP response from a DropTableWithResponse call
func (DropTableResponse) Status ¶
func (r DropTableResponse) Status() string
Status returns HTTPResponse.Status
func (DropTableResponse) StatusCode ¶
func (r DropTableResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DuckDuckGoSearchConfig ¶
type DuckDuckGoSearchConfig struct {
// Language Preferred language for results (e.g., 'en', 'es', 'fr')
Language string `json:"language,omitempty,omitzero"`
// MaxResults Maximum number of search results to return
MaxResults int `json:"max_results,omitempty,omitzero"`
// NoHtml Remove HTML from results
NoHtml bool `json:"no_html,omitempty,omitzero"`
// NoRedirect Skip HTTP redirect for bang queries
NoRedirect bool `json:"no_redirect,omitempty,omitzero"`
// Provider The web search provider to use.
//
// - **google**: Google Custom Search API (requires CSE setup)
// - **bing**: Microsoft Bing Web Search API
// - **serper**: Serper.dev Google Search API (simpler setup)
// - **tavily**: Tavily AI Search API (optimized for RAG)
// - **brave**: Brave Search API
// - **duckduckgo**: DuckDuckGo Instant Answer API (limited, no API key)
Provider WebSearchProvider `json:"provider"`
// Region Preferred region for results (e.g., 'us', 'uk', 'de')
Region string `json:"region,omitempty,omitzero"`
// SafeSearch Enable safe search filtering
SafeSearch *bool `json:"safe_search,omitempty"`
// TimeoutMs Request timeout in milliseconds
TimeoutMs int `json:"timeout_ms,omitempty,omitzero"`
}
DuckDuckGoSearchConfig defines model for DuckDuckGoSearchConfig.
type DynamicTemplate ¶
type DynamicTemplate struct {
// Mapping Field mapping to apply when a dynamic template matches
Mapping TemplateFieldMapping `json:"mapping,omitempty,omitzero"`
// Match Glob pattern for field name (last path element).
// Supports * and ** wildcards. Example: "*_text" matches "title_text", "body_text"
Match string `json:"match,omitempty,omitzero"`
// MatchMappingType Filter by detected JSON type
MatchMappingType DynamicTemplateMatchMappingType `json:"match_mapping_type,omitempty,omitzero"`
// Name Optional identifier for the template (useful for debugging)
Name string `json:"name,omitempty,omitzero"`
// PathMatch Glob pattern for the full dotted path. Supports ** for matching multiple segments.
// Example: "metadata.**" matches "metadata.author", "metadata.tags.primary"
PathMatch string `json:"path_match,omitempty,omitzero"`
// PathUnmatch Path exclusion pattern. If it matches the full path, the template is skipped.
PathUnmatch string `json:"path_unmatch,omitempty,omitzero"`
// Unmatch Exclusion pattern for field name. If it matches, the template is skipped.
// Example: "skip_*" would exclude fields like "skip_this"
Unmatch string `json:"unmatch,omitempty,omitzero"`
}
DynamicTemplate A rule for mapping dynamically detected fields. Templates are checked in order and the first matching template's mapping is used.
type DynamicTemplateMatchMappingType ¶
type DynamicTemplateMatchMappingType string
DynamicTemplateMatchMappingType Filter by detected JSON type
const ( DynamicTemplateMatchMappingTypeBoolean DynamicTemplateMatchMappingType = "boolean" DynamicTemplateMatchMappingTypeDate DynamicTemplateMatchMappingType = "date" DynamicTemplateMatchMappingTypeNumber DynamicTemplateMatchMappingType = "number" DynamicTemplateMatchMappingTypeObject DynamicTemplateMatchMappingType = "object" DynamicTemplateMatchMappingTypeString DynamicTemplateMatchMappingType = "string" )
Defines values for DynamicTemplateMatchMappingType.
type Edge ¶
type Edge struct {
// CreatedAt When the edge was created
CreatedAt time.Time `json:"created_at,omitempty,omitzero"`
// Metadata Optional edge metadata
Metadata map[string]interface{} `json:"metadata,omitempty,omitzero"`
// Source Base64-encoded source document key
Source []byte `json:"source"`
// Target Base64-encoded target document key
Target []byte `json:"target"`
// Type Edge type (e.g., "cites", "similar_to", "authored_by")
Type string `json:"type"`
// UpdatedAt When the edge was last updated
UpdatedAt time.Time `json:"updated_at,omitempty,omitzero"`
// Weight Edge weight/confidence (0.0 to 1.0)
Weight float64 `json:"weight"`
}
Edge A typed, weighted connection between documents
type EdgeDirection ¶
type EdgeDirection string
EdgeDirection Direction of edges to query: - out: Outgoing edges from the node - in: Incoming edges to the node - both: Both outgoing and incoming edges
const ( EdgeDirectionBoth EdgeDirection = "both" EdgeDirectionIn EdgeDirection = "in" EdgeDirectionOut EdgeDirection = "out" )
Defines values for EdgeDirection.
type EdgeTypeConfig ¶
type EdgeTypeConfig struct {
// AllowSelfLoops Whether to allow edges from a node to itself
AllowSelfLoops bool `json:"allow_self_loops,omitempty,omitzero"`
// Field Document field containing target node key(s) for automatic edge creation.
// Supports string (single target) or array of strings (multiple targets).
// When omitted, edges must be provided explicitly via _edges.
Field string `json:"field,omitempty,omitzero"`
// MaxWeight Maximum allowed edge weight
MaxWeight float64 `json:"max_weight,omitempty,omitzero"`
// MinWeight Minimum allowed edge weight
MinWeight float64 `json:"min_weight,omitempty,omitzero"`
// Name Edge type name (e.g., 'cites', 'similar_to')
Name string `json:"name"`
// RequiredMetadata Required metadata fields for this edge type
RequiredMetadata []string `json:"required_metadata,omitempty,omitzero"`
// Topology Topology constraint for this edge type:
// - tree: Single parent per node, no cycles
// - graph: No constraints (default)
Topology EdgeTypeConfigTopology `json:"topology,omitempty,omitzero"`
}
EdgeTypeConfig Configuration for a specific edge type
type EdgeTypeConfigTopology ¶
type EdgeTypeConfigTopology string
EdgeTypeConfigTopology Topology constraint for this edge type: - tree: Single parent per node, no cycles - graph: No constraints (default)
const ( EdgeTypeConfigTopologyGraph EdgeTypeConfigTopology = "graph" EdgeTypeConfigTopologyTree EdgeTypeConfigTopology = "tree" )
Defines values for EdgeTypeConfigTopology.
type EdgesResponse ¶
type EdgesResponse struct {
// Count Total number of edges returned
Count int `json:"count,omitempty,omitzero"`
Edges []Edge `json:"edges,omitempty,omitzero"`
}
EdgesResponse defines model for EdgesResponse.
type EmbedderConfig ¶
type EmbedderConfig struct {
// Provider The embedding provider to use.
Provider EmbedderProvider `json:"provider"`
// contains filtered or unexported fields
}
EmbedderConfig defines model for EmbedderConfig.
func (EmbedderConfig) AsAntflyEmbedderConfig ¶
func (t EmbedderConfig) AsAntflyEmbedderConfig() (AntflyEmbedderConfig, error)
AsAntflyEmbedderConfig returns the union data inside the EmbedderConfig as a AntflyEmbedderConfig
func (EmbedderConfig) AsBedrockEmbedderConfig ¶
func (t EmbedderConfig) AsBedrockEmbedderConfig() (BedrockEmbedderConfig, error)
AsBedrockEmbedderConfig returns the union data inside the EmbedderConfig as a BedrockEmbedderConfig
func (EmbedderConfig) AsCohereEmbedderConfig ¶
func (t EmbedderConfig) AsCohereEmbedderConfig() (CohereEmbedderConfig, error)
AsCohereEmbedderConfig returns the union data inside the EmbedderConfig as a CohereEmbedderConfig
func (EmbedderConfig) AsGoogleEmbedderConfig ¶
func (t EmbedderConfig) AsGoogleEmbedderConfig() (GoogleEmbedderConfig, error)
AsGoogleEmbedderConfig returns the union data inside the EmbedderConfig as a GoogleEmbedderConfig
func (EmbedderConfig) AsOllamaEmbedderConfig ¶
func (t EmbedderConfig) AsOllamaEmbedderConfig() (OllamaEmbedderConfig, error)
AsOllamaEmbedderConfig returns the union data inside the EmbedderConfig as a OllamaEmbedderConfig
func (EmbedderConfig) AsOpenAIEmbedderConfig ¶
func (t EmbedderConfig) AsOpenAIEmbedderConfig() (OpenAIEmbedderConfig, error)
AsOpenAIEmbedderConfig returns the union data inside the EmbedderConfig as a OpenAIEmbedderConfig
func (EmbedderConfig) AsOpenRouterEmbedderConfig ¶
func (t EmbedderConfig) AsOpenRouterEmbedderConfig() (OpenRouterEmbedderConfig, error)
AsOpenRouterEmbedderConfig returns the union data inside the EmbedderConfig as a OpenRouterEmbedderConfig
func (EmbedderConfig) AsTermiteEmbedderConfig ¶
func (t EmbedderConfig) AsTermiteEmbedderConfig() (TermiteEmbedderConfig, error)
AsTermiteEmbedderConfig returns the union data inside the EmbedderConfig as a TermiteEmbedderConfig
func (EmbedderConfig) AsVertexEmbedderConfig ¶
func (t EmbedderConfig) AsVertexEmbedderConfig() (VertexEmbedderConfig, error)
AsVertexEmbedderConfig returns the union data inside the EmbedderConfig as a VertexEmbedderConfig
func (*EmbedderConfig) FromAntflyEmbedderConfig ¶
func (t *EmbedderConfig) FromAntflyEmbedderConfig(v AntflyEmbedderConfig) error
FromAntflyEmbedderConfig overwrites any union data inside the EmbedderConfig as the provided AntflyEmbedderConfig
func (*EmbedderConfig) FromBedrockEmbedderConfig ¶
func (t *EmbedderConfig) FromBedrockEmbedderConfig(v BedrockEmbedderConfig) error
FromBedrockEmbedderConfig overwrites any union data inside the EmbedderConfig as the provided BedrockEmbedderConfig
func (*EmbedderConfig) FromCohereEmbedderConfig ¶
func (t *EmbedderConfig) FromCohereEmbedderConfig(v CohereEmbedderConfig) error
FromCohereEmbedderConfig overwrites any union data inside the EmbedderConfig as the provided CohereEmbedderConfig
func (*EmbedderConfig) FromGoogleEmbedderConfig ¶
func (t *EmbedderConfig) FromGoogleEmbedderConfig(v GoogleEmbedderConfig) error
FromGoogleEmbedderConfig overwrites any union data inside the EmbedderConfig as the provided GoogleEmbedderConfig
func (*EmbedderConfig) FromOllamaEmbedderConfig ¶
func (t *EmbedderConfig) FromOllamaEmbedderConfig(v OllamaEmbedderConfig) error
FromOllamaEmbedderConfig overwrites any union data inside the EmbedderConfig as the provided OllamaEmbedderConfig
func (*EmbedderConfig) FromOpenAIEmbedderConfig ¶
func (t *EmbedderConfig) FromOpenAIEmbedderConfig(v OpenAIEmbedderConfig) error
FromOpenAIEmbedderConfig overwrites any union data inside the EmbedderConfig as the provided OpenAIEmbedderConfig
func (*EmbedderConfig) FromOpenRouterEmbedderConfig ¶
func (t *EmbedderConfig) FromOpenRouterEmbedderConfig(v OpenRouterEmbedderConfig) error
FromOpenRouterEmbedderConfig overwrites any union data inside the EmbedderConfig as the provided OpenRouterEmbedderConfig
func (*EmbedderConfig) FromTermiteEmbedderConfig ¶
func (t *EmbedderConfig) FromTermiteEmbedderConfig(v TermiteEmbedderConfig) error
FromTermiteEmbedderConfig overwrites any union data inside the EmbedderConfig as the provided TermiteEmbedderConfig
func (*EmbedderConfig) FromVertexEmbedderConfig ¶
func (t *EmbedderConfig) FromVertexEmbedderConfig(v VertexEmbedderConfig) error
FromVertexEmbedderConfig overwrites any union data inside the EmbedderConfig as the provided VertexEmbedderConfig
func (EmbedderConfig) MarshalJSON ¶
func (t EmbedderConfig) MarshalJSON() ([]byte, error)
func (*EmbedderConfig) MergeAntflyEmbedderConfig ¶
func (t *EmbedderConfig) MergeAntflyEmbedderConfig(v AntflyEmbedderConfig) error
MergeAntflyEmbedderConfig performs a merge with any union data inside the EmbedderConfig, using the provided AntflyEmbedderConfig
func (*EmbedderConfig) MergeBedrockEmbedderConfig ¶
func (t *EmbedderConfig) MergeBedrockEmbedderConfig(v BedrockEmbedderConfig) error
MergeBedrockEmbedderConfig performs a merge with any union data inside the EmbedderConfig, using the provided BedrockEmbedderConfig
func (*EmbedderConfig) MergeCohereEmbedderConfig ¶
func (t *EmbedderConfig) MergeCohereEmbedderConfig(v CohereEmbedderConfig) error
MergeCohereEmbedderConfig performs a merge with any union data inside the EmbedderConfig, using the provided CohereEmbedderConfig
func (*EmbedderConfig) MergeGoogleEmbedderConfig ¶
func (t *EmbedderConfig) MergeGoogleEmbedderConfig(v GoogleEmbedderConfig) error
MergeGoogleEmbedderConfig performs a merge with any union data inside the EmbedderConfig, using the provided GoogleEmbedderConfig
func (*EmbedderConfig) MergeOllamaEmbedderConfig ¶
func (t *EmbedderConfig) MergeOllamaEmbedderConfig(v OllamaEmbedderConfig) error
MergeOllamaEmbedderConfig performs a merge with any union data inside the EmbedderConfig, using the provided OllamaEmbedderConfig
func (*EmbedderConfig) MergeOpenAIEmbedderConfig ¶
func (t *EmbedderConfig) MergeOpenAIEmbedderConfig(v OpenAIEmbedderConfig) error
MergeOpenAIEmbedderConfig performs a merge with any union data inside the EmbedderConfig, using the provided OpenAIEmbedderConfig
func (*EmbedderConfig) MergeOpenRouterEmbedderConfig ¶
func (t *EmbedderConfig) MergeOpenRouterEmbedderConfig(v OpenRouterEmbedderConfig) error
MergeOpenRouterEmbedderConfig performs a merge with any union data inside the EmbedderConfig, using the provided OpenRouterEmbedderConfig
func (*EmbedderConfig) MergeTermiteEmbedderConfig ¶
func (t *EmbedderConfig) MergeTermiteEmbedderConfig(v TermiteEmbedderConfig) error
MergeTermiteEmbedderConfig performs a merge with any union data inside the EmbedderConfig, using the provided TermiteEmbedderConfig
func (*EmbedderConfig) MergeVertexEmbedderConfig ¶
func (t *EmbedderConfig) MergeVertexEmbedderConfig(v VertexEmbedderConfig) error
MergeVertexEmbedderConfig performs a merge with any union data inside the EmbedderConfig, using the provided VertexEmbedderConfig
func (*EmbedderConfig) UnmarshalJSON ¶
func (t *EmbedderConfig) UnmarshalJSON(b []byte) error
type EmbedderProvider ¶
type EmbedderProvider string
EmbedderProvider The embedding provider to use.
const ( EmbedderProviderAntfly EmbedderProvider = "antfly" EmbedderProviderBedrock EmbedderProvider = "bedrock" EmbedderProviderCohere EmbedderProvider = "cohere" EmbedderProviderGemini EmbedderProvider = "gemini" EmbedderProviderMock EmbedderProvider = "mock" EmbedderProviderOllama EmbedderProvider = "ollama" EmbedderProviderOpenai EmbedderProvider = "openai" EmbedderProviderOpenrouter EmbedderProvider = "openrouter" EmbedderProviderTermite EmbedderProvider = "termite" EmbedderProviderVertex EmbedderProvider = "vertex" )
Defines values for EmbedderProvider.
type Embedding ¶
type Embedding struct {
// contains filtered or unexported fields
}
Embedding defines model for Embedding.
func (Embedding) AsEmbedding0 ¶
func (t Embedding) AsEmbedding0() (Embedding0, error)
AsEmbedding0 returns the union data inside the Embedding as a Embedding0
func (Embedding) AsEmbedding1 ¶
func (t Embedding) AsEmbedding1() (Embedding1, error)
AsEmbedding1 returns the union data inside the Embedding as a Embedding1
func (*Embedding) FromEmbedding0 ¶
func (t *Embedding) FromEmbedding0(v Embedding0) error
FromEmbedding0 overwrites any union data inside the Embedding as the provided Embedding0
func (*Embedding) FromEmbedding1 ¶
func (t *Embedding) FromEmbedding1(v Embedding1) error
FromEmbedding1 overwrites any union data inside the Embedding as the provided Embedding1
func (Embedding) MarshalJSON ¶
func (*Embedding) MergeEmbedding0 ¶
func (t *Embedding) MergeEmbedding0(v Embedding0) error
MergeEmbedding0 performs a merge with any union data inside the Embedding, using the provided Embedding0
func (*Embedding) MergeEmbedding1 ¶
func (t *Embedding) MergeEmbedding1(v Embedding1) error
MergeEmbedding1 performs a merge with any union data inside the Embedding, using the provided Embedding1
func (*Embedding) UnmarshalJSON ¶
type Embedding1 ¶
Embedding1 defines model for .
type EmbeddingsIndexConfig ¶
type EmbeddingsIndexConfig struct {
// ChunkSize Number of documents per posting list chunk (sparse only)
ChunkSize int `json:"chunk_size,omitempty,omitzero"`
// Chunker A unified configuration for a chunking provider.
Chunker ChunkerConfig `json:"chunker,omitempty,omitzero"`
// Dimension Vector dimension for dense indexes. Can be omitted when an embedder is configured (auto-detected via probe). Ignored for sparse indexes.
Dimension int `json:"dimension,omitempty,omitzero"`
// DistanceMetric Distance metric for the vector index (dense only). Use "cosine" for models trained with cosine similarity (e.g. CLIP, OpenAI). Use "inner_product" for models trained with dot product similarity. Use "l2_squared" (default) for models trained with Euclidean distance.
DistanceMetric DistanceMetric `json:"distance_metric,omitempty,omitzero"`
// Embedder A unified configuration for an embedding provider.
//
// Embedders can be configured with templates to customize how documents are
// converted to text before embedding. Templates use Handlebars syntax and
// support various built-in helpers.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full document as context
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active user{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// Document with metadata:
// “`handlebars
// Title: {{metadata.title}}
// Date: {{metadata.date}}
// Tags: {{#each metadata.tags}}{{this}}, {{/each}}
//
// {{content}}
// “`
//
// HTML content extraction:
// “`handlebars
// Product: {{name}}
// Description: {{scrubHtml description_html}}
// Price: ${{price}}
// “`
//
// Multimodal with image:
// “`handlebars
// Product: {{title}}
// {{media url=image}}
// Description: {{description}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{title}}
// {{#if author}}By: {{author}}{{/if}}
// {{#if (eq category "premium")}}⭐ Premium Content{{/if}}
// {{body}}
// “`
//
// **Environment Variables:**
// - `GEMINI_API_KEY` - API key for Google AI
// - `OPENAI_API_KEY` - API key for OpenAI
// - `OPENAI_BASE_URL` - Base URL for OpenAI-compatible APIs
// - `OLLAMA_HOST` - Ollama server URL (e.g., http://localhost:11434)
//
// **Importing Pre-computed Embeddings:**
//
// You can import existing embeddings (from OpenAI, Cohere, or any provider) by including
// them directly in your documents using the `_embeddings` field. This bypasses the
// embedding generation step and writes vectors directly to the index.
//
// **Steps:**
// 1. Create the index first with the appropriate dimension
// 2. Write documents with `_embeddings: { "<indexName>": [...<embedding>...] }`
//
// **Example:**
// “`json
// {
// "title": "My Document",
// "content": "Document text...",
// "_embeddings": {
// "my_vector_index": [0.1, 0.2, 0.3, ...]
// }
// }
// “`
//
// **Use Cases:**
// - Migrating from another vector database with existing embeddings
// - Using embeddings generated by external systems
// - Importing pre-computed OpenAI, Cohere, or other provider embeddings
// - Batch processing embeddings offline before ingestion
Embedder EmbedderConfig `json:"embedder,omitempty,omitzero"`
// Field Field to extract embeddings from
Field string `json:"field,omitempty,omitzero"`
// MemOnly Whether to use in-memory only storage (dense only)
MemOnly bool `json:"mem_only,omitempty,omitzero"`
// MinWeight Minimum weight threshold for sparse vector entries (sparse only)
MinWeight float32 `json:"min_weight,omitempty,omitzero"`
// Sparse When true, creates a sparse (SPLADE) inverted index. When false (default), creates a dense (HNSW) vector index.
Sparse bool `json:"sparse,omitempty,omitzero"`
// Summarizer A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Summarizer GeneratorConfig `json:"summarizer,omitempty,omitzero"`
// Template Handlebars template for generating prompts. See https://handlebarsjs.com/guide/ for more information.
Template string `json:"template,omitempty,omitzero"`
// TopK Default number of results to return from search (sparse only)
TopK int `json:"top_k,omitempty,omitzero"`
}
EmbeddingsIndexConfig Unified configuration for embeddings indexes. When sparse is true, creates a sparse vector index (SPLADE inverted index). When sparse is false (default), creates a dense vector index (HNSW). For dense indexes, dimension can be omitted if an embedder is configured — it will be auto-detected.
type EmbeddingsIndexStats ¶
type EmbeddingsIndexStats struct {
// BackfillItemsProcessed Total items processed during backfill
BackfillItemsProcessed uint64 `json:"backfill_items_processed,omitempty,omitzero"`
// BackfillProgress Backfill progress as a ratio from 0.0 to 1.0
BackfillProgress float64 `json:"backfill_progress,omitempty,omitzero"`
// DiskUsage Size of the index in bytes
DiskUsage uint64 `json:"disk_usage,omitempty,omitzero"`
// Error Error message if stats could not be retrieved
Error string `json:"error,omitempty,omitzero"`
// Rebuilding Whether the index enricher is currently backfilling
Rebuilding bool `json:"rebuilding,omitempty,omitzero"`
// TotalIndexed Number of vectors/documents in the index
TotalIndexed uint64 `json:"total_indexed,omitempty,omitzero"`
// TotalNodes Total number of nodes in the index (dense only)
TotalNodes uint64 `json:"total_nodes,omitempty,omitzero"`
// TotalTerms Number of unique terms in the inverted index (sparse only)
TotalTerms uint64 `json:"total_terms,omitempty,omitzero"`
// WalBacklog Number of documents pending enrichment in the WAL
WalBacklog uint64 `json:"wal_backlog,omitempty,omitzero"`
}
EmbeddingsIndexStats Statistics for an embeddings index (dense or sparse)
type EvalConfig ¶
type EvalConfig struct {
// Evaluators List of evaluators to run
Evaluators []EvaluatorName `json:"evaluators,omitempty,omitzero"`
// GroundTruth Ground truth data for evaluation
GroundTruth GroundTruth `json:"ground_truth,omitempty,omitzero"`
// Judge A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Judge GeneratorConfig `json:"judge,omitempty,omitzero"`
// Options Options for evaluation behavior
Options EvalOptions `json:"options,omitempty,omitzero"`
}
EvalConfig Configuration for inline evaluation of query results. Add to RAGRequest, QueryRequest, or AnswerAgentRequest.
type EvalOptions ¶
type EvalOptions struct {
// K K value for @K metrics (precision@k, recall@k, ndcg@k)
K int `json:"k,omitempty,omitzero"`
// PassThreshold Score threshold for pass/fail determination
PassThreshold float32 `json:"pass_threshold,omitempty,omitzero"`
// TimeoutSeconds Timeout for evaluation in seconds
TimeoutSeconds int `json:"timeout_seconds,omitempty,omitzero"`
}
EvalOptions Options for evaluation behavior
type EvalRequest ¶
type EvalRequest struct {
// Context Retrieved documents/context
Context []map[string]interface{} `json:"context,omitempty,omitzero"`
// Evaluators List of evaluators to run
Evaluators []EvaluatorName `json:"evaluators"`
// GroundTruth Ground truth data for evaluation
GroundTruth GroundTruth `json:"ground_truth,omitempty,omitzero"`
// Judge A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Judge GeneratorConfig `json:"judge,omitempty,omitzero"`
// Options Options for evaluation behavior
Options EvalOptions `json:"options,omitempty,omitzero"`
// Output Generated output to evaluate (optional for retrieval-only)
Output string `json:"output,omitempty,omitzero"`
// Query Original query/input to evaluate
Query string `json:"query,omitempty,omitzero"`
// RetrievedIds IDs of retrieved documents (for retrieval metrics)
RetrievedIds []string `json:"retrieved_ids,omitempty,omitzero"`
}
EvalRequest Standalone evaluation request for POST /eval endpoint. Useful for testing evaluators without running a query.
type EvalResult ¶
type EvalResult struct {
// DurationMs Total evaluation duration in milliseconds
DurationMs int `json:"duration_ms,omitempty,omitzero"`
// Scores Scores organized by category
Scores EvalScores `json:"scores,omitempty,omitzero"`
// Summary Aggregate statistics across all evaluators
Summary EvalSummary `json:"summary,omitempty,omitzero"`
}
EvalResult Complete evaluation result
type EvalScores ¶
type EvalScores struct {
// Generation Generation quality scores (faithfulness, relevance, etc.)
Generation map[string]EvaluatorScore `json:"generation,omitempty,omitzero"`
// Retrieval Retrieval metric scores (recall, precision, ndcg, etc.)
Retrieval map[string]EvaluatorScore `json:"retrieval,omitempty,omitzero"`
}
EvalScores Scores organized by category
type EvalSummary ¶
type EvalSummary struct {
// AverageScore Average score across all evaluators
AverageScore float32 `json:"average_score,omitempty,omitzero"`
// Failed Number of evaluators that failed
Failed int `json:"failed,omitempty,omitzero"`
// Passed Number of evaluators that passed
Passed int `json:"passed,omitempty,omitzero"`
// Total Total number of evaluators run
Total int `json:"total,omitempty,omitzero"`
}
EvalSummary Aggregate statistics across all evaluators
type EvaluateJSONRequestBody ¶
type EvaluateJSONRequestBody = EvalRequest
EvaluateJSONRequestBody defines body for Evaluate for application/json ContentType.
type EvaluateResponse ¶
type EvaluateResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *EvalResult
JSON400 *Error
JSON500 *Error
}
func ParseEvaluateResponse ¶
func ParseEvaluateResponse(rsp *http.Response) (*EvaluateResponse, error)
ParseEvaluateResponse parses an HTTP response from a EvaluateWithResponse call
func (EvaluateResponse) Status ¶
func (r EvaluateResponse) Status() string
Status returns HTTPResponse.Status
func (EvaluateResponse) StatusCode ¶
func (r EvaluateResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type EvaluatorName ¶
type EvaluatorName string
EvaluatorName Available evaluator types:
**Retrieval metrics** (require ground_truth.relevant_ids): - recall: Recall@k - fraction of relevant docs retrieved - precision: Precision@k - fraction of retrieved docs that are relevant - ndcg: Normalized Discounted Cumulative Gain - mrr: Mean Reciprocal Rank - map: Mean Average Precision
**LLM-as-judge metrics** (require judge config): - relevance: Is output relevant to query? (works on retrieval-only too) - faithfulness: Is output grounded in context? - completeness: Does output fully address query? - coherence: Is output well-structured? - safety: Is output safe/appropriate? - helpfulness: Is output useful? - correctness: Is output factually correct? (uses expectations) - citation_quality: Are citations accurate?
const ( EvaluatorNameCitationQuality EvaluatorName = "citation_quality" EvaluatorNameCoherence EvaluatorName = "coherence" EvaluatorNameCompleteness EvaluatorName = "completeness" EvaluatorNameCorrectness EvaluatorName = "correctness" EvaluatorNameFaithfulness EvaluatorName = "faithfulness" EvaluatorNameHelpfulness EvaluatorName = "helpfulness" EvaluatorNameMap EvaluatorName = "map" EvaluatorNameMrr EvaluatorName = "mrr" EvaluatorNameNdcg EvaluatorName = "ndcg" EvaluatorNamePrecision EvaluatorName = "precision" EvaluatorNameRecall EvaluatorName = "recall" EvaluatorNameRelevance EvaluatorName = "relevance" EvaluatorNameSafety EvaluatorName = "safety" )
Defines values for EvaluatorName.
type EvaluatorScore ¶
type EvaluatorScore struct {
// Metadata Additional evaluator-specific data
Metadata map[string]interface{} `json:"metadata,omitempty,omitzero"`
// Pass Whether the evaluation passed the threshold
Pass bool `json:"pass,omitempty,omitzero"`
// Reason Human-readable explanation of the result
Reason string `json:"reason,omitempty,omitzero"`
// Score Numeric score (0-1)
Score float32 `json:"score,omitempty,omitzero"`
}
EvaluatorScore Result from a single evaluator
type FailedOperation ¶
type FailedOperation struct {
Error string `json:"error,omitempty,omitzero"`
Id string `json:"id,omitempty,omitzero"`
Operation FailedOperationOperation `json:"operation,omitempty,omitzero"`
}
FailedOperation defines model for FailedOperation.
type FailedOperationOperation ¶
type FailedOperationOperation string
FailedOperationOperation defines model for FailedOperation.Operation.
const ( FailedOperationOperationDelete FailedOperationOperation = "delete" FailedOperationOperationUpsert FailedOperationOperation = "upsert" )
Defines values for FailedOperationOperation.
type FetchConfig ¶
type FetchConfig struct {
// AllowedHosts Whitelist of allowed hostnames for fetching.
// If empty, all hosts are allowed (except private IPs).
// Example: ["docs.example.com", "api.example.com"]
AllowedHosts []string `json:"allowed_hosts,omitempty,omitzero"`
// BlockPrivateIps Block requests to private IP ranges (SSRF prevention).
// Blocked: 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
BlockPrivateIps *bool `json:"block_private_ips,omitempty"`
// MaxContentLength Maximum content length in characters (truncated if exceeded)
MaxContentLength int `json:"max_content_length,omitempty,omitzero"`
// MaxDownloadSizeBytes Maximum download size in bytes (default: 100MB)
MaxDownloadSizeBytes int `json:"max_download_size_bytes,omitempty,omitzero"`
S3Credentials Credentials `json:"s3_credentials,omitempty,omitzero"`
// TimeoutSeconds Download timeout in seconds
TimeoutSeconds int `json:"timeout_seconds,omitempty,omitzero"`
}
FetchConfig Configuration for URL content fetching.
Uses lib/scraping for downloading and processing. Supports: - HTTP/HTTPS URLs with security validation - HTML pages (extracts readable text via go-readability) - PDF files (extracts text) - Images (returns as data URIs) - Plain text files - S3 URLs (requires s3_credentials)
Security features (from lib/scraping.ContentSecurityConfig): - Allowed host whitelist - Private IP blocking (SSRF prevention) - Download size limits - Timeout controls
type FieldStatistics ¶
type FieldStatistics struct {
// AvgSize Average size in bytes for variable-length fields.
AvgSize int `json:"avg_size,omitempty,omitzero"`
// Cardinality Approximate number of unique values (via HyperLogLog).
Cardinality int64 `json:"cardinality,omitempty,omitzero"`
// MaxValue Maximum value for numeric/date fields.
MaxValue interface{} `json:"max_value,omitempty,omitzero"`
// MinValue Minimum value for numeric/date fields.
MinValue interface{} `json:"min_value,omitempty,omitzero"`
// NullCount Number of rows with null values for this field.
NullCount int64 `json:"null_count,omitempty,omitzero"`
}
FieldStatistics Statistics about a specific field.
type FilterSpec ¶
type FilterSpec struct {
// Field Field name to filter on
Field string `json:"field"`
// Operator Filter operator:
// - eq: Equals
// - ne: Not equals
// - gt/gte: Greater than (or equal)
// - lt/lte: Less than (or equal)
// - contains: Contains substring
// - prefix: Starts with
// - range: Between two values (value should be array [min, max])
// - in: Value in list (value should be array)
Operator FilterSpecOperator `json:"operator"`
// Value Filter value (string, number, boolean, or array for range/in operators)
Value interface{} `json:"value"`
}
FilterSpec A filter specification to apply to search queries
type FilterSpecOperator ¶
type FilterSpecOperator string
FilterSpecOperator Filter operator: - eq: Equals - ne: Not equals - gt/gte: Greater than (or equal) - lt/lte: Less than (or equal) - contains: Contains substring - prefix: Starts with - range: Between two values (value should be array [min, max]) - in: Value in list (value should be array)
const ( FilterSpecOperatorContains FilterSpecOperator = "contains" FilterSpecOperatorEq FilterSpecOperator = "eq" FilterSpecOperatorGt FilterSpecOperator = "gt" FilterSpecOperatorGte FilterSpecOperator = "gte" FilterSpecOperatorIn FilterSpecOperator = "in" FilterSpecOperatorLt FilterSpecOperator = "lt" FilterSpecOperatorLte FilterSpecOperator = "lte" FilterSpecOperatorNe FilterSpecOperator = "ne" FilterSpecOperatorPrefix FilterSpecOperator = "prefix" FilterSpecOperatorRange FilterSpecOperator = "range" )
Defines values for FilterSpecOperator.
type FollowupStepConfig ¶
type FollowupStepConfig struct {
// Chain Chain of generators to try in order. Mutually exclusive with 'generator'.
Chain []ChainLink `json:"chain,omitempty,omitzero"`
// Context Custom guidance for follow-up question focus and style
Context string `json:"context,omitempty,omitzero"`
// Count Number of follow-up questions to generate
Count int `json:"count,omitempty,omitzero"`
// Enabled Enable follow-up question generation
Enabled bool `json:"enabled,omitempty,omitzero"`
// Generator A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Generator GeneratorConfig `json:"generator,omitempty,omitzero"`
}
FollowupStepConfig Configuration for generating follow-up questions. Uses a separate generator call which can use a cheaper/faster model.
type ForeignColumn ¶
type ForeignColumn struct {
// Name Column name in the foreign table.
Name string `json:"name"`
// Nullable Whether the column allows NULL values.
Nullable bool `json:"nullable,omitempty,omitzero"`
// Type Column data type. Used for filter validation and type coercion.
// Common types: text, integer, bigint, float, boolean, timestamp, uuid, jsonb.
Type string `json:"type"`
}
ForeignColumn defines model for ForeignColumn.
type ForeignSource ¶
type ForeignSource struct {
// Columns Optional column definitions for the foreign table. If omitted, columns are
// auto-discovered from `information_schema.columns` on first query.
Columns []ForeignColumn `json:"columns,omitempty,omitzero"`
// Dsn Data source name (connection string) for the foreign database.
// Supports `${secret:key_name}` references that resolve from the Antfly keystore
// or environment variables.
Dsn string `json:"dsn"`
// PostgresTable Name of the table or view in the foreign PostgreSQL database to query.
PostgresTable string `json:"postgres_table"`
// Type Type of the foreign data source. Currently only "postgres" is supported.
Type ForeignSourceType `json:"type"`
}
ForeignSource defines model for ForeignSource.
type ForeignSourceType ¶
type ForeignSourceType string
ForeignSourceType Type of the foreign data source. Currently only "postgres" is supported.
const (
ForeignSourceTypePostgres ForeignSourceType = "postgres"
)
Defines values for ForeignSourceType.
type FullTextIndexConfig ¶
type FullTextIndexConfig struct {
// MemOnly Whether to use memory-only storage
MemOnly bool `json:"mem_only,omitempty,omitzero"`
}
FullTextIndexConfig defines model for FullTextIndexConfig.
type FullTextIndexStats ¶
type FullTextIndexStats struct {
// BackfillItemsProcessed Number of documents indexed during current rebuild
BackfillItemsProcessed uint64 `json:"backfill_items_processed,omitempty,omitzero"`
// BackfillProgress Progress of ongoing rebuild as fraction [0.0, 1.0]
BackfillProgress float64 `json:"backfill_progress,omitempty,omitzero"`
// DiskUsage Size of the index in bytes
DiskUsage uint64 `json:"disk_usage,omitempty,omitzero"`
// Error Error message if stats could not be retrieved
Error string `json:"error,omitempty,omitzero"`
// Rebuilding Whether the index is currently rebuilding
Rebuilding bool `json:"rebuilding,omitempty,omitzero"`
// TotalIndexed Number of documents in the index
TotalIndexed uint64 `json:"total_indexed,omitempty,omitzero"`
}
FullTextIndexStats defines model for FullTextIndexStats.
type Fuzziness ¶
type Fuzziness struct {
// contains filtered or unexported fields
}
Fuzziness The fuzziness of the query. Can be an integer or "auto".
func (Fuzziness) AsFuzziness0 ¶
func (t Fuzziness) AsFuzziness0() (Fuzziness0, error)
AsFuzziness0 returns the union data inside the Fuzziness as a Fuzziness0
func (Fuzziness) AsFuzziness1 ¶
func (t Fuzziness) AsFuzziness1() (Fuzziness1, error)
AsFuzziness1 returns the union data inside the Fuzziness as a Fuzziness1
func (*Fuzziness) FromFuzziness0 ¶
func (t *Fuzziness) FromFuzziness0(v Fuzziness0) error
FromFuzziness0 overwrites any union data inside the Fuzziness as the provided Fuzziness0
func (*Fuzziness) FromFuzziness1 ¶
func (t *Fuzziness) FromFuzziness1(v Fuzziness1) error
FromFuzziness1 overwrites any union data inside the Fuzziness as the provided Fuzziness1
func (Fuzziness) MarshalJSON ¶
func (*Fuzziness) MergeFuzziness0 ¶
func (t *Fuzziness) MergeFuzziness0(v Fuzziness0) error
MergeFuzziness0 performs a merge with any union data inside the Fuzziness, using the provided Fuzziness0
func (*Fuzziness) MergeFuzziness1 ¶
func (t *Fuzziness) MergeFuzziness1(v Fuzziness1) error
MergeFuzziness1 performs a merge with any union data inside the Fuzziness, using the provided Fuzziness1
func (*Fuzziness) UnmarshalJSON ¶
type Fuzziness1 ¶
type Fuzziness1 string
Fuzziness1 defines model for Fuzziness.1.
const (
Fuzziness1Auto Fuzziness1 = "auto"
)
Defines values for Fuzziness1.
type FuzzyQuery ¶
type FuzzyQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
// Fuzziness The fuzziness of the query. Can be an integer or "auto".
Fuzziness Fuzziness `json:"fuzziness,omitempty,omitzero"`
PrefixLength int32 `json:"prefix_length,omitempty,omitzero"`
Term string `json:"term"`
}
FuzzyQuery defines model for FuzzyQuery.
type GenerationStepConfig ¶
type GenerationStepConfig struct {
// Chain Chain of generators to try in order. Mutually exclusive with 'generator'.
Chain []ChainLink `json:"chain,omitempty,omitzero"`
// Enabled Enable generation from retrieved documents
Enabled bool `json:"enabled,omitempty,omitzero"`
// GenerationContext Custom guidance for generation tone, detail level, and style
GenerationContext string `json:"generation_context,omitempty,omitzero"`
// Generator A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Generator GeneratorConfig `json:"generator,omitempty,omitzero"`
// SystemPrompt Custom system prompt for answer generation
SystemPrompt string `json:"system_prompt,omitempty,omitzero"`
}
GenerationStepConfig Configuration for the generation step. This step generates the final response from retrieved documents using the reasoning as context.
type GeneratorConfig ¶
type GeneratorConfig struct {
// Provider The generative AI provider to use.
Provider GeneratorProvider `json:"provider"`
// contains filtered or unexported fields
}
GeneratorConfig defines model for GeneratorConfig.
func (GeneratorConfig) AsAnthropicGeneratorConfig ¶
func (t GeneratorConfig) AsAnthropicGeneratorConfig() (AnthropicGeneratorConfig, error)
AsAnthropicGeneratorConfig returns the union data inside the GeneratorConfig as a AnthropicGeneratorConfig
func (GeneratorConfig) AsBedrockGeneratorConfig ¶
func (t GeneratorConfig) AsBedrockGeneratorConfig() (BedrockGeneratorConfig, error)
AsBedrockGeneratorConfig returns the union data inside the GeneratorConfig as a BedrockGeneratorConfig
func (GeneratorConfig) AsCohereGeneratorConfig ¶
func (t GeneratorConfig) AsCohereGeneratorConfig() (CohereGeneratorConfig, error)
AsCohereGeneratorConfig returns the union data inside the GeneratorConfig as a CohereGeneratorConfig
func (GeneratorConfig) AsGoogleGeneratorConfig ¶
func (t GeneratorConfig) AsGoogleGeneratorConfig() (GoogleGeneratorConfig, error)
AsGoogleGeneratorConfig returns the union data inside the GeneratorConfig as a GoogleGeneratorConfig
func (GeneratorConfig) AsOllamaGeneratorConfig ¶
func (t GeneratorConfig) AsOllamaGeneratorConfig() (OllamaGeneratorConfig, error)
AsOllamaGeneratorConfig returns the union data inside the GeneratorConfig as a OllamaGeneratorConfig
func (GeneratorConfig) AsOpenAIGeneratorConfig ¶
func (t GeneratorConfig) AsOpenAIGeneratorConfig() (OpenAIGeneratorConfig, error)
AsOpenAIGeneratorConfig returns the union data inside the GeneratorConfig as a OpenAIGeneratorConfig
func (GeneratorConfig) AsOpenRouterGeneratorConfig ¶
func (t GeneratorConfig) AsOpenRouterGeneratorConfig() (OpenRouterGeneratorConfig, error)
AsOpenRouterGeneratorConfig returns the union data inside the GeneratorConfig as a OpenRouterGeneratorConfig
func (GeneratorConfig) AsTermiteGeneratorConfig ¶
func (t GeneratorConfig) AsTermiteGeneratorConfig() (TermiteGeneratorConfig, error)
AsTermiteGeneratorConfig returns the union data inside the GeneratorConfig as a TermiteGeneratorConfig
func (GeneratorConfig) AsVertexGeneratorConfig ¶
func (t GeneratorConfig) AsVertexGeneratorConfig() (VertexGeneratorConfig, error)
AsVertexGeneratorConfig returns the union data inside the GeneratorConfig as a VertexGeneratorConfig
func (*GeneratorConfig) FromAnthropicGeneratorConfig ¶
func (t *GeneratorConfig) FromAnthropicGeneratorConfig(v AnthropicGeneratorConfig) error
FromAnthropicGeneratorConfig overwrites any union data inside the GeneratorConfig as the provided AnthropicGeneratorConfig
func (*GeneratorConfig) FromBedrockGeneratorConfig ¶
func (t *GeneratorConfig) FromBedrockGeneratorConfig(v BedrockGeneratorConfig) error
FromBedrockGeneratorConfig overwrites any union data inside the GeneratorConfig as the provided BedrockGeneratorConfig
func (*GeneratorConfig) FromCohereGeneratorConfig ¶
func (t *GeneratorConfig) FromCohereGeneratorConfig(v CohereGeneratorConfig) error
FromCohereGeneratorConfig overwrites any union data inside the GeneratorConfig as the provided CohereGeneratorConfig
func (*GeneratorConfig) FromGoogleGeneratorConfig ¶
func (t *GeneratorConfig) FromGoogleGeneratorConfig(v GoogleGeneratorConfig) error
FromGoogleGeneratorConfig overwrites any union data inside the GeneratorConfig as the provided GoogleGeneratorConfig
func (*GeneratorConfig) FromOllamaGeneratorConfig ¶
func (t *GeneratorConfig) FromOllamaGeneratorConfig(v OllamaGeneratorConfig) error
FromOllamaGeneratorConfig overwrites any union data inside the GeneratorConfig as the provided OllamaGeneratorConfig
func (*GeneratorConfig) FromOpenAIGeneratorConfig ¶
func (t *GeneratorConfig) FromOpenAIGeneratorConfig(v OpenAIGeneratorConfig) error
FromOpenAIGeneratorConfig overwrites any union data inside the GeneratorConfig as the provided OpenAIGeneratorConfig
func (*GeneratorConfig) FromOpenRouterGeneratorConfig ¶
func (t *GeneratorConfig) FromOpenRouterGeneratorConfig(v OpenRouterGeneratorConfig) error
FromOpenRouterGeneratorConfig overwrites any union data inside the GeneratorConfig as the provided OpenRouterGeneratorConfig
func (*GeneratorConfig) FromTermiteGeneratorConfig ¶
func (t *GeneratorConfig) FromTermiteGeneratorConfig(v TermiteGeneratorConfig) error
FromTermiteGeneratorConfig overwrites any union data inside the GeneratorConfig as the provided TermiteGeneratorConfig
func (*GeneratorConfig) FromVertexGeneratorConfig ¶
func (t *GeneratorConfig) FromVertexGeneratorConfig(v VertexGeneratorConfig) error
FromVertexGeneratorConfig overwrites any union data inside the GeneratorConfig as the provided VertexGeneratorConfig
func (GeneratorConfig) MarshalJSON ¶
func (t GeneratorConfig) MarshalJSON() ([]byte, error)
func (*GeneratorConfig) MergeAnthropicGeneratorConfig ¶
func (t *GeneratorConfig) MergeAnthropicGeneratorConfig(v AnthropicGeneratorConfig) error
MergeAnthropicGeneratorConfig performs a merge with any union data inside the GeneratorConfig, using the provided AnthropicGeneratorConfig
func (*GeneratorConfig) MergeBedrockGeneratorConfig ¶
func (t *GeneratorConfig) MergeBedrockGeneratorConfig(v BedrockGeneratorConfig) error
MergeBedrockGeneratorConfig performs a merge with any union data inside the GeneratorConfig, using the provided BedrockGeneratorConfig
func (*GeneratorConfig) MergeCohereGeneratorConfig ¶
func (t *GeneratorConfig) MergeCohereGeneratorConfig(v CohereGeneratorConfig) error
MergeCohereGeneratorConfig performs a merge with any union data inside the GeneratorConfig, using the provided CohereGeneratorConfig
func (*GeneratorConfig) MergeGoogleGeneratorConfig ¶
func (t *GeneratorConfig) MergeGoogleGeneratorConfig(v GoogleGeneratorConfig) error
MergeGoogleGeneratorConfig performs a merge with any union data inside the GeneratorConfig, using the provided GoogleGeneratorConfig
func (*GeneratorConfig) MergeOllamaGeneratorConfig ¶
func (t *GeneratorConfig) MergeOllamaGeneratorConfig(v OllamaGeneratorConfig) error
MergeOllamaGeneratorConfig performs a merge with any union data inside the GeneratorConfig, using the provided OllamaGeneratorConfig
func (*GeneratorConfig) MergeOpenAIGeneratorConfig ¶
func (t *GeneratorConfig) MergeOpenAIGeneratorConfig(v OpenAIGeneratorConfig) error
MergeOpenAIGeneratorConfig performs a merge with any union data inside the GeneratorConfig, using the provided OpenAIGeneratorConfig
func (*GeneratorConfig) MergeOpenRouterGeneratorConfig ¶
func (t *GeneratorConfig) MergeOpenRouterGeneratorConfig(v OpenRouterGeneratorConfig) error
MergeOpenRouterGeneratorConfig performs a merge with any union data inside the GeneratorConfig, using the provided OpenRouterGeneratorConfig
func (*GeneratorConfig) MergeTermiteGeneratorConfig ¶
func (t *GeneratorConfig) MergeTermiteGeneratorConfig(v TermiteGeneratorConfig) error
MergeTermiteGeneratorConfig performs a merge with any union data inside the GeneratorConfig, using the provided TermiteGeneratorConfig
func (*GeneratorConfig) MergeVertexGeneratorConfig ¶
func (t *GeneratorConfig) MergeVertexGeneratorConfig(v VertexGeneratorConfig) error
MergeVertexGeneratorConfig performs a merge with any union data inside the GeneratorConfig, using the provided VertexGeneratorConfig
func (*GeneratorConfig) UnmarshalJSON ¶
func (t *GeneratorConfig) UnmarshalJSON(b []byte) error
type GeneratorProvider ¶
type GeneratorProvider string
GeneratorProvider The generative AI provider to use.
const ( GeneratorProviderAnthropic GeneratorProvider = "anthropic" GeneratorProviderBedrock GeneratorProvider = "bedrock" GeneratorProviderCohere GeneratorProvider = "cohere" GeneratorProviderGemini GeneratorProvider = "gemini" GeneratorProviderMock GeneratorProvider = "mock" GeneratorProviderOllama GeneratorProvider = "ollama" GeneratorProviderOpenai GeneratorProvider = "openai" GeneratorProviderOpenrouter GeneratorProvider = "openrouter" GeneratorProviderTermite GeneratorProvider = "termite" GeneratorProviderVertex GeneratorProvider = "vertex" )
Defines values for GeneratorProvider.
type GeoBoundingBoxQuery ¶
type GeoBoundingBoxQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
// BottomRight [lon, lat]
BottomRight []float64 `json:"bottom_right"`
Field string `json:"field,omitempty,omitzero"`
// TopLeft [lon, lat]
TopLeft []float64 `json:"top_left"`
}
GeoBoundingBoxQuery defines model for GeoBoundingBoxQuery.
type GeoBoundingPolygonQuery ¶
type GeoBoundingPolygonQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
PolygonPoints []GeoPoint `json:"polygon_points"`
}
GeoBoundingPolygonQuery defines model for GeoBoundingPolygonQuery.
type GeoDistanceQuery ¶
type GeoDistanceQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Distance string `json:"distance"`
Field string `json:"field,omitempty,omitzero"`
// Location [lon, lat]
Location []float64 `json:"location"`
}
GeoDistanceQuery defines model for GeoDistanceQuery.
type GeoPoint ¶
type GeoPoint struct {
Lat float64 `json:"lat,omitempty,omitzero"`
Lon float64 `json:"lon,omitempty,omitzero"`
}
GeoPoint defines model for GeoPoint.
type GeoShape ¶
type GeoShape struct {
Coordinates []interface{} `json:"coordinates"`
Type string `json:"type"`
}
GeoShape A GeoJSON shape object. This is a simplified representation.
type GeoShapeGeometry ¶
type GeoShapeGeometry struct {
Relation GeoShapeGeometryRelation `json:"relation"`
// Shape A GeoJSON shape object. This is a simplified representation.
Shape GeoShape `json:"shape"`
}
GeoShapeGeometry defines model for GeoShapeGeometry.
type GeoShapeGeometryRelation ¶
type GeoShapeGeometryRelation string
GeoShapeGeometryRelation defines model for GeoShapeGeometry.Relation.
const ( GeoShapeGeometryRelationContains GeoShapeGeometryRelation = "contains" GeoShapeGeometryRelationIntersects GeoShapeGeometryRelation = "intersects" GeoShapeGeometryRelationWithin GeoShapeGeometryRelation = "within" )
Defines values for GeoShapeGeometryRelation.
type GeoShapeQuery ¶
type GeoShapeQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
Geometry GeoShapeGeometry `json:"geometry"`
}
GeoShapeQuery defines model for GeoShapeQuery.
type GetCurrentUserResponse ¶
type GetCurrentUserResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *struct {
Permissions []Permission `json:"permissions,omitempty,omitzero"`
Username string `json:"username,omitempty,omitzero"`
}
JSON401 *Error
JSON500 *Error
}
func ParseGetCurrentUserResponse ¶
func ParseGetCurrentUserResponse(rsp *http.Response) (*GetCurrentUserResponse, error)
ParseGetCurrentUserResponse parses an HTTP response from a GetCurrentUserWithResponse call
func (GetCurrentUserResponse) Status ¶
func (r GetCurrentUserResponse) Status() string
Status returns HTTPResponse.Status
func (GetCurrentUserResponse) StatusCode ¶
func (r GetCurrentUserResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetIndexResponse ¶
type GetIndexResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *IndexStatus
JSON404 *NotFound
JSON500 *InternalServerError
}
func ParseGetIndexResponse ¶
func ParseGetIndexResponse(rsp *http.Response) (*GetIndexResponse, error)
ParseGetIndexResponse parses an HTTP response from a GetIndexWithResponse call
func (GetIndexResponse) Status ¶
func (r GetIndexResponse) Status() string
Status returns HTTPResponse.Status
func (GetIndexResponse) StatusCode ¶
func (r GetIndexResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetStatusResponse ¶
type GetStatusResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ClusterStatus
JSON401 *Error
JSON500 *InternalServerError
}
func ParseGetStatusResponse ¶
func ParseGetStatusResponse(rsp *http.Response) (*GetStatusResponse, error)
ParseGetStatusResponse parses an HTTP response from a GetStatusWithResponse call
func (GetStatusResponse) Status ¶
func (r GetStatusResponse) Status() string
Status returns HTTPResponse.Status
func (GetStatusResponse) StatusCode ¶
func (r GetStatusResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetTableResponse ¶
type GetTableResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *TableStatus
JSON404 *NotFound
}
func ParseGetTableResponse ¶
func ParseGetTableResponse(rsp *http.Response) (*GetTableResponse, error)
ParseGetTableResponse parses an HTTP response from a GetTableWithResponse call
func (GetTableResponse) Status ¶
func (r GetTableResponse) Status() string
Status returns HTTPResponse.Status
func (GetTableResponse) StatusCode ¶
func (r GetTableResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetUserByNameResponse ¶
type GetUserByNameResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *User
JSON400 *Error
JSON404 *Error
JSON500 *Error
}
func ParseGetUserByNameResponse ¶
func ParseGetUserByNameResponse(rsp *http.Response) (*GetUserByNameResponse, error)
ParseGetUserByNameResponse parses an HTTP response from a GetUserByNameWithResponse call
func (GetUserByNameResponse) Status ¶
func (r GetUserByNameResponse) Status() string
Status returns HTTPResponse.Status
func (GetUserByNameResponse) StatusCode ¶
func (r GetUserByNameResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetUserPermissionsResponse ¶
type GetUserPermissionsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Permission
JSON400 *Error
JSON404 *Error
JSON500 *Error
}
func ParseGetUserPermissionsResponse ¶
func ParseGetUserPermissionsResponse(rsp *http.Response) (*GetUserPermissionsResponse, error)
ParseGetUserPermissionsResponse parses an HTTP response from a GetUserPermissionsWithResponse call
func (GetUserPermissionsResponse) Status ¶
func (r GetUserPermissionsResponse) Status() string
Status returns HTTPResponse.Status
func (GetUserPermissionsResponse) StatusCode ¶
func (r GetUserPermissionsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GlobalQueryJSONRequestBody ¶
type GlobalQueryJSONRequestBody = QueryRequest
GlobalQueryJSONRequestBody defines body for GlobalQuery for application/json ContentType.
type GlobalQueryResponse ¶
type GlobalQueryResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *QueryResponses
JSON400 *Error
JSON500 *Error
}
func ParseGlobalQueryResponse ¶
func ParseGlobalQueryResponse(rsp *http.Response) (*GlobalQueryResponse, error)
ParseGlobalQueryResponse parses an HTTP response from a GlobalQueryWithResponse call
func (GlobalQueryResponse) Status ¶
func (r GlobalQueryResponse) Status() string
Status returns HTTPResponse.Status
func (GlobalQueryResponse) StatusCode ¶
func (r GlobalQueryResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GoogleEmbedderConfig ¶
type GoogleEmbedderConfig struct {
// ApiKey The Google API key. Can also be set via GEMINI_API_KEY environment variable.
ApiKey string `json:"api_key,omitempty,omitzero"`
// Dimension The dimension of the embedding vector (768, 1536, or 3072 recommended).
Dimension int `json:"dimension,omitempty,omitzero"`
// Location The Google Cloud location (e.g., 'us-central1'). Required for Vertex AI, optional for Gemini API.
Location string `json:"location,omitempty,omitzero"`
// Model The name of the embedding model to use.
Model string `json:"model"`
// ProjectId The Google Cloud project ID (optional for Gemini API, required for Vertex AI).
ProjectId string `json:"project_id,omitempty,omitzero"`
// Url The URL of the Google API endpoint (optional, uses default if not specified).
Url string `json:"url,omitempty,omitzero"`
}
GoogleEmbedderConfig Configuration for the Google AI (Gemini) embedding provider.
API key via `api_key` field or `GEMINI_API_KEY` environment variable.
**Example Models:** gemini-embedding-001 (default, 3072 dims)
type GoogleGeneratorConfig ¶
type GoogleGeneratorConfig struct {
// ApiKey The Google API key.
ApiKey string `json:"api_key,omitempty,omitzero"`
// Location The Google Cloud location (e.g., 'us-central1').
Location string `json:"location,omitempty,omitzero"`
// MaxTokens Maximum number of tokens to generate.
MaxTokens int `json:"max_tokens,omitempty,omitzero"`
// Model The name of the generative model to use (e.g., 'gemini-2.5-flash', 'gemini-2.5-pro', 'gemini-3.0-pro').
Model string `json:"model"`
// ProjectId The Google Cloud project ID.
ProjectId string `json:"project_id,omitempty,omitzero"`
// Temperature Controls randomness in generation (0.0-2.0).
Temperature float32 `json:"temperature,omitempty,omitzero"`
// TopK Top-k sampling parameter.
TopK int `json:"top_k,omitempty,omitzero"`
// TopP Nucleus sampling parameter.
TopP float32 `json:"top_p,omitempty,omitzero"`
// Url The URL of the Google API endpoint.
Url string `json:"url,omitempty,omitzero"`
}
GoogleGeneratorConfig Configuration for the Google generative AI provider (Gemini).
**Example Models:** gemini-2.5-flash (default), gemini-2.5-pro, gemini-3.0-pro
type GoogleSearchConfig ¶
type GoogleSearchConfig struct {
// ApiKey Google API key (or set GOOGLE_CSE_API_KEY env var)
ApiKey string `json:"api_key,omitempty,omitzero"`
// CseId Custom Search Engine ID (or set GOOGLE_CSE_ID env var)
CseId string `json:"cse_id,omitempty,omitzero"`
// DateRestrict Restrict results by date (e.g., 'd7' for last 7 days, 'm1' for last month)
DateRestrict string `json:"date_restrict,omitempty,omitzero"`
// Language Preferred language for results (e.g., 'en', 'es', 'fr')
Language string `json:"language,omitempty,omitzero"`
// MaxResults Maximum number of search results to return
MaxResults int `json:"max_results,omitempty,omitzero"`
// Provider The web search provider to use.
//
// - **google**: Google Custom Search API (requires CSE setup)
// - **bing**: Microsoft Bing Web Search API
// - **serper**: Serper.dev Google Search API (simpler setup)
// - **tavily**: Tavily AI Search API (optimized for RAG)
// - **brave**: Brave Search API
// - **duckduckgo**: DuckDuckGo Instant Answer API (limited, no API key)
Provider WebSearchProvider `json:"provider"`
// Region Preferred region for results (e.g., 'us', 'uk', 'de')
Region string `json:"region,omitempty,omitzero"`
// SafeSearch Enable safe search filtering
SafeSearch *bool `json:"safe_search,omitempty"`
// SearchType Type of search to perform
SearchType GoogleSearchConfigSearchType `json:"search_type,omitempty,omitzero"`
// TimeoutMs Request timeout in milliseconds
TimeoutMs int `json:"timeout_ms,omitempty,omitzero"`
}
GoogleSearchConfig defines model for GoogleSearchConfig.
type GoogleSearchConfigSearchType ¶
type GoogleSearchConfigSearchType string
GoogleSearchConfigSearchType Type of search to perform
const ( GoogleSearchConfigSearchTypeImage GoogleSearchConfigSearchType = "image" GoogleSearchConfigSearchTypeWeb GoogleSearchConfigSearchType = "web" )
Defines values for GoogleSearchConfigSearchType.
type GraphIndexConfig ¶
type GraphIndexConfig struct {
// EdgeTypes List of edge types with their configurations
EdgeTypes []EdgeTypeConfig `json:"edge_types,omitempty,omitzero"`
// MaxEdgesPerDocument Maximum number of edges per document (0 = unlimited)
MaxEdgesPerDocument int `json:"max_edges_per_document,omitempty,omitzero"`
// Summarizer A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Summarizer GeneratorConfig `json:"summarizer,omitempty,omitzero"`
// Template Handlebars template for generating summarizer input text.
// Uses document fields as template variables.
// Same pattern as EmbeddingsConfig template.
Template string `json:"template,omitempty,omitzero"`
}
GraphIndexConfig Configuration for graph index type
type GraphIndexStats ¶
type GraphIndexStats struct {
// BackfillItemsProcessed Number of edges indexed during current rebuild
BackfillItemsProcessed uint64 `json:"backfill_items_processed,omitempty,omitzero"`
// BackfillProgress Rebuild progress as a ratio from 0.0 to 1.0
BackfillProgress float64 `json:"backfill_progress,omitempty,omitzero"`
// EdgeTypes Count of edges per edge type
EdgeTypes map[string]uint64 `json:"edge_types,omitempty,omitzero"`
// Error Error message if stats could not be retrieved
Error string `json:"error,omitempty,omitzero"`
// Rebuilding Whether the index is currently rebuilding
Rebuilding bool `json:"rebuilding,omitempty,omitzero"`
// TotalEdges Total number of edges in the graph
TotalEdges uint64 `json:"total_edges,omitempty,omitzero"`
}
GraphIndexStats Statistics for graph index
type GraphNodeSelector ¶
type GraphNodeSelector struct {
// Keys Explicit list of node keys
Keys []string `json:"keys,omitempty,omitzero"`
// Limit Maximum number of nodes to select from the referenced results
Limit int `json:"limit,omitempty,omitzero"`
// NodeFilter Filter nodes during graph traversal using existing query primitives
NodeFilter NodeFilter `json:"node_filter,omitempty,omitzero"`
// ResultRef Reference to search results to use as nodes:
// - "$full_text_results" - use full-text search results
// - "$embeddings_results.index_name" - use vector search results from specific index
ResultRef string `json:"result_ref,omitempty,omitzero"`
}
GraphNodeSelector Defines how to select start/target nodes for graph queries
type GraphQuery ¶
type GraphQuery struct {
// Fields Which fields to return from documents
Fields []string `json:"fields,omitempty,omitzero"`
// IncludeDocuments Fetch full documents for graph results
IncludeDocuments bool `json:"include_documents,omitempty,omitzero"`
// IncludeEdges Include edge details for each node
IncludeEdges bool `json:"include_edges,omitempty,omitzero"`
// IndexName Graph index name (must be graph type)
IndexName string `json:"index_name"`
// Params Parameters for graph traversal and pathfinding
Params GraphQueryParams `json:"params,omitempty,omitzero"`
// Pattern Pattern steps for pattern query type
Pattern []PatternStep `json:"pattern,omitempty,omitzero"`
// ReturnAliases Which aliases to return from pattern query (empty = all)
ReturnAliases []string `json:"return_aliases,omitempty,omitzero"`
// StartNodes Defines how to select start/target nodes for graph queries
StartNodes GraphNodeSelector `json:"start_nodes,omitempty,omitzero"`
// TargetNodes Defines how to select start/target nodes for graph queries
TargetNodes GraphNodeSelector `json:"target_nodes,omitempty,omitzero"`
// Type Type of graph query to execute
Type GraphQueryType `json:"type"`
}
GraphQuery Declarative graph query to execute after full-text/vector searches
type GraphQueryParams ¶
type GraphQueryParams struct {
// Algorithm Graph algorithm to run (e.g., 'pagerank', 'betweenness')
Algorithm string `json:"algorithm,omitempty,omitzero"`
// AlgorithmParams Parameters for the graph algorithm
AlgorithmParams map[string]interface{} `json:"algorithm_params,omitempty,omitzero"`
// DeduplicateNodes Remove duplicate nodes (traversal)
DeduplicateNodes bool `json:"deduplicate_nodes,omitempty,omitzero"`
// Direction Direction of edges to query:
// - out: Outgoing edges from the node
// - in: Incoming edges to the node
// - both: Both outgoing and incoming edges
Direction EdgeDirection `json:"direction,omitempty,omitzero"`
// EdgeTypes Filter by edge types
EdgeTypes []string `json:"edge_types,omitempty,omitzero"`
// IncludePaths Include path information (traversal)
IncludePaths bool `json:"include_paths,omitempty,omitzero"`
// K Number of paths to find (k-shortest-paths)
K int `json:"k,omitempty,omitzero"`
// MaxDepth Maximum traversal depth
MaxDepth int `json:"max_depth,omitempty,omitzero"`
// MaxResults Maximum number of results (traversal)
MaxResults int `json:"max_results,omitempty,omitzero"`
// MaxWeight Maximum edge weight
MaxWeight float64 `json:"max_weight,omitempty,omitzero"`
// MinWeight Minimum edge weight
MinWeight float64 `json:"min_weight,omitempty,omitzero"`
// NodeFilter Filter nodes during graph traversal using existing query primitives
NodeFilter NodeFilter `json:"node_filter,omitempty,omitzero"`
// WeightMode Path weighting algorithm for pathfinding:
// - min_hops: Minimize number of edges
// - min_weight: Minimize sum of edge weights
// - max_weight: Maximize product of edge weights
WeightMode PathWeightMode `json:"weight_mode,omitempty,omitzero"`
}
GraphQueryParams Parameters for graph traversal and pathfinding
type GraphQueryResult ¶
type GraphQueryResult struct {
// Matches Pattern matches (for pattern queries)
Matches []PatternMatch `json:"matches,omitempty,omitzero"`
// Nodes Result nodes
Nodes []GraphResultNode `json:"nodes,omitempty,omitzero"`
// Paths Result paths (for pathfinding queries)
Paths []Path `json:"paths,omitempty,omitzero"`
// Took Query execution time
Took time.Duration `json:"took,omitempty,omitzero"`
// Total Total number of results
Total int `json:"total"`
// Type Type of graph query to execute
Type GraphQueryType `json:"type"`
}
GraphQueryResult Results of a graph query
type GraphQueryType ¶
type GraphQueryType string
GraphQueryType Type of graph query to execute
const ( GraphQueryTypeKShortestPaths GraphQueryType = "k_shortest_paths" GraphQueryTypeNeighbors GraphQueryType = "neighbors" GraphQueryTypePattern GraphQueryType = "pattern" GraphQueryTypeShortestPath GraphQueryType = "shortest_path" GraphQueryTypeTraverse GraphQueryType = "traverse" )
Defines values for GraphQueryType.
type GraphResultNode ¶
type GraphResultNode struct {
// Depth Distance from start node
Depth int `json:"depth,omitempty,omitzero"`
// Distance Weighted distance
Distance float64 `json:"distance,omitempty,omitzero"`
// Document Full document (if include_documents=true)
Document map[string]interface{} `json:"document,omitempty,omitzero"`
// Edges Connected edges (when include_edges=true)
Edges []Edge `json:"edges,omitempty,omitzero"`
// Key Document key
Key string `json:"key"`
// Path Keys in path from start to this node
Path []string `json:"path,omitempty,omitzero"`
// PathEdges Edges in path from start to this node
PathEdges []PathEdge `json:"path_edges,omitempty,omitzero"`
}
GraphResultNode A node in graph query results
type GroundTruth ¶
type GroundTruth struct {
// Expectations Context for evaluators about what to expect in the response.
// Provides guidance for LLM judges (e.g., "Should mention pricing tiers").
Expectations string `json:"expectations,omitempty,omitzero"`
// RelevantIds Document IDs known to be relevant (for retrieval metrics)
RelevantIds []string `json:"relevant_ids,omitempty,omitzero"`
}
GroundTruth Ground truth data for evaluation
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type IPRangeQuery ¶
type IPRangeQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Cidr string `json:"cidr"`
Field string `json:"field,omitempty,omitzero"`
}
IPRangeQuery defines model for IPRangeQuery.
type IncompleteDetails ¶
type IncompleteDetails struct {
// Reason Why the agent stopped:
// - max_iterations: Hit the configured max_iterations limit
// - max_tokens: LLM output was truncated
// - no_tools: No tools were available for agentic mode
// - clarification_needed: Agent needs user input to proceed
Reason IncompleteDetailsReason `json:"reason"`
}
IncompleteDetails Explains why the agent stopped before completion. Present when status is "incomplete".
type IncompleteDetailsReason ¶
type IncompleteDetailsReason string
IncompleteDetailsReason Why the agent stopped: - max_iterations: Hit the configured max_iterations limit - max_tokens: LLM output was truncated - no_tools: No tools were available for agentic mode - clarification_needed: Agent needs user input to proceed
const ( IncompleteDetailsReasonClarificationNeeded IncompleteDetailsReason = "clarification_needed" IncompleteDetailsReasonMaxIterations IncompleteDetailsReason = "max_iterations" IncompleteDetailsReasonMaxTokens IncompleteDetailsReason = "max_tokens" IncompleteDetailsReasonNoTools IncompleteDetailsReason = "no_tools" )
Defines values for IncompleteDetailsReason.
type IndexConfig ¶
type IndexConfig struct {
// Description Optional description of the index and its purpose
Description string `json:"description,omitempty,omitzero"`
// Enrichments List of enrichment names to apply to documents before indexing. Enrichments must be defined at the table level.
Enrichments []string `json:"enrichments,omitempty,omitzero"`
// Name Name of the index
Name string `json:"name"`
// Type The type of the index.
Type IndexType `json:"type"`
// Version Version of the index implementation. Defaults to 0.
Version int `json:"version,omitempty,omitzero"`
// contains filtered or unexported fields
}
IndexConfig Configuration for an index
func (IndexConfig) AsEmbeddingsIndexConfig ¶
func (t IndexConfig) AsEmbeddingsIndexConfig() (EmbeddingsIndexConfig, error)
AsEmbeddingsIndexConfig returns the union data inside the IndexConfig as a EmbeddingsIndexConfig
func (IndexConfig) AsFullTextIndexConfig ¶
func (t IndexConfig) AsFullTextIndexConfig() (FullTextIndexConfig, error)
AsFullTextIndexConfig returns the union data inside the IndexConfig as a FullTextIndexConfig
func (IndexConfig) AsGraphIndexConfig ¶
func (t IndexConfig) AsGraphIndexConfig() (GraphIndexConfig, error)
AsGraphIndexConfig returns the union data inside the IndexConfig as a GraphIndexConfig
func (*IndexConfig) FromEmbeddingsIndexConfig ¶
func (t *IndexConfig) FromEmbeddingsIndexConfig(v EmbeddingsIndexConfig) error
FromEmbeddingsIndexConfig overwrites any union data inside the IndexConfig as the provided EmbeddingsIndexConfig
func (*IndexConfig) FromFullTextIndexConfig ¶
func (t *IndexConfig) FromFullTextIndexConfig(v FullTextIndexConfig) error
FromFullTextIndexConfig overwrites any union data inside the IndexConfig as the provided FullTextIndexConfig
func (*IndexConfig) FromGraphIndexConfig ¶
func (t *IndexConfig) FromGraphIndexConfig(v GraphIndexConfig) error
FromGraphIndexConfig overwrites any union data inside the IndexConfig as the provided GraphIndexConfig
func (IndexConfig) MarshalJSON ¶
func (t IndexConfig) MarshalJSON() ([]byte, error)
func (*IndexConfig) MergeEmbeddingsIndexConfig ¶
func (t *IndexConfig) MergeEmbeddingsIndexConfig(v EmbeddingsIndexConfig) error
MergeEmbeddingsIndexConfig performs a merge with any union data inside the IndexConfig, using the provided EmbeddingsIndexConfig
func (*IndexConfig) MergeFullTextIndexConfig ¶
func (t *IndexConfig) MergeFullTextIndexConfig(v FullTextIndexConfig) error
MergeFullTextIndexConfig performs a merge with any union data inside the IndexConfig, using the provided FullTextIndexConfig
func (*IndexConfig) MergeGraphIndexConfig ¶
func (t *IndexConfig) MergeGraphIndexConfig(v GraphIndexConfig) error
MergeGraphIndexConfig performs a merge with any union data inside the IndexConfig, using the provided GraphIndexConfig
func (*IndexConfig) UnmarshalJSON ¶
func (t *IndexConfig) UnmarshalJSON(b []byte) error
type IndexStats ¶
type IndexStats struct {
// contains filtered or unexported fields
}
IndexStats Statistics for an index
func (IndexStats) AsEmbeddingsIndexStats ¶
func (t IndexStats) AsEmbeddingsIndexStats() (EmbeddingsIndexStats, error)
AsEmbeddingsIndexStats returns the union data inside the IndexStats as a EmbeddingsIndexStats
func (IndexStats) AsFullTextIndexStats ¶
func (t IndexStats) AsFullTextIndexStats() (FullTextIndexStats, error)
AsFullTextIndexStats returns the union data inside the IndexStats as a FullTextIndexStats
func (IndexStats) AsGraphIndexStats ¶
func (t IndexStats) AsGraphIndexStats() (GraphIndexStats, error)
AsGraphIndexStats returns the union data inside the IndexStats as a GraphIndexStats
func (*IndexStats) FromEmbeddingsIndexStats ¶
func (t *IndexStats) FromEmbeddingsIndexStats(v EmbeddingsIndexStats) error
FromEmbeddingsIndexStats overwrites any union data inside the IndexStats as the provided EmbeddingsIndexStats
func (*IndexStats) FromFullTextIndexStats ¶
func (t *IndexStats) FromFullTextIndexStats(v FullTextIndexStats) error
FromFullTextIndexStats overwrites any union data inside the IndexStats as the provided FullTextIndexStats
func (*IndexStats) FromGraphIndexStats ¶
func (t *IndexStats) FromGraphIndexStats(v GraphIndexStats) error
FromGraphIndexStats overwrites any union data inside the IndexStats as the provided GraphIndexStats
func (IndexStats) MarshalJSON ¶
func (t IndexStats) MarshalJSON() ([]byte, error)
func (*IndexStats) MergeEmbeddingsIndexStats ¶
func (t *IndexStats) MergeEmbeddingsIndexStats(v EmbeddingsIndexStats) error
MergeEmbeddingsIndexStats performs a merge with any union data inside the IndexStats, using the provided EmbeddingsIndexStats
func (*IndexStats) MergeFullTextIndexStats ¶
func (t *IndexStats) MergeFullTextIndexStats(v FullTextIndexStats) error
MergeFullTextIndexStats performs a merge with any union data inside the IndexStats, using the provided FullTextIndexStats
func (*IndexStats) MergeGraphIndexStats ¶
func (t *IndexStats) MergeGraphIndexStats(v GraphIndexStats) error
MergeGraphIndexStats performs a merge with any union data inside the IndexStats, using the provided GraphIndexStats
func (*IndexStats) UnmarshalJSON ¶
func (t *IndexStats) UnmarshalJSON(b []byte) error
type IndexStatus ¶
type IndexStatus struct {
// Config Configuration for an index
Config IndexConfig `json:"config"`
ShardStatus map[string]IndexStats `json:"shard_status"`
// Status Statistics for an index
Status IndexStats `json:"status"`
}
IndexStatus defines model for IndexStatus.
type InternalServerError ¶
type InternalServerError = Error
InternalServerError defines model for InternalServerError.
type JoinClause ¶
type JoinClause struct {
// JoinType Type of join to perform:
// - `inner`: Only return rows with matches in both tables
// - `left`: Return all rows from left table, NULL for non-matching right rows
// - `right`: Return all rows from right table, NULL for non-matching left rows
JoinType JoinType `json:"join_type,omitempty,omitzero"`
// NestedJoin Optional nested join for multi-way joins.
// The nested join operates on the result of the current join.
NestedJoin *JoinClause `json:"nested_join"`
// On Condition for matching rows between tables.
On JoinCondition `json:"on"`
// RightFields Fields to include from the right table in the result.
// If not specified, all fields from the right table are included.
// Fields are prefixed with the right table name in the result.
RightFields []string `json:"right_fields,omitempty,omitzero"`
// RightFilters Filters to apply to a table before joining.
RightFilters JoinFilters `json:"right_filters,omitempty,omitzero"`
// RightTable Name of the table to join with.
RightTable string `json:"right_table"`
// StrategyHint Strategy for executing the join:
// - `broadcast`: Broadcast small table to all shards of large table.
// Best for dimension tables < 10MB. O(small_table) memory per shard.
// - `index_lookup`: Use batch key lookups via indexes.
// Best for selective joins with indexed join keys. Low memory overhead.
// - `shuffle`: Hash-partition both tables by join key.
// Best for large-large table joins. Requires data movement.
StrategyHint JoinStrategy `json:"strategy_hint,omitempty,omitzero"`
}
JoinClause Configuration for joining data from another table. Supports inner, left, and right joins with automatic strategy selection.
type JoinCondition ¶
type JoinCondition struct {
// LeftField Field from the left (primary) table to match on.
LeftField string `json:"left_field"`
// Operator Comparison operator for join condition:
// - `eq`: Equal (default)
// - `neq`: Not equal
// - `lt`: Less than
// - `lte`: Less than or equal
// - `gt`: Greater than
// - `gte`: Greater than or equal
Operator JoinOperator `json:"operator,omitempty,omitzero"`
// RightField Field from the right (joined) table to match on.
RightField string `json:"right_field"`
}
JoinCondition Condition for matching rows between tables.
type JoinFilters ¶
type JoinFilters struct {
// FilterPrefix Key prefix filter for the table.
FilterPrefix []byte `json:"filter_prefix,omitempty,omitzero"`
// FilterQuery Bleve query to filter rows before joining.
FilterQuery json.RawMessage `json:"filter_query,omitempty,omitzero"`
// Limit Maximum number of rows to include from this table.
Limit int `json:"limit,omitempty,omitzero"`
}
JoinFilters Filters to apply to a table before joining.
type JoinOperator ¶
type JoinOperator string
JoinOperator Comparison operator for join condition: - `eq`: Equal (default) - `neq`: Not equal - `lt`: Less than - `lte`: Less than or equal - `gt`: Greater than - `gte`: Greater than or equal
const ( JoinOperatorEq JoinOperator = "eq" JoinOperatorGt JoinOperator = "gt" JoinOperatorGte JoinOperator = "gte" JoinOperatorLt JoinOperator = "lt" JoinOperatorLte JoinOperator = "lte" JoinOperatorNeq JoinOperator = "neq" )
Defines values for JoinOperator.
type JoinResult ¶
type JoinResult struct {
// JoinTimeMs Time spent executing the join in milliseconds.
JoinTimeMs int64 `json:"join_time_ms,omitempty,omitzero"`
// LeftRowsScanned Number of rows scanned from the left table.
LeftRowsScanned int64 `json:"left_rows_scanned,omitempty,omitzero"`
// RightRowsScanned Number of rows scanned from the right table.
RightRowsScanned int64 `json:"right_rows_scanned,omitempty,omitzero"`
// RowsMatched Number of rows that matched the join condition.
RowsMatched int64 `json:"rows_matched,omitempty,omitzero"`
// RowsUnmatchedLeft Number of left rows without a match (for left/full joins).
RowsUnmatchedLeft int64 `json:"rows_unmatched_left,omitempty,omitzero"`
// RowsUnmatchedRight Number of right rows without a match (for right/full joins).
RowsUnmatchedRight int64 `json:"rows_unmatched_right,omitempty,omitzero"`
// StrategyUsed Strategy for executing the join:
// - `broadcast`: Broadcast small table to all shards of large table.
// Best for dimension tables < 10MB. O(small_table) memory per shard.
// - `index_lookup`: Use batch key lookups via indexes.
// Best for selective joins with indexed join keys. Low memory overhead.
// - `shuffle`: Hash-partition both tables by join key.
// Best for large-large table joins. Requires data movement.
StrategyUsed JoinStrategy `json:"strategy_used,omitempty,omitzero"`
}
JoinResult Statistics and metadata about join execution.
type JoinStrategy ¶
type JoinStrategy string
JoinStrategy Strategy for executing the join:
- `broadcast`: Broadcast small table to all shards of large table. Best for dimension tables < 10MB. O(small_table) memory per shard.
- `index_lookup`: Use batch key lookups via indexes. Best for selective joins with indexed join keys. Low memory overhead.
- `shuffle`: Hash-partition both tables by join key. Best for large-large table joins. Requires data movement.
const ( JoinStrategyBroadcast JoinStrategy = "broadcast" JoinStrategyIndexLookup JoinStrategy = "index_lookup" JoinStrategyShuffle JoinStrategy = "shuffle" )
Defines values for JoinStrategy.
type JoinType ¶
type JoinType string
JoinType Type of join to perform: - `inner`: Only return rows with matches in both tables - `left`: Return all rows from left table, NULL for non-matching right rows - `right`: Return all rows from right table, NULL for non-matching left rows
type KeyIdPathParameter ¶
type KeyIdPathParameter = string
KeyIdPathParameter defines model for KeyIdPathParameter.
type KeyRange ¶
type KeyRange struct {
From string `json:"from,omitempty,omitzero"`
To string `json:"to,omitempty,omitzero"`
}
KeyRange Key range processed in this request
type LinearMergeJSONRequestBody ¶
type LinearMergeJSONRequestBody = LinearMergeRequest
LinearMergeJSONRequestBody defines body for LinearMerge for application/json ContentType.
type LinearMergePageStatus ¶
type LinearMergePageStatus string
LinearMergePageStatus Status of a linear merge page operation: - "success": All records in batch processed successfully - "partial": Processing stopped at shard boundary, client should retry with next_cursor - "error": Fatal error occurred, no records processed successfully
const ( LinearMergePageStatusError LinearMergePageStatus = "error" LinearMergePageStatusPartial LinearMergePageStatus = "partial" LinearMergePageStatusSuccess LinearMergePageStatus = "success" )
Defines values for LinearMergePageStatus.
type LinearMergeRequest ¶
type LinearMergeRequest struct {
// DryRun If true, returns what would be deleted without making changes.
//
// Use cases:
// - Validate sync behavior before committing
// - Check which records will be removed
// - Test key range boundaries
//
// Response includes deleted_ids array when dry_run=true.
DryRun bool `json:"dry_run,omitempty,omitzero"`
// LastMergedId ID of last record from previous merge request.
// - First request: Use empty string ""
// - Subsequent requests: Use next_cursor from previous response
// - Defines lower bound of key range to process
//
// This enables pagination for large datasets.
LastMergedId string `json:"last_merged_id,omitempty,omitzero"`
// Records Map of resource ID to resource object: {"resource_id_1": {...}, "resource_id_2": {...}}
//
// Requirements:
// - Keys must be sorted lexicographically by your client
// - Server will process keys in sorted order
// - Use consistent key naming (e.g., all start with same prefix)
//
// This format avoids duplicate IDs and matches Antfly's batch write interface.
Records map[string]interface{} `json:"records"`
// SyncLevel Synchronization level for batch operations:
// - "propose": Wait for Raft proposal acceptance (fastest, default)
// - "write": Wait for Pebble KV write
// - "full_text": Wait for full-text index WAL write
// - "enrichments": Pre-compute enrichments before Raft proposal (synchronous enrichment generation)
// - "aknn": Wait for vector index write with best-effort synchronous embedding (falls back to async on timeout, slowest, most durable)
SyncLevel SyncLevel `json:"sync_level,omitempty,omitzero"`
}
LinearMergeRequest Linear merge operation for syncing sorted records from external sources. Use this to keep Antfly in sync with an external database or data source.
**How it works:** 1. Send sorted records from your external source 2. Server upserts records that exist in your batch 3. Server deletes Antfly records in the key range that are absent from your batch 4. If stopped at shard boundary, use next_cursor for next request
**WARNING:** Not safe for concurrent operations with overlapping key ranges.
type LinearMergeResponse ¶
type LinearMergeResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *LinearMergeResult
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
func ParseLinearMergeResponse ¶
func ParseLinearMergeResponse(rsp *http.Response) (*LinearMergeResponse, error)
ParseLinearMergeResponse parses an HTTP response from a LinearMergeWithResponse call
func (LinearMergeResponse) Status ¶
func (r LinearMergeResponse) Status() string
Status returns HTTPResponse.Status
func (LinearMergeResponse) StatusCode ¶
func (r LinearMergeResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type LinearMergeResult ¶
type LinearMergeResult struct {
// Deleted Records deleted or would be deleted (if dry_run=true)
Deleted int `json:"deleted"`
// DeletedIds IDs that were deleted (or would be deleted if dry_run=true). Only included if dry_run=true.
DeletedIds []string `json:"deleted_ids,omitempty,omitzero"`
Failed []FailedOperation `json:"failed,omitempty,omitzero"`
// KeyRange Key range processed in this request
KeyRange KeyRange `json:"key_range,omitempty,omitzero"`
// KeysScanned Total number of keys scanned from Antfly during range query
KeysScanned int `json:"keys_scanned,omitempty,omitzero"`
// Message Additional information (e.g., "stopped at shard boundary", "dry run - no changes made")
Message string `json:"message,omitempty,omitzero"`
// NextCursor ID of last record in this batch (use for next request)
NextCursor string `json:"next_cursor"`
// Skipped Records skipped because content hash matched (unchanged)
Skipped int `json:"skipped"`
// Status Status of a linear merge page operation:
// - "success": All records in batch processed successfully
// - "partial": Processing stopped at shard boundary, client should retry with next_cursor
// - "error": Fatal error occurred, no records processed successfully
Status LinearMergePageStatus `json:"status"`
Took time.Duration `json:"took,omitempty,omitzero"`
// Upserted Records inserted or updated (0 if dry_run=true)
Upserted int `json:"upserted"`
}
LinearMergeResult defines model for LinearMergeResult.
type ListApiKeysResponse ¶
type ListApiKeysResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]ApiKey
JSON401 *Error
JSON404 *Error
JSON500 *Error
}
func ParseListApiKeysResponse ¶
func ParseListApiKeysResponse(rsp *http.Response) (*ListApiKeysResponse, error)
ParseListApiKeysResponse parses an HTTP response from a ListApiKeysWithResponse call
func (ListApiKeysResponse) Status ¶
func (r ListApiKeysResponse) Status() string
Status returns HTTPResponse.Status
func (ListApiKeysResponse) StatusCode ¶
func (r ListApiKeysResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListBackupsParams ¶
type ListBackupsParams struct {
// Location Storage location to search for backups.
// - Local filesystem: `file:///path/to/backup`
// - Amazon S3: `s3://bucket-name/path/to/backup`
Location string `form:"location" json:"location"`
}
ListBackupsParams defines parameters for ListBackups.
type ListBackupsResponse ¶
type ListBackupsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *BackupListResponse
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseListBackupsResponse ¶
func ParseListBackupsResponse(rsp *http.Response) (*ListBackupsResponse, error)
ParseListBackupsResponse parses an HTTP response from a ListBackupsWithResponse call
func (ListBackupsResponse) Status ¶
func (r ListBackupsResponse) Status() string
Status returns HTTPResponse.Status
func (ListBackupsResponse) StatusCode ¶
func (r ListBackupsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListIndexesResponse ¶
type ListIndexesResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]IndexStatus
JSON404 *NotFound
JSON500 *InternalServerError
}
func ParseListIndexesResponse ¶
func ParseListIndexesResponse(rsp *http.Response) (*ListIndexesResponse, error)
ParseListIndexesResponse parses an HTTP response from a ListIndexesWithResponse call
func (ListIndexesResponse) Status ¶
func (r ListIndexesResponse) Status() string
Status returns HTTPResponse.Status
func (ListIndexesResponse) StatusCode ¶
func (r ListIndexesResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListSecretsResponse ¶
type ListSecretsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *SecretList
JSON401 *Error
JSON500 *InternalServerError
}
func ParseListSecretsResponse ¶
func ParseListSecretsResponse(rsp *http.Response) (*ListSecretsResponse, error)
ParseListSecretsResponse parses an HTTP response from a ListSecretsWithResponse call
func (ListSecretsResponse) Status ¶
func (r ListSecretsResponse) Status() string
Status returns HTTPResponse.Status
func (ListSecretsResponse) StatusCode ¶
func (r ListSecretsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListTablesParams ¶
type ListTablesParams struct {
// Prefix Filter tables by name prefix (e.g., "prod_")
Prefix string `form:"prefix,omitempty" json:"prefix,omitempty,omitzero"`
// Pattern Filter tables by regex pattern (e.g., "^prod_.*_v[0-9]+$")
Pattern string `form:"pattern,omitempty" json:"pattern,omitempty,omitzero"`
}
ListTablesParams defines parameters for ListTables.
type ListTablesResponse ¶
type ListTablesResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]TableStatus
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseListTablesResponse ¶
func ParseListTablesResponse(rsp *http.Response) (*ListTablesResponse, error)
ParseListTablesResponse parses an HTTP response from a ListTablesWithResponse call
func (ListTablesResponse) Status ¶
func (r ListTablesResponse) Status() string
Status returns HTTPResponse.Status
func (ListTablesResponse) StatusCode ¶
func (r ListTablesResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ListUsersResponse ¶
type ListUsersResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]struct {
Username string `json:"username,omitempty,omitzero"`
}
JSON401 *Error
JSON403 *Error
JSON500 *Error
}
func ParseListUsersResponse ¶
func ParseListUsersResponse(rsp *http.Response) (*ListUsersResponse, error)
ParseListUsersResponse parses an HTTP response from a ListUsersWithResponse call
func (ListUsersResponse) Status ¶
func (r ListUsersResponse) Status() string
Status returns HTTPResponse.Status
func (ListUsersResponse) StatusCode ¶
func (r ListUsersResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type LookupKeyParams ¶
type LookupKeyParams struct {
// Fields Comma-separated list of fields to include in the response.
// If not specified, returns the full document. Supports:
// - Simple fields: "title,author"
// - Nested paths: "user.address.city"
// - Wildcards: "_chunks.*"
// - Exclusions: "-_chunks.*._embedding"
// - Special fields: "_embeddings,_summaries,_chunks"
Fields string `form:"fields,omitempty" json:"fields,omitempty,omitzero"`
}
LookupKeyParams defines parameters for LookupKey.
type LookupKeyResponse ¶
type LookupKeyResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *map[string]interface{}
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
func ParseLookupKeyResponse ¶
func ParseLookupKeyResponse(rsp *http.Response) (*LookupKeyResponse, error)
ParseLookupKeyResponse parses an HTTP response from a LookupKeyWithResponse call
func (LookupKeyResponse) Status ¶
func (r LookupKeyResponse) Status() string
Status returns HTTPResponse.Status
func (LookupKeyResponse) StatusCode ¶
func (r LookupKeyResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type MatchAllQuery ¶
type MatchAllQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
MatchAll map[string]interface{} `json:"match_all"`
}
MatchAllQuery defines model for MatchAllQuery.
type MatchNoneQuery ¶
type MatchNoneQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
MatchNone map[string]interface{} `json:"match_none"`
}
MatchNoneQuery defines model for MatchNoneQuery.
type MatchPhraseQuery ¶
type MatchPhraseQuery struct {
Analyzer string `json:"analyzer,omitempty,omitzero"`
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
// Fuzziness The fuzziness of the query. Can be an integer or "auto".
Fuzziness Fuzziness `json:"fuzziness,omitempty,omitzero"`
MatchPhrase string `json:"match_phrase"`
}
MatchPhraseQuery defines model for MatchPhraseQuery.
type MatchQuery ¶
type MatchQuery struct {
Analyzer string `json:"analyzer,omitempty,omitzero"`
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
// Fuzziness The fuzziness of the query. Can be an integer or "auto".
Fuzziness Fuzziness `json:"fuzziness,omitempty,omitzero"`
Match string `json:"match"`
Operator MatchQueryOperator `json:"operator,omitempty,omitzero"`
PrefixLength int32 `json:"prefix_length,omitempty,omitzero"`
}
MatchQuery defines model for MatchQuery.
type MatchQueryOperator ¶
type MatchQueryOperator string
MatchQueryOperator defines model for MatchQuery.Operator.
const ( MatchQueryOperatorAnd MatchQueryOperator = "and" MatchQueryOperatorOr MatchQueryOperator = "or" )
Defines values for MatchQueryOperator.
type MergeConfig ¶
type MergeConfig struct {
// RankConstant RRF k constant (1/(k+rank)). Defaults to 60.0.
RankConstant float64 `json:"rank_constant,omitempty,omitzero"`
// Strategy Merge strategy for combining results from the semantic_search and full_text_search.
// rrf: Reciprocal Rank Fusion - combines scores using reciprocal rank formula
// rsf: Relative Score Fusion - normalizes scores by min/max within a window and combines weighted scores
// failover: Use full_text_search if embedding generation fails
Strategy MergeStrategy `json:"strategy,omitempty,omitzero"`
// Weights Named weights keyed by index name. `full_text` for the full-text search index;
// embedding index names for vector indexes.
// Unspecified indexes default to 1.0. Applied in both RRF and RSF.
Weights map[string]float64 `json:"weights,omitempty,omitzero"`
// WindowSize RSF normalization window size. Defaults to `limit`.
WindowSize int `json:"window_size,omitempty,omitzero"`
}
MergeConfig Configuration for result fusion when combining multiple search indexes.
type MergeStrategy ¶
type MergeStrategy string
MergeStrategy Merge strategy for combining results from the semantic_search and full_text_search. rrf: Reciprocal Rank Fusion - combines scores using reciprocal rank formula rsf: Relative Score Fusion - normalizes scores by min/max within a window and combines weighted scores failover: Use full_text_search if embedding generation fails
const ( MergeStrategyFailover MergeStrategy = "failover" MergeStrategyRrf MergeStrategy = "rrf" MergeStrategyRsf MergeStrategy = "rsf" )
Defines values for MergeStrategy.
type MultiBatchRequest ¶
type MultiBatchRequest struct {
// SyncLevel Synchronization level for batch operations:
// - "propose": Wait for Raft proposal acceptance (fastest, default)
// - "write": Wait for Pebble KV write
// - "full_text": Wait for full-text index WAL write
// - "enrichments": Pre-compute enrichments before Raft proposal (synchronous enrichment generation)
// - "aknn": Wait for vector index write with best-effort synchronous embedding (falls back to async on timeout, slowest, most durable)
SyncLevel SyncLevel `json:"sync_level,omitempty,omitzero"`
// Tables Map of table names to batch operations for that table.
// Each entry follows the same format as a single-table BatchRequest.
Tables map[string]BatchRequest `json:"tables"`
}
MultiBatchRequest Cross-table batch operations in a single atomic transaction.
Groups batch operations by table name. All operations across all tables are committed atomically using distributed 2-phase commit (2PC).
**Atomicity**: Either all operations across all tables succeed, or none do. This enables use cases like transferring a record from one table to another, or maintaining referential integrity across tables.
type MultiBatchResponse ¶
type MultiBatchResponse struct {
// Tables Per-table batch results
Tables map[string]BatchResponse `json:"tables,omitempty,omitzero"`
}
MultiBatchResponse Response for a cross-table batch operation. Contains per-table results.
type MultiBatchWriteJSONRequestBody ¶
type MultiBatchWriteJSONRequestBody = MultiBatchRequest
MultiBatchWriteJSONRequestBody defines body for MultiBatchWrite for application/json ContentType.
type MultiBatchWriteResponse ¶
type MultiBatchWriteResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *MultiBatchResponse
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
func ParseMultiBatchWriteResponse ¶
func ParseMultiBatchWriteResponse(rsp *http.Response) (*MultiBatchWriteResponse, error)
ParseMultiBatchWriteResponse parses an HTTP response from a MultiBatchWriteWithResponse call
func (MultiBatchWriteResponse) Status ¶
func (r MultiBatchWriteResponse) Status() string
Status returns HTTPResponse.Status
func (MultiBatchWriteResponse) StatusCode ¶
func (r MultiBatchWriteResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type MultiPhraseQuery ¶
type MultiPhraseQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
// Fuzziness The fuzziness of the query. Can be an integer or "auto".
Fuzziness Fuzziness `json:"fuzziness,omitempty,omitzero"`
Terms [][]string `json:"terms"`
}
MultiPhraseQuery defines model for MultiPhraseQuery.
type NodeFilter ¶
type NodeFilter struct {
// FilterPrefix Filter by key prefix
FilterPrefix string `json:"filter_prefix,omitempty,omitzero"`
// FilterQuery Bleve query to filter nodes (same syntax as search filter_query)
FilterQuery map[string]interface{} `json:"filter_query,omitempty,omitzero"`
}
NodeFilter Filter nodes during graph traversal using existing query primitives
type NumericRangeQuery ¶
type NumericRangeQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
InclusiveMax bool `json:"inclusive_max,omitzero"`
InclusiveMin bool `json:"inclusive_min,omitzero"`
Max float64 `json:"max,omitzero"`
Min float64 `json:"min,omitzero"`
}
NumericRangeQuery defines model for NumericRangeQuery.
type OllamaEmbedderConfig ¶
type OllamaEmbedderConfig struct {
// Model The name of the Ollama model to use (e.g., 'nomic-embed-text', 'mxbai-embed-large').
Model string `json:"model"`
// Url The URL of the Ollama API endpoint. Can also be set via OLLAMA_HOST environment variable.
Url string `json:"url,omitempty,omitzero"`
}
OllamaEmbedderConfig Configuration for the Ollama embedding provider.
Local embeddings for privacy and offline use. URL via `url` field or `OLLAMA_HOST` env var.
**Example Models:** nomic-embed-text (768 dims), mxbai-embed-large (1024 dims), all-minilm (384 dims)
**Docs:** https://ollama.com/search?c=embedding
type OllamaGeneratorConfig ¶
type OllamaGeneratorConfig struct {
// MaxTokens Maximum number of tokens to generate.
MaxTokens int `json:"max_tokens,omitempty,omitzero"`
// Model The name of the Ollama model to use (e.g., 'llama3.3:70b', 'qwen2.5:72b', 'deepseek-coder:33b').
Model string `json:"model"`
// Temperature Controls randomness in generation (0.0-2.0).
Temperature float32 `json:"temperature,omitempty,omitzero"`
// Timeout HTTP response timeout in seconds for Ollama API calls. Defaults to 540 (9 minutes). Increase for large models on slow hardware.
Timeout int `json:"timeout,omitempty,omitzero"`
// TopK Top-k sampling parameter.
TopK int `json:"top_k,omitempty,omitzero"`
// TopP Nucleus sampling parameter.
TopP float32 `json:"top_p,omitempty,omitzero"`
// Url The URL of the Ollama API endpoint.
Url string `json:"url,omitempty,omitzero"`
}
OllamaGeneratorConfig Configuration for the Ollama generative AI provider.
Ollama provides local LLM inference for privacy and offline use.
**Example Models:** llama3.3:70b, qwen2.5:72b, deepseek-r1:70b, mistral:7b, llava:34b
**Docs:** https://ollama.com/library
type OllamaRerankerConfig ¶
type OllamaRerankerConfig struct {
// Model The name of the Ollama model to use for reranking.
Model string `json:"model"`
// Url The URL of the Ollama API endpoint.
Url string `json:"url,omitempty,omitzero"`
}
OllamaRerankerConfig Configuration for the Ollama reranking provider.
type OpenAIEmbedderConfig ¶
type OpenAIEmbedderConfig struct {
// ApiKey The OpenAI API key. Can also be set via OPENAI_API_KEY environment variable.
ApiKey string `json:"api_key,omitempty,omitzero"`
// Dimensions Output dimension for the embedding (uses MRL for dimension reduction). Recommended: 256, 512, 1024, 1536, or 3072.
Dimensions int `json:"dimensions,omitempty,omitzero"`
// Model The name of the OpenAI model to use.
Model string `json:"model"`
// Url The URL of the OpenAI API endpoint. Defaults to OpenAI's API. Can be set via OPENAI_BASE_URL environment variable.
Url string `json:"url,omitempty,omitzero"`
}
OpenAIEmbedderConfig Configuration for the OpenAI embedding provider.
API key via `api_key` field or `OPENAI_API_KEY` environment variable. Supports OpenAI-compatible APIs via `url` field.
**Example Models:** text-embedding-3-small (default, 1536 dims), text-embedding-3-large (3072 dims)
**Docs:** https://platform.openai.com/docs/guides/embeddings
type OpenAIGeneratorConfig ¶
type OpenAIGeneratorConfig struct {
// ApiKey The OpenAI API key.
ApiKey string `json:"api_key,omitempty,omitzero"`
// FrequencyPenalty Penalty for token frequency (-2.0 to 2.0).
FrequencyPenalty float32 `json:"frequency_penalty,omitempty,omitzero"`
// MaxTokens Maximum number of tokens to generate.
MaxTokens int `json:"max_tokens,omitempty,omitzero"`
// Model The name of the OpenAI model to use (e.g., 'gpt-4.1', 'gpt-4.1-mini', 'o4-mini').
Model string `json:"model"`
// PresencePenalty Penalty for token presence (-2.0 to 2.0).
PresencePenalty float32 `json:"presence_penalty,omitempty,omitzero"`
// Temperature Controls randomness in generation (0.0-2.0).
Temperature float32 `json:"temperature,omitempty,omitzero"`
// TopP Nucleus sampling parameter.
TopP float32 `json:"top_p,omitempty,omitzero"`
// Url The URL of the OpenAI API endpoint.
Url string `json:"url,omitempty,omitzero"`
}
OpenAIGeneratorConfig Configuration for the OpenAI generative AI provider.
**Example Models:** gpt-4.1 (default), gpt-4.1-mini, o3, o4-mini
**Docs:** https://platform.openai.com/docs/models
type OpenRouterEmbedderConfig ¶
type OpenRouterEmbedderConfig struct {
// ApiKey The OpenRouter API key. Can also be set via OPENROUTER_API_KEY environment variable.
ApiKey string `json:"api_key,omitempty,omitzero"`
// Dimensions Output dimension for the embedding (if supported by the model).
Dimensions int `json:"dimensions,omitempty,omitzero"`
// Model The OpenRouter model identifier (e.g., 'openai/text-embedding-3-small', 'google/gemini-embedding-001').
Model string `json:"model"`
}
OpenRouterEmbedderConfig Configuration for the OpenRouter embedding provider.
OpenRouter provides a unified API for multiple embedding models from different providers. API key via `api_key` field or `OPENROUTER_API_KEY` environment variable.
**Example Models:** openai/text-embedding-3-small (default), openai/text-embedding-3-large, google/gemini-embedding-001, qwen/qwen3-embedding-8b
**Docs:** https://openrouter.ai/docs/api/reference/embeddings
type OpenRouterGeneratorConfig ¶
type OpenRouterGeneratorConfig struct {
// ApiKey The OpenRouter API key. Can also be set via OPENROUTER_API_KEY environment variable.
ApiKey string `json:"api_key,omitempty,omitzero"`
// FrequencyPenalty Penalty for token frequency (-2.0 to 2.0).
FrequencyPenalty float32 `json:"frequency_penalty,omitempty,omitzero"`
// MaxTokens Maximum number of tokens to generate in the response.
MaxTokens int `json:"max_tokens,omitempty,omitzero"`
// Model Single model identifier (e.g., 'openai/gpt-4.1'). Either model or models must be provided.
Model string `json:"model,omitempty,omitzero"`
// Models Array of model identifiers for fallback routing. OpenRouter tries each model in order
// until one succeeds. Either model or models must be provided.
Models []string `json:"models,omitempty,omitzero"`
// PresencePenalty Penalty for token presence (-2.0 to 2.0).
PresencePenalty float32 `json:"presence_penalty,omitempty,omitzero"`
// Temperature Controls randomness in generation (0.0-2.0). Higher values make output more random.
Temperature float32 `json:"temperature,omitempty,omitzero"`
// TopP Nucleus sampling parameter (0.0-1.0). Alternative to temperature.
TopP float32 `json:"top_p,omitempty,omitzero"`
}
OpenRouterGeneratorConfig Configuration for the OpenRouter generative AI provider.
OpenRouter provides a unified API for multiple LLM providers with automatic fallback routing. API key via `api_key` field or `OPENROUTER_API_KEY` environment variable.
**Model Selection:** - Use `model` for a single model (e.g., "openai/gpt-4.1", "anthropic/claude-sonnet-4-5-20250929") - Use `models` array for fallback routing - OpenRouter tries models in order until one succeeds
**Example Models:** openai/gpt-4.1, anthropic/claude-sonnet-4-5-20250929, google/gemini-2.5-flash, meta-llama/llama-3.3-70b-instruct
**Docs:** https://openrouter.ai/docs/api/api-reference/chat/send-chat-completion-request
type Path ¶
type Path struct {
Edges []PathEdge `json:"edges,omitempty,omitzero"`
Length int `json:"length,omitempty,omitzero"`
// Nodes Ordered list of node keys (base64-encoded)
Nodes []string `json:"nodes,omitempty,omitzero"`
TotalWeight float64 `json:"total_weight,omitempty,omitzero"`
}
Path defines model for Path.
type PathEdge ¶
type PathEdge struct {
Metadata map[string]interface{} `json:"metadata,omitempty,omitzero"`
Source string `json:"source,omitempty,omitzero"`
Target string `json:"target,omitempty,omitzero"`
Type string `json:"type,omitempty,omitzero"`
Weight float64 `json:"weight,omitempty,omitzero"`
}
PathEdge defines model for PathEdge.
type PathFindRequest ¶
type PathFindRequest struct {
// Direction Direction of edges to query:
// - out: Outgoing edges from the node
// - in: Incoming edges to the node
// - both: Both outgoing and incoming edges
Direction EdgeDirection `json:"direction,omitempty,omitzero"`
// EdgeTypes Filter by specific edge types
EdgeTypes []string `json:"edge_types,omitempty,omitzero"`
K int `json:"k,omitempty,omitzero"`
MaxDepth int `json:"max_depth,omitempty,omitzero"`
MaxWeight float64 `json:"max_weight,omitempty,omitzero"`
MinWeight float64 `json:"min_weight,omitempty,omitzero"`
// Source Source node key (base64-encoded)
Source string `json:"source"`
// Target Target node key (base64-encoded)
Target string `json:"target"`
// WeightMode Algorithm for path finding:
// - min_hops: Shortest path by hop count (breadth-first search, ignores weights)
// - max_weight: Path with maximum product of edge weights (strongest connection chain)
// - min_weight: Path with minimum sum of edge weights (lowest cost route)
WeightMode PathFindWeightMode `json:"weight_mode,omitempty,omitzero"`
}
PathFindRequest defines model for PathFindRequest.
type PathFindResult ¶
type PathFindResult struct {
Paths []Path `json:"paths,omitempty,omitzero"`
PathsFound int `json:"paths_found,omitempty,omitzero"`
SearchTimeMs float64 `json:"search_time_ms,omitempty,omitzero"`
Source string `json:"source,omitempty,omitzero"`
Target string `json:"target,omitempty,omitzero"`
// WeightMode Algorithm for path finding:
// - min_hops: Shortest path by hop count (breadth-first search, ignores weights)
// - max_weight: Path with maximum product of edge weights (strongest connection chain)
// - min_weight: Path with minimum sum of edge weights (lowest cost route)
WeightMode PathFindWeightMode `json:"weight_mode,omitempty,omitzero"`
}
PathFindResult defines model for PathFindResult.
type PathFindWeightMode ¶
type PathFindWeightMode string
PathFindWeightMode Algorithm for path finding: - min_hops: Shortest path by hop count (breadth-first search, ignores weights) - max_weight: Path with maximum product of edge weights (strongest connection chain) - min_weight: Path with minimum sum of edge weights (lowest cost route)
const ( PathFindWeightModeMaxWeight PathFindWeightMode = "max_weight" PathFindWeightModeMinHops PathFindWeightMode = "min_hops" PathFindWeightModeMinWeight PathFindWeightMode = "min_weight" )
Defines values for PathFindWeightMode.
type PathWeightMode ¶
type PathWeightMode string
PathWeightMode Path weighting algorithm for pathfinding: - min_hops: Minimize number of edges - min_weight: Minimize sum of edge weights - max_weight: Maximize product of edge weights
const ( PathWeightModeMaxWeight PathWeightMode = "max_weight" PathWeightModeMinHops PathWeightMode = "min_hops" PathWeightModeMinWeight PathWeightMode = "min_weight" )
Defines values for PathWeightMode.
type PatternEdgeStep ¶
type PatternEdgeStep struct {
// Direction Direction of edges to query:
// - out: Outgoing edges from the node
// - in: Incoming edges to the node
// - both: Both outgoing and incoming edges
Direction EdgeDirection `json:"direction,omitempty,omitzero"`
// MaxHops Maximum number of hops (>1 = variable-length path)
MaxHops int `json:"max_hops,omitempty,omitzero"`
// MaxWeight Maximum edge weight filter
MaxWeight float64 `json:"max_weight,omitempty,omitzero"`
// MinHops Minimum number of hops (1 = direct edge)
MinHops int `json:"min_hops,omitempty,omitzero"`
// MinWeight Minimum edge weight filter
MinWeight float64 `json:"min_weight,omitempty,omitzero"`
// Types Edge types to traverse (empty = any)
Types []string `json:"types,omitempty,omitzero"`
}
PatternEdgeStep Edge constraints in a pattern step
type PatternMatch ¶
type PatternMatch struct {
// Bindings Map of alias to matched node
Bindings map[string]GraphResultNode `json:"bindings,omitempty,omitzero"`
// Path Edges traversed in this match
Path []PathEdge `json:"path,omitempty,omitzero"`
}
PatternMatch A single match from a pattern query
type PatternStep ¶
type PatternStep struct {
// Alias Name for this node (reuse alias for cycle detection)
Alias string `json:"alias,omitempty,omitzero"`
// Edge Edge constraints in a pattern step
Edge PatternEdgeStep `json:"edge,omitempty,omitzero"`
// NodeFilter Filter nodes during graph traversal using existing query primitives
NodeFilter NodeFilter `json:"node_filter,omitempty,omitzero"`
}
PatternStep A step in a graph pattern query
type Permission ¶
type Permission struct {
// Resource Resource name (e.g., table name, target username, or '*' for global).
Resource string `json:"resource"`
// ResourceType Type of the resource, e.g., table, user, or global ('*').
ResourceType ResourceType `json:"resource_type"`
// Type Type of permission.
Type PermissionType `json:"type"`
}
Permission defines model for Permission.
type PermissionType ¶
type PermissionType string
PermissionType Type of permission.
const ( PermissionTypeAdmin PermissionType = "admin" PermissionTypeRead PermissionType = "read" PermissionTypeWrite PermissionType = "write" )
Defines values for PermissionType.
type PhraseQuery ¶
type PhraseQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
// Fuzziness The fuzziness of the query. Can be an integer or "auto".
Fuzziness Fuzziness `json:"fuzziness,omitempty,omitzero"`
Terms []string `json:"terms"`
}
PhraseQuery defines model for PhraseQuery.
type PrefixQuery ¶
type PrefixQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
Prefix string `json:"prefix"`
}
PrefixQuery defines model for PrefixQuery.
type PruneStats ¶
type PruneStats struct {
// ResourcesKept Number of resources kept after pruning
ResourcesKept int `json:"resources_kept,omitempty,omitzero"`
// ResourcesPruned Number of resources pruned to fit token budget
ResourcesPruned int `json:"resources_pruned,omitempty,omitzero"`
// TokensKept Estimated tokens in kept resources
TokensKept int `json:"tokens_kept,omitempty,omitzero"`
// TokensPruned Estimated tokens in pruned resources
TokensPruned int `json:"tokens_pruned,omitempty,omitzero"`
}
PruneStats Statistics from token-based document pruning
type Pruner ¶
type Pruner struct {
// MaxScoreGapPercent Stop returning results when score drops more than this percentage
// from the previous result. Detects "elbows" in score distribution.
// For example, 30.0 stops when score drops 30% from previous result.
MaxScoreGapPercent float64 `json:"max_score_gap_percent,omitempty,omitzero"`
// MinAbsoluteScore Hard minimum score threshold. Results with scores below this value
// are excluded regardless of other pruning settings.
MinAbsoluteScore float64 `json:"min_absolute_score,omitempty,omitzero"`
// MinScoreRatio Keep only results with score >= max_score * min_score_ratio.
// For example, 0.5 keeps results scoring at least half of the top result.
// Applied after fusion scoring.
MinScoreRatio float64 `json:"min_score_ratio,omitempty,omitzero"`
// RequireMultiIndex Only keep results that appear in multiple indexes (both full-text
// and vector search). Useful for increasing precision by requiring
// agreement between different retrieval methods.
RequireMultiIndex bool `json:"require_multi_index,omitempty,omitzero"`
// StdDevThreshold Keep results within N standard deviations below the mean score.
// For example, 1.0 keeps results with score >= mean - 1*stddev.
// Useful for statistical outlier detection in result sets.
StdDevThreshold float64 `json:"std_dev_threshold,omitempty,omitzero"`
}
Pruner Configuration for pruning search results based on score quality. Helps filter out low-relevance results in RAG pipelines by detecting score gaps or deviations from top results.
type PutSecretJSONRequestBody ¶
type PutSecretJSONRequestBody = SecretWriteRequest
PutSecretJSONRequestBody defines body for PutSecret for application/json ContentType.
type PutSecretResponse ¶
type PutSecretResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *SecretEntry
JSON400 *BadRequest
JSON401 *Error
JSON503 *Error
}
func ParsePutSecretResponse ¶
func ParsePutSecretResponse(rsp *http.Response) (*PutSecretResponse, error)
ParsePutSecretResponse parses an HTTP response from a PutSecretWithResponse call
func (PutSecretResponse) Status ¶
func (r PutSecretResponse) Status() string
Status returns HTTPResponse.Status
func (PutSecretResponse) StatusCode ¶
func (r PutSecretResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query defines model for Query.
func (Query) AsBoolFieldQuery ¶
func (t Query) AsBoolFieldQuery() (BoolFieldQuery, error)
AsBoolFieldQuery returns the union data inside the Query as a BoolFieldQuery
func (Query) AsBooleanQuery ¶
func (t Query) AsBooleanQuery() (BooleanQuery, error)
AsBooleanQuery returns the union data inside the Query as a BooleanQuery
func (Query) AsConjunctionQuery ¶
func (t Query) AsConjunctionQuery() (ConjunctionQuery, error)
AsConjunctionQuery returns the union data inside the Query as a ConjunctionQuery
func (Query) AsDateRangeStringQuery ¶
func (t Query) AsDateRangeStringQuery() (DateRangeStringQuery, error)
AsDateRangeStringQuery returns the union data inside the Query as a DateRangeStringQuery
func (Query) AsDisjunctionQuery ¶
func (t Query) AsDisjunctionQuery() (DisjunctionQuery, error)
AsDisjunctionQuery returns the union data inside the Query as a DisjunctionQuery
func (Query) AsDocIdQuery ¶
func (t Query) AsDocIdQuery() (DocIdQuery, error)
AsDocIdQuery returns the union data inside the Query as a DocIdQuery
func (Query) AsFuzzyQuery ¶
func (t Query) AsFuzzyQuery() (FuzzyQuery, error)
AsFuzzyQuery returns the union data inside the Query as a FuzzyQuery
func (Query) AsGeoBoundingBoxQuery ¶
func (t Query) AsGeoBoundingBoxQuery() (GeoBoundingBoxQuery, error)
AsGeoBoundingBoxQuery returns the union data inside the Query as a GeoBoundingBoxQuery
func (Query) AsGeoBoundingPolygonQuery ¶
func (t Query) AsGeoBoundingPolygonQuery() (GeoBoundingPolygonQuery, error)
AsGeoBoundingPolygonQuery returns the union data inside the Query as a GeoBoundingPolygonQuery
func (Query) AsGeoDistanceQuery ¶
func (t Query) AsGeoDistanceQuery() (GeoDistanceQuery, error)
AsGeoDistanceQuery returns the union data inside the Query as a GeoDistanceQuery
func (Query) AsGeoShapeQuery ¶
func (t Query) AsGeoShapeQuery() (GeoShapeQuery, error)
AsGeoShapeQuery returns the union data inside the Query as a GeoShapeQuery
func (Query) AsIPRangeQuery ¶
func (t Query) AsIPRangeQuery() (IPRangeQuery, error)
AsIPRangeQuery returns the union data inside the Query as a IPRangeQuery
func (Query) AsMatchAllQuery ¶
func (t Query) AsMatchAllQuery() (MatchAllQuery, error)
AsMatchAllQuery returns the union data inside the Query as a MatchAllQuery
func (Query) AsMatchNoneQuery ¶
func (t Query) AsMatchNoneQuery() (MatchNoneQuery, error)
AsMatchNoneQuery returns the union data inside the Query as a MatchNoneQuery
func (Query) AsMatchPhraseQuery ¶
func (t Query) AsMatchPhraseQuery() (MatchPhraseQuery, error)
AsMatchPhraseQuery returns the union data inside the Query as a MatchPhraseQuery
func (Query) AsMatchQuery ¶
func (t Query) AsMatchQuery() (MatchQuery, error)
AsMatchQuery returns the union data inside the Query as a MatchQuery
func (Query) AsMultiPhraseQuery ¶
func (t Query) AsMultiPhraseQuery() (MultiPhraseQuery, error)
AsMultiPhraseQuery returns the union data inside the Query as a MultiPhraseQuery
func (Query) AsNumericRangeQuery ¶
func (t Query) AsNumericRangeQuery() (NumericRangeQuery, error)
AsNumericRangeQuery returns the union data inside the Query as a NumericRangeQuery
func (Query) AsPhraseQuery ¶
func (t Query) AsPhraseQuery() (PhraseQuery, error)
AsPhraseQuery returns the union data inside the Query as a PhraseQuery
func (Query) AsPrefixQuery ¶
func (t Query) AsPrefixQuery() (PrefixQuery, error)
AsPrefixQuery returns the union data inside the Query as a PrefixQuery
func (Query) AsQueryStringQuery ¶
func (t Query) AsQueryStringQuery() (QueryStringQuery, error)
AsQueryStringQuery returns the union data inside the Query as a QueryStringQuery
func (Query) AsRegexpQuery ¶
func (t Query) AsRegexpQuery() (RegexpQuery, error)
AsRegexpQuery returns the union data inside the Query as a RegexpQuery
func (Query) AsTermQuery ¶
AsTermQuery returns the union data inside the Query as a TermQuery
func (Query) AsTermRangeQuery ¶
func (t Query) AsTermRangeQuery() (TermRangeQuery, error)
AsTermRangeQuery returns the union data inside the Query as a TermRangeQuery
func (Query) AsWildcardQuery ¶
func (t Query) AsWildcardQuery() (WildcardQuery, error)
AsWildcardQuery returns the union data inside the Query as a WildcardQuery
func (*Query) FromBoolFieldQuery ¶
func (t *Query) FromBoolFieldQuery(v BoolFieldQuery) error
FromBoolFieldQuery overwrites any union data inside the Query as the provided BoolFieldQuery
func (*Query) FromBooleanQuery ¶
func (t *Query) FromBooleanQuery(v BooleanQuery) error
FromBooleanQuery overwrites any union data inside the Query as the provided BooleanQuery
func (*Query) FromConjunctionQuery ¶
func (t *Query) FromConjunctionQuery(v ConjunctionQuery) error
FromConjunctionQuery overwrites any union data inside the Query as the provided ConjunctionQuery
func (*Query) FromDateRangeStringQuery ¶
func (t *Query) FromDateRangeStringQuery(v DateRangeStringQuery) error
FromDateRangeStringQuery overwrites any union data inside the Query as the provided DateRangeStringQuery
func (*Query) FromDisjunctionQuery ¶
func (t *Query) FromDisjunctionQuery(v DisjunctionQuery) error
FromDisjunctionQuery overwrites any union data inside the Query as the provided DisjunctionQuery
func (*Query) FromDocIdQuery ¶
func (t *Query) FromDocIdQuery(v DocIdQuery) error
FromDocIdQuery overwrites any union data inside the Query as the provided DocIdQuery
func (*Query) FromFuzzyQuery ¶
func (t *Query) FromFuzzyQuery(v FuzzyQuery) error
FromFuzzyQuery overwrites any union data inside the Query as the provided FuzzyQuery
func (*Query) FromGeoBoundingBoxQuery ¶
func (t *Query) FromGeoBoundingBoxQuery(v GeoBoundingBoxQuery) error
FromGeoBoundingBoxQuery overwrites any union data inside the Query as the provided GeoBoundingBoxQuery
func (*Query) FromGeoBoundingPolygonQuery ¶
func (t *Query) FromGeoBoundingPolygonQuery(v GeoBoundingPolygonQuery) error
FromGeoBoundingPolygonQuery overwrites any union data inside the Query as the provided GeoBoundingPolygonQuery
func (*Query) FromGeoDistanceQuery ¶
func (t *Query) FromGeoDistanceQuery(v GeoDistanceQuery) error
FromGeoDistanceQuery overwrites any union data inside the Query as the provided GeoDistanceQuery
func (*Query) FromGeoShapeQuery ¶
func (t *Query) FromGeoShapeQuery(v GeoShapeQuery) error
FromGeoShapeQuery overwrites any union data inside the Query as the provided GeoShapeQuery
func (*Query) FromIPRangeQuery ¶
func (t *Query) FromIPRangeQuery(v IPRangeQuery) error
FromIPRangeQuery overwrites any union data inside the Query as the provided IPRangeQuery
func (*Query) FromMatchAllQuery ¶
func (t *Query) FromMatchAllQuery(v MatchAllQuery) error
FromMatchAllQuery overwrites any union data inside the Query as the provided MatchAllQuery
func (*Query) FromMatchNoneQuery ¶
func (t *Query) FromMatchNoneQuery(v MatchNoneQuery) error
FromMatchNoneQuery overwrites any union data inside the Query as the provided MatchNoneQuery
func (*Query) FromMatchPhraseQuery ¶
func (t *Query) FromMatchPhraseQuery(v MatchPhraseQuery) error
FromMatchPhraseQuery overwrites any union data inside the Query as the provided MatchPhraseQuery
func (*Query) FromMatchQuery ¶
func (t *Query) FromMatchQuery(v MatchQuery) error
FromMatchQuery overwrites any union data inside the Query as the provided MatchQuery
func (*Query) FromMultiPhraseQuery ¶
func (t *Query) FromMultiPhraseQuery(v MultiPhraseQuery) error
FromMultiPhraseQuery overwrites any union data inside the Query as the provided MultiPhraseQuery
func (*Query) FromNumericRangeQuery ¶
func (t *Query) FromNumericRangeQuery(v NumericRangeQuery) error
FromNumericRangeQuery overwrites any union data inside the Query as the provided NumericRangeQuery
func (*Query) FromPhraseQuery ¶
func (t *Query) FromPhraseQuery(v PhraseQuery) error
FromPhraseQuery overwrites any union data inside the Query as the provided PhraseQuery
func (*Query) FromPrefixQuery ¶
func (t *Query) FromPrefixQuery(v PrefixQuery) error
FromPrefixQuery overwrites any union data inside the Query as the provided PrefixQuery
func (*Query) FromQueryStringQuery ¶
func (t *Query) FromQueryStringQuery(v QueryStringQuery) error
FromQueryStringQuery overwrites any union data inside the Query as the provided QueryStringQuery
func (*Query) FromRegexpQuery ¶
func (t *Query) FromRegexpQuery(v RegexpQuery) error
FromRegexpQuery overwrites any union data inside the Query as the provided RegexpQuery
func (*Query) FromTermQuery ¶
FromTermQuery overwrites any union data inside the Query as the provided TermQuery
func (*Query) FromTermRangeQuery ¶
func (t *Query) FromTermRangeQuery(v TermRangeQuery) error
FromTermRangeQuery overwrites any union data inside the Query as the provided TermRangeQuery
func (*Query) FromWildcardQuery ¶
func (t *Query) FromWildcardQuery(v WildcardQuery) error
FromWildcardQuery overwrites any union data inside the Query as the provided WildcardQuery
func (Query) MarshalJSON ¶
func (*Query) MergeBoolFieldQuery ¶
func (t *Query) MergeBoolFieldQuery(v BoolFieldQuery) error
MergeBoolFieldQuery performs a merge with any union data inside the Query, using the provided BoolFieldQuery
func (*Query) MergeBooleanQuery ¶
func (t *Query) MergeBooleanQuery(v BooleanQuery) error
MergeBooleanQuery performs a merge with any union data inside the Query, using the provided BooleanQuery
func (*Query) MergeConjunctionQuery ¶
func (t *Query) MergeConjunctionQuery(v ConjunctionQuery) error
MergeConjunctionQuery performs a merge with any union data inside the Query, using the provided ConjunctionQuery
func (*Query) MergeDateRangeStringQuery ¶
func (t *Query) MergeDateRangeStringQuery(v DateRangeStringQuery) error
MergeDateRangeStringQuery performs a merge with any union data inside the Query, using the provided DateRangeStringQuery
func (*Query) MergeDisjunctionQuery ¶
func (t *Query) MergeDisjunctionQuery(v DisjunctionQuery) error
MergeDisjunctionQuery performs a merge with any union data inside the Query, using the provided DisjunctionQuery
func (*Query) MergeDocIdQuery ¶
func (t *Query) MergeDocIdQuery(v DocIdQuery) error
MergeDocIdQuery performs a merge with any union data inside the Query, using the provided DocIdQuery
func (*Query) MergeFuzzyQuery ¶
func (t *Query) MergeFuzzyQuery(v FuzzyQuery) error
MergeFuzzyQuery performs a merge with any union data inside the Query, using the provided FuzzyQuery
func (*Query) MergeGeoBoundingBoxQuery ¶
func (t *Query) MergeGeoBoundingBoxQuery(v GeoBoundingBoxQuery) error
MergeGeoBoundingBoxQuery performs a merge with any union data inside the Query, using the provided GeoBoundingBoxQuery
func (*Query) MergeGeoBoundingPolygonQuery ¶
func (t *Query) MergeGeoBoundingPolygonQuery(v GeoBoundingPolygonQuery) error
MergeGeoBoundingPolygonQuery performs a merge with any union data inside the Query, using the provided GeoBoundingPolygonQuery
func (*Query) MergeGeoDistanceQuery ¶
func (t *Query) MergeGeoDistanceQuery(v GeoDistanceQuery) error
MergeGeoDistanceQuery performs a merge with any union data inside the Query, using the provided GeoDistanceQuery
func (*Query) MergeGeoShapeQuery ¶
func (t *Query) MergeGeoShapeQuery(v GeoShapeQuery) error
MergeGeoShapeQuery performs a merge with any union data inside the Query, using the provided GeoShapeQuery
func (*Query) MergeIPRangeQuery ¶
func (t *Query) MergeIPRangeQuery(v IPRangeQuery) error
MergeIPRangeQuery performs a merge with any union data inside the Query, using the provided IPRangeQuery
func (*Query) MergeMatchAllQuery ¶
func (t *Query) MergeMatchAllQuery(v MatchAllQuery) error
MergeMatchAllQuery performs a merge with any union data inside the Query, using the provided MatchAllQuery
func (*Query) MergeMatchNoneQuery ¶
func (t *Query) MergeMatchNoneQuery(v MatchNoneQuery) error
MergeMatchNoneQuery performs a merge with any union data inside the Query, using the provided MatchNoneQuery
func (*Query) MergeMatchPhraseQuery ¶
func (t *Query) MergeMatchPhraseQuery(v MatchPhraseQuery) error
MergeMatchPhraseQuery performs a merge with any union data inside the Query, using the provided MatchPhraseQuery
func (*Query) MergeMatchQuery ¶
func (t *Query) MergeMatchQuery(v MatchQuery) error
MergeMatchQuery performs a merge with any union data inside the Query, using the provided MatchQuery
func (*Query) MergeMultiPhraseQuery ¶
func (t *Query) MergeMultiPhraseQuery(v MultiPhraseQuery) error
MergeMultiPhraseQuery performs a merge with any union data inside the Query, using the provided MultiPhraseQuery
func (*Query) MergeNumericRangeQuery ¶
func (t *Query) MergeNumericRangeQuery(v NumericRangeQuery) error
MergeNumericRangeQuery performs a merge with any union data inside the Query, using the provided NumericRangeQuery
func (*Query) MergePhraseQuery ¶
func (t *Query) MergePhraseQuery(v PhraseQuery) error
MergePhraseQuery performs a merge with any union data inside the Query, using the provided PhraseQuery
func (*Query) MergePrefixQuery ¶
func (t *Query) MergePrefixQuery(v PrefixQuery) error
MergePrefixQuery performs a merge with any union data inside the Query, using the provided PrefixQuery
func (*Query) MergeQueryStringQuery ¶
func (t *Query) MergeQueryStringQuery(v QueryStringQuery) error
MergeQueryStringQuery performs a merge with any union data inside the Query, using the provided QueryStringQuery
func (*Query) MergeRegexpQuery ¶
func (t *Query) MergeRegexpQuery(v RegexpQuery) error
MergeRegexpQuery performs a merge with any union data inside the Query, using the provided RegexpQuery
func (*Query) MergeTermQuery ¶
MergeTermQuery performs a merge with any union data inside the Query, using the provided TermQuery
func (*Query) MergeTermRangeQuery ¶
func (t *Query) MergeTermRangeQuery(v TermRangeQuery) error
MergeTermRangeQuery performs a merge with any union data inside the Query, using the provided TermRangeQuery
func (*Query) MergeWildcardQuery ¶
func (t *Query) MergeWildcardQuery(v WildcardQuery) error
MergeWildcardQuery performs a merge with any union data inside the Query, using the provided WildcardQuery
func (*Query) UnmarshalJSON ¶
type QueryBuilderAgentJSONRequestBody ¶
type QueryBuilderAgentJSONRequestBody = QueryBuilderRequest
QueryBuilderAgentJSONRequestBody defines body for QueryBuilderAgent for application/json ContentType.
type QueryBuilderAgentResponse ¶
type QueryBuilderAgentResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *QueryBuilderResult
JSON400 *Error
JSON404 *Error
JSON500 *Error
}
func ParseQueryBuilderAgentResponse ¶
func ParseQueryBuilderAgentResponse(rsp *http.Response) (*QueryBuilderAgentResponse, error)
ParseQueryBuilderAgentResponse parses an HTTP response from a QueryBuilderAgentWithResponse call
func (QueryBuilderAgentResponse) Status ¶
func (r QueryBuilderAgentResponse) Status() string
Status returns HTTPResponse.Status
func (QueryBuilderAgentResponse) StatusCode ¶
func (r QueryBuilderAgentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type QueryBuilderRequest ¶
type QueryBuilderRequest struct {
// Generator A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Generator GeneratorConfig `json:"generator,omitempty,omitzero"`
// Intent Natural language description of the search intent
Intent string `json:"intent"`
// SchemaFields List of searchable field names to consider. Overrides table schema if provided.
SchemaFields []string `json:"schema_fields,omitempty,omitzero"`
// Table Name of the table to build query for. If provided, uses table schema for field context.
Table string `json:"table,omitempty,omitzero"`
}
QueryBuilderRequest defines model for QueryBuilderRequest.
type QueryBuilderResult ¶
type QueryBuilderResult struct {
// Confidence Model's confidence in the generated query (0.0-1.0)
Confidence float64 `json:"confidence,omitempty,omitzero"`
// Explanation Human-readable explanation of what the query does and why it was structured this way
Explanation string `json:"explanation,omitempty,omitzero"`
// Query Generated search query in simplified DSL format.
// Can be used directly in QueryRequest.full_text_search or filter_query.
Query map[string]interface{} `json:"query"`
// Warnings Any issues, limitations, or assumptions made when generating the query
Warnings []string `json:"warnings,omitempty,omitzero"`
}
QueryBuilderResult defines model for QueryBuilderResult.
type QueryHit ¶
type QueryHit struct {
// ID ID of the record.
ID string `json:"_id"`
// IndexScores Scores partitioned by index when using RRF search.
IndexScores map[string]interface{} `json:"_index_scores,omitempty,omitzero"`
// Score Relevance score of the hit.
Score float64 `json:"_score"`
Source map[string]interface{} `json:"_source,omitempty,omitzero"`
}
QueryHit A single query result hit
type QueryHits ¶
type QueryHits struct {
Hits []QueryHit `json:"hits"`
// MaxScore Maximum score of the results.
MaxScore float64 `json:"max_score,omitempty,omitzero"`
// Total Total number of hits available.
Total uint64 `json:"total,omitempty"`
}
QueryHits A list of query hits.
type QueryRequest ¶
type QueryRequest struct {
// Aggregations Aggregation requests for computing metrics and bucketing results.
// Each key is a user-defined name for the aggregation, and the value specifies the aggregation configuration.
//
// Supports metric aggregations (sum, avg, min, max, count, stats, cardinality),
// bucketing aggregations (terms, range, date_range, histogram, date_histogram),
// geo aggregations (geohash_grid, geo_distance), and analytics (significant_terms).
//
// Example:
// “`json
// {
// "price_stats": {
// "type": "stats",
// "field": "price"
// },
// "categories": {
// "type": "terms",
// "field": "category",
// "size": 10
// }
// }
// “`
Aggregations map[string]AggregationRequest `json:"aggregations,omitempty,omitzero"`
Analyses *Analyses `json:"analyses,omitempty"`
// Count If true, returns only the total count of matching documents without retrieving the actual documents.
// Useful for pagination and displaying result counts.
Count bool `json:"count,omitempty,omitzero"`
// DistanceOver Minimum distance threshold for semantic similarity search. Results with distance
// less than this value are excluded.
//
// Useful for excluding near-exact duplicates or finding dissimilar documents.
DistanceOver *float32 `json:"distance_over,omitempty"`
// DistanceUnder Maximum distance threshold for semantic similarity search. Results with distance
// greater than this value are excluded. Lower distances indicate higher similarity.
//
// Useful for filtering out low-confidence matches.
DistanceUnder *float32 `json:"distance_under,omitempty"`
// DocumentRenderer Optional Handlebars template string for rendering document content in RAG queries.
// Template has access to document fields via `{{this.fields.fieldName}}`.
//
// **Default**: Uses TOON (Token-Oriented Object Notation) format for 30-60% token reduction:
// “`handlebars
// {{encodeToon this.fields}}
// “`
//
// **Available Helpers**:
// - `encodeToon` - Renders fields in compact TOON format with configurable options:
// - `lengthMarker` (bool): Add # prefix to array counts (default: true)
// - `indent` (int): Indentation spacing (default: 2)
// - `delimiter` (string): Field separator for tabular arrays
// - `scrubHtml` - Removes HTML tags and extracts text
// - `media` - Wraps data URIs for GenKit multimodal support
// - `eq` - Equality comparison for conditionals
//
// **Examples**:
// - Basic TOON: `{{encodeToon this.fields}}`
// - Compact TOON: `{{encodeToon this.fields lengthMarker=false indent=0}}`
// - Tabular data: `{{encodeToon this.fields delimiter="\t"}}`
// - Custom template: `Title: {{this.fields.title}}\nBody: {{this.fields.body}}`
// - Traditional format: `{{#each this.fields}}{{@key}}: {{this}}\n{{/each}}`
//
// TOON format produces compact, LLM-optimized output like:
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// “`
//
// **References**:
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
DocumentRenderer string `json:"document_renderer,omitempty,omitzero"`
// EmbeddingTemplate Optional Handlebars template for multimodal embedding of the semantic_search query.
// The template has access to `this` which contains the semantic_search string value.
//
// Use this when you want to embed multimodal content (images, PDFs, etc.) instead of
// just text. The template is rendered using dotprompt with access to remote content helpers.
//
// **Available Helpers**:
// - `remoteMedia url=<url>` - Fetches and embeds remote images/media
// - `remotePDF url=<url>` - Fetches and extracts content from PDFs
// - `remoteText url=<url>` - Fetches and includes remote text content
//
// **Examples**:
// - PDF search: `{{remotePDF url=this}}`
// - Image search: `{{remoteMedia url=this}}`
// - Mixed: `Search for: {{this}} {{#if this}}{{remoteMedia url=this}}{{/if}}`
//
// When not specified, the semantic_search string is embedded as plain text.
EmbeddingTemplate string `json:"embedding_template,omitempty,omitzero"`
// Embeddings Pre-computed embeddings to use for semantic searches instead of embedding the semantic_search string.
// The keys are the index names. Values can be either:
// - **Dense**: an array of floats, e.g. `[0.1, 0.2, 0.3]`
// - **Sparse**: an object with `indices` (array of ints) and `values` (array of floats),
// e.g. `{"indices": [1, 5, 100], "values": [0.3, 0.7, 0.1]}`
//
// Use when you've already generated embeddings on the client side to avoid redundant embedding calls.
Embeddings map[string]Embedding `json:"embeddings,omitempty,omitzero"`
// ExclusionQuery Bleve query applied as a NOT condition. Documents matching this query are excluded
// from results. Applied before scoring.
//
// See bleve-query-openapi.yaml for complete type definitions.
//
// Use for:
// - Excluding drafts: `"status:draft"`
// - Removing deprecated content: `"deprecated:true"`
// - Filtering out archived items: `"status:archived"`
ExclusionQuery json.RawMessage `json:"exclusion_query,omitempty,omitzero"`
// ExpandStrategy Strategy for merging graph results with search results:
// - union: Include nodes from both search and graph results
// - intersection: Only include nodes appearing in both
ExpandStrategy QueryRequestExpandStrategy `json:"expand_strategy,omitempty,omitzero"`
// Fields List of fields to include in the results. If not specified, all fields are returned.
// Use to reduce response size and improve performance.
Fields []string `json:"fields,omitempty,omitzero"`
// FilterPrefix Filter results by key prefix. Only returns documents whose keys start with this string.
// Applied before scoring to improve performance.
//
// Common use cases:
// - Multi-tenant filtering: `"tenant:acme:"`
// - User-specific data: `"user:123:"`
// - Document type filtering: `"article:"`
FilterPrefix []byte `json:"filter_prefix,omitempty,omitzero"`
// FilterQuery Bleve query applied as an AND condition. Documents must match both the main query
// and this filter. Applied before scoring for better performance.
//
// See bleve-query-openapi.yaml for complete type definitions.
//
// Use for:
// - Status filtering: `"status:published"`
// - Date ranges: `"created_at:>2023-01-01"`
// - Category filtering: `"+category:technology +language:en"`
FilterQuery json.RawMessage `json:"filter_query,omitempty,omitzero"`
// ForeignSources Map of table name to foreign data source configuration for query-time federated access.
// When a table name referenced in this query (or in a join's `right_table`) appears as a key
// here, the query is routed to the external database instead of Antfly shards.
//
// This enables joining Antfly search results with structured relational data (customer records,
// product catalogs, etc.) without ingesting that data into Antfly.
//
// **Supported operations on foreign tables:** filter_query, field selection, limit/offset.
// **Not supported:** full_text_search, semantic_search, graph_searches, aggregations, reranker.
//
// **Example - Join Antfly products with Postgres customers:**
// “`json
// {
// "table": "products",
// "full_text_search": {"query": "category:electronics"},
// "join": {
// "right_table": "pg_customers",
// "on": {"left_field": "customer_id", "right_field": "id"}
// },
// "foreign_sources": {
// "pg_customers": {
// "type": "postgres",
// "dsn": "${secret:pg_dsn}",
// "postgres_table": "customers"
// }
// }
// }
// “`
ForeignSources map[string]ForeignSource `json:"foreign_sources,omitempty,omitzero"`
// FullTextSearch Bleve query for full-text search. Supports all Bleve query types.
//
// See bleve-query-openapi.yaml for complete type definitions.
//
// Examples:
// - Simple: `{"query": "computer"}`
// - Field-specific: `{"query": "body:computer"}`
// - Boolean: `{"query": "+artificial +intelligence"}`
// - Range: `{"query": "year:>2020"}`
// - Phrase: `{"query": "\"exact phrase\""}`
FullTextSearch json.RawMessage `json:"full_text_search,omitempty,omitzero"`
// GraphSearches Declarative graph queries to execute after full-text/vector searches.
// Results can reference search results using node selectors like $full_text_results.
GraphSearches map[string]GraphQuery `json:"graph_searches,omitempty,omitzero"`
// Indexes List of vector index names to use for semantic search. Required when using semantic_search.
// Multiple indexes can be specified, and their results will be merged using RRF.
Indexes []string `json:"indexes,omitempty,omitzero"`
// Join Configuration for joining data from another table.
// Supports inner, left, and right joins with automatic strategy selection.
Join JoinClause `json:"join,omitempty,omitzero"`
// Limit Maximum number of results to return. For semantic_search, this is the topk parameter.
// Default varies by query type (typically 10).
Limit int `json:"limit,omitempty,omitzero"`
// MergeConfig Configuration for result fusion when combining multiple search indexes.
MergeConfig MergeConfig `json:"merge_config,omitempty,omitzero"`
// Offset Number of results to skip for pagination. Only available for full_text_search queries.
// Not supported for semantic_search due to vector index limitations.
Offset int `json:"offset,omitempty,omitzero"`
// OrderBy Sort order for results. Map of field names to sort direction (true = descending, false = ascending).
// Only applicable for full_text_search queries. Semantic searches are always sorted by similarity score.
OrderBy map[string]SortDirection `json:"order_by,omitempty,omitzero"`
// Pruner Configuration for pruning search results based on score quality.
// Helps filter out low-relevance results in RAG pipelines by detecting
// score gaps or deviations from top results.
Pruner Pruner `json:"pruner,omitempty,omitzero"`
// Reranker A unified configuration for a reranking provider.
Reranker *RerankerConfig `json:"reranker,omitempty"`
// SemanticSearch Natural language query for vector similarity search. Results are ranked by semantic similarity
// to the query and can be combined with full_text_search using Reciprocal Rank Fusion (RRF).
//
// The semantic_search string is automatically embedded using the configured embedding model
// for the specified indexes. Use `embedding_template` for multimodal queries.
SemanticSearch string `json:"semantic_search,omitempty,omitzero"`
// Table Name of the table to query. Optional for global queries.
Table string `json:"table,omitempty,omitzero"`
}
QueryRequest defines model for QueryRequest.
type QueryRequestExpandStrategy ¶
type QueryRequestExpandStrategy string
QueryRequestExpandStrategy Strategy for merging graph results with search results: - union: Include nodes from both search and graph results - intersection: Only include nodes appearing in both
const ( QueryRequestExpandStrategyIntersection QueryRequestExpandStrategy = "intersection" QueryRequestExpandStrategyUnion QueryRequestExpandStrategy = "union" )
Defines values for QueryRequestExpandStrategy.
type QueryResponses ¶
type QueryResponses struct {
Responses []QueryResult `json:"responses,omitempty,omitzero"`
}
QueryResponses Responses from multiple query operations.
type QueryResult ¶
type QueryResult struct {
// Aggregations Aggregation results keyed by the user-defined aggregation names from the request.
// Contains computed metrics or buckets depending on the aggregation type.
Aggregations map[string]AggregationResult `json:"aggregations,omitempty,omitzero"`
// Analyses Analysis results like PCA and t-SNE per index embeddings.
Analyses map[string]AnalysesResult `json:"analyses,omitempty,omitzero"`
// Error Error message if the query failed.
Error string `json:"error,omitempty,omitzero"`
// GraphResults Results from declarative graph queries.
GraphResults map[string]GraphQueryResult `json:"graph_results,omitempty,omitzero"`
// Hits A list of query hits.
Hits QueryHits `json:"hits"`
// JoinResult Statistics and metadata about join execution.
JoinResult JoinResult `json:"join_result,omitempty,omitzero"`
// Status HTTP status code of the query operation.
Status int32 `json:"status"`
// Table Which table this result came from
Table string `json:"table,omitempty,omitzero"`
// Took Duration of the query in milliseconds.
Took time.Duration `json:"took"`
}
QueryResult Result of a query operation as an array of results and a count.
type QueryStrategy ¶
type QueryStrategy string
QueryStrategy Strategy for query transformation and retrieval: - simple: Direct query with multi-phrase expansion. Best for straightforward factual queries. - decompose: Break complex queries into sub-questions, retrieve for each. Best for multi-part questions. - step_back: Generate broader background query first, then specific query. Best for questions needing context. - hyde: Generate hypothetical answer document, embed that for retrieval. Best for abstract/conceptual questions.
const ( QueryStrategyDecompose QueryStrategy = "decompose" QueryStrategyHyde QueryStrategy = "hyde" QueryStrategySimple QueryStrategy = "simple" QueryStrategyStepBack QueryStrategy = "step_back" )
Defines values for QueryStrategy.
type QueryStringQuery ¶
type QueryStringQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Query string `json:"query"`
}
QueryStringQuery defines model for QueryStringQuery.
type QueryTableJSONRequestBody ¶
type QueryTableJSONRequestBody = QueryRequest
QueryTableJSONRequestBody defines body for QueryTable for application/json ContentType.
type QueryTableResponse ¶
type QueryTableResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *QueryResponses
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
func ParseQueryTableResponse ¶
func ParseQueryTableResponse(rsp *http.Response) (*QueryTableResponse, error)
ParseQueryTableResponse parses an HTTP response from a QueryTableWithResponse call
func (QueryTableResponse) Status ¶
func (r QueryTableResponse) Status() string
Status returns HTTPResponse.Status
func (QueryTableResponse) StatusCode ¶
func (r QueryTableResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RegexpQuery ¶
type RegexpQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
Regexp string `json:"regexp"`
}
RegexpQuery defines model for RegexpQuery.
type RemovePermissionFromUserParams ¶
type RemovePermissionFromUserParams struct {
// Resource The name of the resource for the permission to be removed.
Resource string `form:"resource" json:"resource"`
// ResourceType The type of the resource for the permission to be removed.
ResourceType ResourceType `form:"resourceType" json:"resourceType"`
}
RemovePermissionFromUserParams defines parameters for RemovePermissionFromUser.
type RemovePermissionFromUserResponse ¶
type RemovePermissionFromUserResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *Error
JSON404 *Error
JSON500 *Error
}
func ParseRemovePermissionFromUserResponse ¶
func ParseRemovePermissionFromUserResponse(rsp *http.Response) (*RemovePermissionFromUserResponse, error)
ParseRemovePermissionFromUserResponse parses an HTTP response from a RemovePermissionFromUserWithResponse call
func (RemovePermissionFromUserResponse) Status ¶
func (r RemovePermissionFromUserResponse) Status() string
Status returns HTTPResponse.Status
func (RemovePermissionFromUserResponse) StatusCode ¶
func (r RemovePermissionFromUserResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ReplicationRoute ¶
type ReplicationRoute struct {
// KeyTemplate Override the source-level `key_template` for this route. If omitted,
// the source-level template is used.
KeyTemplate string `json:"key_template,omitempty,omitzero"`
// OnDelete Transform operations for DELETE events on this route. If omitted,
// auto-derives from this route's `on_update` paths.
OnDelete []ReplicationTransformOp `json:"on_delete,omitempty,omitzero"`
// OnUpdate Transform operations for INSERT/UPDATE events on this route. If omitted,
// auto-generates `$set` for every column (passthrough mode).
OnUpdate []ReplicationTransformOp `json:"on_update,omitempty,omitzero"`
// TargetTable Name of the Antfly table to write matching rows to. The table must
// already exist.
TargetTable string `json:"target_table"`
// Where Bleve-style filter query evaluated against each CDC row. Only rows
// matching this filter are written to `target_table`. If omitted,
// all rows match (equivalent to `match_all`).
Where json.RawMessage `json:"where,omitempty,omitzero"`
}
ReplicationRoute defines model for ReplicationRoute.
type ReplicationSource ¶
type ReplicationSource struct {
// Dsn Data source name (connection string) for the PostgreSQL database.
// Supports `${secret:key_name}` references that resolve from the Antfly keystore
// or environment variables. Requires `wal_level=logical` on the source.
Dsn string `json:"dsn"`
// KeyTemplate Template for constructing the Antfly document key from PG columns.
// A plain string (e.g., "id") uses that column's value directly.
// Use `{{column}}` syntax for composite keys: `{{tenant_id}}:{{user_id}}`.
KeyTemplate string `json:"key_template,omitempty,omitzero"`
// OnDelete Transform operations applied on DELETE events. If omitted, auto-derives
// `$unset` ops from `on_update`'s `$set` paths (safe for multi-source).
// Use `$delete_document` op to delete the entire Antfly document.
OnDelete []ReplicationTransformOp `json:"on_delete,omitempty,omitzero"`
// OnUpdate Transform operations applied on INSERT/UPDATE events. Values can
// reference PG columns via `{{column}}` syntax. If omitted, auto-generates
// `$set` for every column (passthrough mode).
OnUpdate []ReplicationTransformOp `json:"on_update,omitempty,omitzero"`
// PostgresTable Name of the table in the PostgreSQL database to replicate from.
PostgresTable string `json:"postgres_table"`
// PublicationFilter Bleve-style filter query that gets translated to SQL and applied as a
// WHERE clause on the PostgreSQL publication. This filters rows at the
// source before they are sent over the replication stream, reducing
// network and processing overhead.
//
// Only a subset of filter types are supported (term, match, range,
// conjuncts, disjuncts, must_not). The filter is translated to SQL
// with inlined literal values.
//
// Example: `{"term": "active", "field": "status"}` becomes
// `WHERE ("status" = 'active')` on the publication.
PublicationFilter json.RawMessage `json:"publication_filter,omitempty,omitzero"`
// PublicationName PostgreSQL publication name. If omitted, auto-derived and created
// automatically. Specify this when using pre-created publications.
PublicationName string `json:"publication_name,omitempty,omitzero"`
// Routes Conditional routes for fan-out replication. Each route evaluates its
// `where` filter against every CDC row and, on match, writes to the
// specified `target_table`. Multiple routes can match the same row.
//
// When routes are present, the top-level `on_update`/`on_delete` are
// ignored — each route defines its own transforms.
Routes []ReplicationRoute `json:"routes,omitempty,omitzero"`
// SlotName PostgreSQL replication slot name. If omitted, auto-derived from
// the Antfly table and PG table names. Specify this when using
// pre-created slots (e.g., on Supabase or Neon).
SlotName string `json:"slot_name,omitempty,omitzero"`
// Type Type of the replication source. Currently only "postgres" is supported.
Type ReplicationSourceType `json:"type"`
}
ReplicationSource defines model for ReplicationSource.
type ReplicationSourceType ¶
type ReplicationSourceType string
ReplicationSourceType Type of the replication source. Currently only "postgres" is supported.
const (
ReplicationSourceTypePostgres ReplicationSourceType = "postgres"
)
Defines values for ReplicationSourceType.
type ReplicationTransformOp ¶
type ReplicationTransformOp struct {
// Op Transform operation. Standard ops: `$set`, `$unset`, `$inc`, `$push`, `$pull`,
// `$addToSet`, `$pop`, `$mul`, `$min`, `$max`, `$currentDate`, `$rename`.
// Replication-specific: `$merge` (flatten JSONB into top-level fields),
// `$delete_document` (delete entire Antfly doc, `on_delete` only).
Op string `json:"op"`
// Path Antfly document field path. Required for `$set`, `$unset`, etc.
Path string `json:"path,omitempty,omitzero"`
// Value Value for the operation. Can be a literal (string, number, boolean)
// or a `{{column}}` reference to a PG column value. Use `{{col.key}}` to
// navigate into decoded JSONB columns.
Value interface{} `json:"value,omitempty,omitzero"`
}
ReplicationTransformOp defines model for ReplicationTransformOp.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type RerankerConfig ¶
type RerankerConfig struct {
// Field Field name to extract from documents for reranking.
Field string `json:"field,omitempty,omitzero"`
// Provider The reranking provider to use.
Provider RerankerProvider `json:"provider"`
// Template Handlebars template to render document text for reranking.
Template string `json:"template,omitempty,omitzero"`
// contains filtered or unexported fields
}
RerankerConfig defines model for RerankerConfig.
func (RerankerConfig) AsAntflyRerankerConfig ¶
func (t RerankerConfig) AsAntflyRerankerConfig() (AntflyRerankerConfig, error)
AsAntflyRerankerConfig returns the union data inside the RerankerConfig as a AntflyRerankerConfig
func (RerankerConfig) AsCohereRerankerConfig ¶
func (t RerankerConfig) AsCohereRerankerConfig() (CohereRerankerConfig, error)
AsCohereRerankerConfig returns the union data inside the RerankerConfig as a CohereRerankerConfig
func (RerankerConfig) AsOllamaRerankerConfig ¶
func (t RerankerConfig) AsOllamaRerankerConfig() (OllamaRerankerConfig, error)
AsOllamaRerankerConfig returns the union data inside the RerankerConfig as a OllamaRerankerConfig
func (RerankerConfig) AsTermiteRerankerConfig ¶
func (t RerankerConfig) AsTermiteRerankerConfig() (TermiteRerankerConfig, error)
AsTermiteRerankerConfig returns the union data inside the RerankerConfig as a TermiteRerankerConfig
func (RerankerConfig) AsVertexRerankerConfig ¶
func (t RerankerConfig) AsVertexRerankerConfig() (VertexRerankerConfig, error)
AsVertexRerankerConfig returns the union data inside the RerankerConfig as a VertexRerankerConfig
func (*RerankerConfig) FromAntflyRerankerConfig ¶
func (t *RerankerConfig) FromAntflyRerankerConfig(v AntflyRerankerConfig) error
FromAntflyRerankerConfig overwrites any union data inside the RerankerConfig as the provided AntflyRerankerConfig
func (*RerankerConfig) FromCohereRerankerConfig ¶
func (t *RerankerConfig) FromCohereRerankerConfig(v CohereRerankerConfig) error
FromCohereRerankerConfig overwrites any union data inside the RerankerConfig as the provided CohereRerankerConfig
func (*RerankerConfig) FromOllamaRerankerConfig ¶
func (t *RerankerConfig) FromOllamaRerankerConfig(v OllamaRerankerConfig) error
FromOllamaRerankerConfig overwrites any union data inside the RerankerConfig as the provided OllamaRerankerConfig
func (*RerankerConfig) FromTermiteRerankerConfig ¶
func (t *RerankerConfig) FromTermiteRerankerConfig(v TermiteRerankerConfig) error
FromTermiteRerankerConfig overwrites any union data inside the RerankerConfig as the provided TermiteRerankerConfig
func (*RerankerConfig) FromVertexRerankerConfig ¶
func (t *RerankerConfig) FromVertexRerankerConfig(v VertexRerankerConfig) error
FromVertexRerankerConfig overwrites any union data inside the RerankerConfig as the provided VertexRerankerConfig
func (RerankerConfig) MarshalJSON ¶
func (t RerankerConfig) MarshalJSON() ([]byte, error)
func (*RerankerConfig) MergeAntflyRerankerConfig ¶
func (t *RerankerConfig) MergeAntflyRerankerConfig(v AntflyRerankerConfig) error
MergeAntflyRerankerConfig performs a merge with any union data inside the RerankerConfig, using the provided AntflyRerankerConfig
func (*RerankerConfig) MergeCohereRerankerConfig ¶
func (t *RerankerConfig) MergeCohereRerankerConfig(v CohereRerankerConfig) error
MergeCohereRerankerConfig performs a merge with any union data inside the RerankerConfig, using the provided CohereRerankerConfig
func (*RerankerConfig) MergeOllamaRerankerConfig ¶
func (t *RerankerConfig) MergeOllamaRerankerConfig(v OllamaRerankerConfig) error
MergeOllamaRerankerConfig performs a merge with any union data inside the RerankerConfig, using the provided OllamaRerankerConfig
func (*RerankerConfig) MergeTermiteRerankerConfig ¶
func (t *RerankerConfig) MergeTermiteRerankerConfig(v TermiteRerankerConfig) error
MergeTermiteRerankerConfig performs a merge with any union data inside the RerankerConfig, using the provided TermiteRerankerConfig
func (*RerankerConfig) MergeVertexRerankerConfig ¶
func (t *RerankerConfig) MergeVertexRerankerConfig(v VertexRerankerConfig) error
MergeVertexRerankerConfig performs a merge with any union data inside the RerankerConfig, using the provided VertexRerankerConfig
func (*RerankerConfig) UnmarshalJSON ¶
func (t *RerankerConfig) UnmarshalJSON(b []byte) error
type RerankerProvider ¶
type RerankerProvider string
RerankerProvider The reranking provider to use.
const ( RerankerProviderAntfly RerankerProvider = "antfly" RerankerProviderCohere RerankerProvider = "cohere" RerankerProviderOllama RerankerProvider = "ollama" RerankerProviderTermite RerankerProvider = "termite" RerankerProviderVertex RerankerProvider = "vertex" )
Defines values for RerankerProvider.
type ResourceType ¶
type ResourceType string
ResourceType Type of the resource, e.g., table, user, or global ('*').
const ( ResourceTypeAsterisk ResourceType = "*" ResourceTypeTable ResourceType = "table" ResourceTypeUser ResourceType = "user" )
Defines values for ResourceType.
type RestoreJSONRequestBody ¶
type RestoreJSONRequestBody = ClusterRestoreRequest
RestoreJSONRequestBody defines body for Restore for application/json ContentType.
type RestoreRequest ¶
type RestoreRequest = BackupRequest
RestoreRequest defines model for RestoreRequest.
type RestoreResponse ¶
type RestoreResponse struct {
Body []byte
HTTPResponse *http.Response
JSON202 *ClusterRestoreResponse
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseRestoreResponse ¶
func ParseRestoreResponse(rsp *http.Response) (*RestoreResponse, error)
ParseRestoreResponse parses an HTTP response from a RestoreWithResponse call
func (RestoreResponse) Status ¶
func (r RestoreResponse) Status() string
Status returns HTTPResponse.Status
func (RestoreResponse) StatusCode ¶
func (r RestoreResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RestoreTableJSONRequestBody ¶
type RestoreTableJSONRequestBody = RestoreRequest
RestoreTableJSONRequestBody defines body for RestoreTable for application/json ContentType.
type RestoreTableResponse ¶
type RestoreTableResponse struct {
Body []byte
HTTPResponse *http.Response
JSON202 *struct {
Restore string `json:"restore,omitempty,omitzero"`
}
JSON400 *BadRequest
JSON500 *InternalServerError
}
func ParseRestoreTableResponse ¶
func ParseRestoreTableResponse(rsp *http.Response) (*RestoreTableResponse, error)
ParseRestoreTableResponse parses an HTTP response from a RestoreTableWithResponse call
func (RestoreTableResponse) Status ¶
func (r RestoreTableResponse) Status() string
Status returns HTTPResponse.Status
func (RestoreTableResponse) StatusCode ¶
func (r RestoreTableResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RetrievalAgentJSONRequestBody ¶
type RetrievalAgentJSONRequestBody = RetrievalAgentRequest
RetrievalAgentJSONRequestBody defines body for RetrievalAgent for application/json ContentType.
type RetrievalAgentRequest ¶
type RetrievalAgentRequest struct {
// AccumulatedFilters Pre-applied filters from prior interactions. These are applied to
// all search tool invocations.
AccumulatedFilters []FilterSpec `json:"accumulated_filters,omitempty,omitzero"`
// AgentKnowledge Domain-specific knowledge to include in the agent's system prompt.
// Useful for providing context about the document collection.
AgentKnowledge string `json:"agent_knowledge,omitempty,omitzero"`
// Chain Chain of generators
Chain []ChainLink `json:"chain,omitempty,omitzero"`
// Context Prior messages for multi-turn clarification.
// Deprecated: use `messages` instead.
// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
Context []ChatMessage `json:"context,omitempty,omitzero"`
// DocumentRenderer Handlebars template for rendering documents in the generation prompt.
// Default uses TOON format for token efficiency.
// Requires steps.generation to be set.
DocumentRenderer string `json:"document_renderer,omitempty,omitzero"`
// Generator A unified configuration for a generative AI provider.
//
// Generators can be configured with custom prompts using templates. Templates use
// Handlebars syntax and support various built-in helpers for formatting and data manipulation.
//
// **Template System:**
// - **Syntax**: Handlebars templating (https://handlebarsjs.com/guide/)
// - **Caching**: Templates are automatically cached with configurable TTL (default: 5 minutes)
// - **Context**: Templates receive the full context data passed to the generator
//
// **Built-in Helpers:**
//
// 1. **scrubHtml** - Remove script/style tags and extract clean text from HTML
// “`handlebars
// {{scrubHtml html_content}}
// “`
// - Removes `<script>` and `<style>` tags
// - Adds newlines after block elements (p, div, h1-h6, li, etc.)
// - Returns plain text with preserved readability
// - Useful for cleaning web content before summarization
//
// 2. **eq** - Equality comparison for conditionals
// “`handlebars
// {{#if (eq status "active")}}Active{{/if}}
// {{#if (eq @key "special")}}Special field{{/if}}
// “`
// - Use in `{{#if}}` blocks for conditional logic
// - Compares any two values for equality
//
// 3. **media** - GenKit dotprompt media directive for multimodal content
// “`handlebars
// {{media url=imageDataURI}}
// {{media url=this.image_url}}
// {{media url="https://example.com/image.jpg"}}
// {{media url="s3://endpoint/bucket/image.png"}}
// {{media url="file:///path/to/image.jpg"}}
// “`
//
// **Supported URL Schemes:**
// - `data:` - Base64 encoded data URIs (e.g., `data:image/jpeg;base64,...`)
// - `http://` / `https://` - Web URLs with automatic content type detection
// - `file://` - Local filesystem paths
// - `s3://` - S3-compatible storage (format: `s3://endpoint/bucket/key`)
//
// **Automatic Content Processing:**
// - **Images**: Downloaded, resized (if needed), converted to data URIs
// - **PDFs**: Text extracted or first page rendered as image
// - **HTML**: Readable text extracted using Mozilla Readability
//
// **Security Controls:**
// Downloads are protected by content security settings (see Configuration Reference):
// - Allowed host whitelist
// - Private IP blocking (prevents SSRF attacks)
// - Download size limits (default: 100MB)
// - Download timeouts (default: 30s)
// - Image dimension limits (default: 2048px, auto-resized)
//
// See: https://antfly.io/docs/configuration#security--cors
//
// 4. **encodeToon** - Encode data in TOON format (Token-Oriented Object Notation)
// “`handlebars
// {{encodeToon this.fields}}
// {{encodeToon this.fields lengthMarker=false indent=4}}
// {{encodeToon this.fields delimiter="\t"}}
// “`
//
// **What is TOON?**
// TOON is a compact, human-readable format designed for passing structured data to LLMs.
// It provides **30-60% token reduction** compared to JSON while maintaining high LLM
// comprehension accuracy.
//
// **Key Features:**
// - Compact syntax using `:` for key-value pairs
// - Array length markers: `tags[#3]: ai,search,ml`
// - Tabular format for uniform data structures
// - Optimized for LLM parsing and understanding
// - Maintains human readability
//
// **Benefits:**
// - **Lower API costs** - Reduced token usage means lower LLM API costs
// - **Faster responses** - Less tokens to process
// - **More context** - Fit more documents within token limits
//
// **Options:**
// - `lengthMarker` (bool): Add # prefix to array counts like `[#3]` (default: true)
// - `indent` (int): Indentation spacing for nested objects (default: 2)
// - `delimiter` (string): Field separator for tabular arrays (default: none, use `"\t"` for tabs)
//
// **Example output:**
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// metadata:
// edition: 2
// pages: 450
// “`
//
// **Default in RAG:** TOON is the default format for document rendering in RAG queries.
//
// **References:**
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
//
// **Template Examples:**
//
// RAG summarization with document references:
// “`handlebars
// Based on these documents, provide a comprehensive summary:
//
// {{#each documents}}
// Document {{this.id}}:
// {{scrubHtml this.content}}
//
// {{/each}}
//
// Valid document IDs: {{#each documents}}{{this.id}}{{#unless @last}}, {{/unless}}{{/each}}
// “`
//
// Conditional formatting:
// “`handlebars
// {{#if system_prompt}}System: {{system_prompt}}{{/if}}
//
// User Query: {{query}}
//
// {{#if context}}
// Context:
// {{#each context}}
// - {{this}}
// {{/each}}
// {{/if}}
// “`
//
// Multimodal prompt with images:
// “`handlebars
// Analyze this image:
// {{media url=image_url}}
//
// Focus on: {{focus_area}}
// “`
//
// Structured data encoding:
// “`handlebars
// User Profile:
// {{encodeToon user_data indent=2 lengthMarker=true}}
//
// Please analyze this profile.
// “`
//
// **Common Use Cases:**
// - **RAG (Retrieval-Augmented Generation)**: Format retrieved documents with citations
// - **Summarization**: Clean HTML content and structure summaries
// - **Query Classification**: Format queries with metadata for better classification
// - **Multimodal**: Include images/audio/video in prompts
// - **Data Formatting**: Convert structured data to readable text
//
// **Best Practices:**
// - Keep templates simple - complex logic belongs in application code
// - Use clear, descriptive field names in context
// - Handle missing fields gracefully (templates use "missingkey=zero" by default)
// - Test templates with representative data before production use
Generator GeneratorConfig `json:"generator,omitempty,omitzero"`
// MaxContextTokens Maximum tokens for document context in tool responses. Documents
// exceeding this limit are pruned to fit.
MaxContextTokens int `json:"max_context_tokens,omitempty,omitzero"`
// MaxIterations Maximum number of tool-calling rounds. Controls how many times the
// LLM can invoke tools before being forced to return results.
//
// - 0: Pipeline mode — execute provided queries directly, no LLM loop
// - 1+: Agentic mode — LLM decides which tools to call
MaxIterations int `json:"max_iterations,omitempty,omitzero"`
// Messages Conversation messages for multi-turn interaction
Messages []ChatMessage `json:"messages,omitempty,omitzero"`
// Queries Queries to execute. Each query carries its own table via the
// QueryRequest table field.
//
// In pipeline mode (max_iterations=0), these are executed directly.
// In agentic mode, these declare which table and indexes are available.
Queries []RetrievalQueryRequest `json:"queries"`
// Query User's natural language query
Query string `json:"query"`
// ReserveTokens Tokens to reserve for system prompt, answer generation, and other overhead.
// Subtracted from max_context_tokens to determine available context budget.
// Defaults to 4000 if max_context_tokens is set.
ReserveTokens int `json:"reserve_tokens,omitempty,omitzero"`
// Steps Configuration for the retrieval agent's pipeline steps and tool-use behavior.
// Each step can have its own generator (or chain of generators) and step-specific options.
// If a step is not configured, it is skipped (retrieval always runs).
Steps RetrievalAgentSteps `json:"steps,omitempty,omitzero"`
// Stream Enable SSE streaming vs JSON response
Stream bool `json:"stream,omitempty,omitzero"`
}
RetrievalAgentRequest Request for the retrieval agent. Queries define which tables and indexes to search, each as a QueryRequest with optional tree search configuration.
**Pipeline mode** (default, max_iterations=0): Queries are executed directly without an LLM tool-calling loop.
**Agentic mode** (max_iterations > 0): The LLM decides which tools to call, using the queries to determine available tables and indexes.
type RetrievalAgentResponse ¶
type RetrievalAgentResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *RetrievalAgentResult
JSON400 *Error
JSON500 *Error
}
func ParseRetrievalAgentResponse ¶
func ParseRetrievalAgentResponse(rsp *http.Response) (*RetrievalAgentResponse, error)
ParseRetrievalAgentResponse parses an HTTP response from a RetrievalAgentWithResponse call
func (RetrievalAgentResponse) Status ¶
func (r RetrievalAgentResponse) Status() string
Status returns HTTPResponse.Status
func (RetrievalAgentResponse) StatusCode ¶
func (r RetrievalAgentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RetrievalAgentResult ¶
type RetrievalAgentResult struct {
// AppliedFilters Filters that were applied during retrieval
AppliedFilters []FilterSpec `json:"applied_filters,omitempty,omitzero"`
// ClarificationRequest Request for clarification from the user
ClarificationRequest ClarificationRequest `json:"clarification_request,omitempty,omitzero"`
// Classification Query classification and transformation result combining all query enhancements including strategy selection and semantic optimization
Classification ClassificationTransformationResult `json:"classification,omitempty,omitzero"`
// ContextRelevance Relevance of retrieved documents to the query (requires steps.confidence)
ContextRelevance float32 `json:"context_relevance,omitempty,omitzero"`
// CreatedAt Unix timestamp (seconds) when the response was created
CreatedAt int64 `json:"created_at,omitempty,omitzero"`
// EvalResult Complete evaluation result
EvalResult EvalResult `json:"eval_result,omitempty,omitzero"`
// FollowupQuestions Suggested follow-up questions (requires steps.followup)
FollowupQuestions []string `json:"followup_questions,omitempty,omitzero"`
// Generation Generated response in markdown format. Present when steps.generation
// was configured.
Generation string `json:"generation,omitempty,omitzero"`
// GenerationConfidence Confidence in the generated response (requires steps.confidence)
GenerationConfidence float32 `json:"generation_confidence,omitempty,omitzero"`
// Hits Retrieved query hits
Hits []QueryHit `json:"hits"`
// Id Unique response ID for logging and tracing
Id string `json:"id,omitempty,omitzero"`
// IncompleteDetails Explains why the agent stopped before completion. Present when status is "incomplete".
IncompleteDetails IncompleteDetails `json:"incomplete_details,omitempty,omitzero"`
// Messages Conversation messages including tool calls and responses.
// Can be passed back in subsequent requests for multi-turn interaction.
Messages []ChatMessage `json:"messages,omitempty,omitzero"`
// Model LLM model used for generation
Model string `json:"model,omitempty,omitzero"`
// ReasoningChain Steps taken during retrieval (tool calls, actions)
ReasoningChain []RetrievalReasoningStep `json:"reasoning_chain,omitempty,omitzero"`
// Status Current status of the retrieval agent execution:
// - completed: Agent finished successfully
// - in_progress: Agent is still executing (streaming context)
// - incomplete: Agent stopped before completion (see incomplete_details)
// - failed: Error occurred during execution
Status RetrievalAgentStatus `json:"status"`
// StrategyUsed Strategy for document retrieval:
// - semantic: Vector similarity search using embeddings
// - bm25: Full-text search using BM25 scoring
// - metadata: Structured query on document fields
// - tree: Iterative tree navigation with summarization
// - graph: Relationship-based traversal
// - hybrid: Combine multiple strategies with RRF or rerank
StrategyUsed RetrievalStrategy `json:"strategy_used,omitempty,omitzero"`
// ToolCallsMade Total number of tool calls made during retrieval
ToolCallsMade int `json:"tool_calls_made,omitempty,omitzero"`
// Usage Token usage and resource statistics from the retrieval agent execution
Usage RetrievalAgentUsage `json:"usage,omitempty,omitzero"`
}
RetrievalAgentResult Result from the retrieval agent
type RetrievalAgentStatus ¶
type RetrievalAgentStatus string
RetrievalAgentStatus Current status of the retrieval agent execution: - completed: Agent finished successfully - in_progress: Agent is still executing (streaming context) - incomplete: Agent stopped before completion (see incomplete_details) - failed: Error occurred during execution
const ( RetrievalAgentStatusCompleted RetrievalAgentStatus = "completed" RetrievalAgentStatusFailed RetrievalAgentStatus = "failed" RetrievalAgentStatusInProgress RetrievalAgentStatus = "in_progress" RetrievalAgentStatusIncomplete RetrievalAgentStatus = "incomplete" )
Defines values for RetrievalAgentStatus.
type RetrievalAgentSteps ¶
type RetrievalAgentSteps struct {
// Classification Configuration for the classification step. This step analyzes the query,
// selects the optimal retrieval strategy, and generates semantic transformations.
Classification ClassificationStepConfig `json:"classification,omitempty,omitzero"`
// Confidence Configuration for confidence assessment. Evaluates answer quality and
// resource relevance. Can use a model calibrated for scoring tasks.
Confidence ConfidenceStepConfig `json:"confidence,omitempty,omitzero"`
// Eval Configuration for inline evaluation of query results.
// Add to RAGRequest, QueryRequest, or AnswerAgentRequest.
Eval EvalConfig `json:"eval,omitempty,omitzero"`
// Followup Configuration for generating follow-up questions. Uses a separate generator
// call which can use a cheaper/faster model.
Followup FollowupStepConfig `json:"followup,omitempty,omitzero"`
// Generation Configuration for the generation step. This step generates the final
// response from retrieved documents using the reasoning as context.
Generation GenerationStepConfig `json:"generation,omitempty,omitzero"`
// Tools Configuration for chat agent tools.
//
// If `enabled_tools` is empty/omitted, defaults to: add_filter, ask_clarification, search.
//
// For models that don't support native tool calling (e.g., Ollama),
// a prompt-based fallback is used with structured output parsing.
Tools ChatToolsConfig `json:"tools,omitempty,omitzero"`
}
RetrievalAgentSteps Configuration for the retrieval agent's pipeline steps and tool-use behavior. Each step can have its own generator (or chain of generators) and step-specific options. If a step is not configured, it is skipped (retrieval always runs).
type RetrievalAgentUsage ¶
type RetrievalAgentUsage struct {
// CachedInputTokens Input tokens served from cache
CachedInputTokens int `json:"cached_input_tokens,omitempty,omitzero"`
// InputTokens Total input tokens across all LLM calls
InputTokens int `json:"input_tokens,omitempty,omitzero"`
// LlmCalls Number of LLM invocations made
LlmCalls int `json:"llm_calls,omitempty,omitzero"`
// OutputTokens Total output tokens across all LLM calls
OutputTokens int `json:"output_tokens,omitempty,omitzero"`
// PruneStats Statistics from token-based document pruning
PruneStats PruneStats `json:"prune_stats,omitempty,omitzero"`
// ResourcesRetrieved Total resources found across all search queries
ResourcesRetrieved int `json:"resources_retrieved,omitempty,omitzero"`
// TotalTokens Sum of input + output tokens
TotalTokens int `json:"total_tokens,omitempty,omitzero"`
}
RetrievalAgentUsage Token usage and resource statistics from the retrieval agent execution
type RetrievalQueryRequest ¶
type RetrievalQueryRequest struct {
// Aggregations Aggregation requests for computing metrics and bucketing results.
// Each key is a user-defined name for the aggregation, and the value specifies the aggregation configuration.
//
// Supports metric aggregations (sum, avg, min, max, count, stats, cardinality),
// bucketing aggregations (terms, range, date_range, histogram, date_histogram),
// geo aggregations (geohash_grid, geo_distance), and analytics (significant_terms).
//
// Example:
// “`json
// {
// "price_stats": {
// "type": "stats",
// "field": "price"
// },
// "categories": {
// "type": "terms",
// "field": "category",
// "size": 10
// }
// }
// “`
Aggregations map[string]AggregationRequest `json:"aggregations,omitempty,omitzero"`
Analyses *Analyses `json:"analyses,omitempty"`
// Count If true, returns only the total count of matching documents without retrieving the actual documents.
// Useful for pagination and displaying result counts.
Count bool `json:"count,omitempty,omitzero"`
// DistanceOver Minimum distance threshold for semantic similarity search. Results with distance
// less than this value are excluded.
//
// Useful for excluding near-exact duplicates or finding dissimilar documents.
DistanceOver *float32 `json:"distance_over,omitempty"`
// DistanceUnder Maximum distance threshold for semantic similarity search. Results with distance
// greater than this value are excluded. Lower distances indicate higher similarity.
//
// Useful for filtering out low-confidence matches.
DistanceUnder *float32 `json:"distance_under,omitempty"`
// DocumentRenderer Optional Handlebars template string for rendering document content in RAG queries.
// Template has access to document fields via `{{this.fields.fieldName}}`.
//
// **Default**: Uses TOON (Token-Oriented Object Notation) format for 30-60% token reduction:
// “`handlebars
// {{encodeToon this.fields}}
// “`
//
// **Available Helpers**:
// - `encodeToon` - Renders fields in compact TOON format with configurable options:
// - `lengthMarker` (bool): Add # prefix to array counts (default: true)
// - `indent` (int): Indentation spacing (default: 2)
// - `delimiter` (string): Field separator for tabular arrays
// - `scrubHtml` - Removes HTML tags and extracts text
// - `media` - Wraps data URIs for GenKit multimodal support
// - `eq` - Equality comparison for conditionals
//
// **Examples**:
// - Basic TOON: `{{encodeToon this.fields}}`
// - Compact TOON: `{{encodeToon this.fields lengthMarker=false indent=0}}`
// - Tabular data: `{{encodeToon this.fields delimiter="\t"}}`
// - Custom template: `Title: {{this.fields.title}}\nBody: {{this.fields.body}}`
// - Traditional format: `{{#each this.fields}}{{@key}}: {{this}}\n{{/each}}`
//
// TOON format produces compact, LLM-optimized output like:
// “`
// title: Introduction to Vector Search
// author: Jane Doe
// tags[#3]: ai,search,ml
// “`
//
// **References**:
// - TOON Specification: https://github.com/toon-format/toon
// - Go Implementation: https://github.com/alpkeskin/gotoon
DocumentRenderer string `json:"document_renderer,omitempty,omitzero"`
// EmbeddingTemplate Optional Handlebars template for multimodal embedding of the semantic_search query.
// The template has access to `this` which contains the semantic_search string value.
//
// Use this when you want to embed multimodal content (images, PDFs, etc.) instead of
// just text. The template is rendered using dotprompt with access to remote content helpers.
//
// **Available Helpers**:
// - `remoteMedia url=<url>` - Fetches and embeds remote images/media
// - `remotePDF url=<url>` - Fetches and extracts content from PDFs
// - `remoteText url=<url>` - Fetches and includes remote text content
//
// **Examples**:
// - PDF search: `{{remotePDF url=this}}`
// - Image search: `{{remoteMedia url=this}}`
// - Mixed: `Search for: {{this}} {{#if this}}{{remoteMedia url=this}}{{/if}}`
//
// When not specified, the semantic_search string is embedded as plain text.
EmbeddingTemplate string `json:"embedding_template,omitempty,omitzero"`
// Embeddings Pre-computed embeddings to use for semantic searches instead of embedding the semantic_search string.
// The keys are the index names. Values can be either:
// - **Dense**: an array of floats, e.g. `[0.1, 0.2, 0.3]`
// - **Sparse**: an object with `indices` (array of ints) and `values` (array of floats),
// e.g. `{"indices": [1, 5, 100], "values": [0.3, 0.7, 0.1]}`
//
// Use when you've already generated embeddings on the client side to avoid redundant embedding calls.
Embeddings map[string]Embedding `json:"embeddings,omitempty,omitzero"`
// ExclusionQuery Bleve query applied as a NOT condition. Documents matching this query are excluded
// from results. Applied before scoring.
//
// See bleve-query-openapi.yaml for complete type definitions.
//
// Use for:
// - Excluding drafts: `"status:draft"`
// - Removing deprecated content: `"deprecated:true"`
// - Filtering out archived items: `"status:archived"`
ExclusionQuery json.RawMessage `json:"exclusion_query,omitempty,omitzero"`
// ExpandStrategy Strategy for merging graph results with search results:
// - union: Include nodes from both search and graph results
// - intersection: Only include nodes appearing in both
ExpandStrategy RetrievalQueryRequestExpandStrategy `json:"expand_strategy,omitempty,omitzero"`
// Fields List of fields to include in the results. If not specified, all fields are returned.
// Use to reduce response size and improve performance.
Fields []string `json:"fields,omitempty,omitzero"`
// FilterPrefix Filter results by key prefix. Only returns documents whose keys start with this string.
// Applied before scoring to improve performance.
//
// Common use cases:
// - Multi-tenant filtering: `"tenant:acme:"`
// - User-specific data: `"user:123:"`
// - Document type filtering: `"article:"`
FilterPrefix []byte `json:"filter_prefix,omitempty,omitzero"`
// FilterQuery Bleve query applied as an AND condition. Documents must match both the main query
// and this filter. Applied before scoring for better performance.
//
// See bleve-query-openapi.yaml for complete type definitions.
//
// Use for:
// - Status filtering: `"status:published"`
// - Date ranges: `"created_at:>2023-01-01"`
// - Category filtering: `"+category:technology +language:en"`
FilterQuery json.RawMessage `json:"filter_query,omitempty,omitzero"`
// ForeignSources Map of table name to foreign data source configuration for query-time federated access.
// When a table name referenced in this query (or in a join's `right_table`) appears as a key
// here, the query is routed to the external database instead of Antfly shards.
//
// This enables joining Antfly search results with structured relational data (customer records,
// product catalogs, etc.) without ingesting that data into Antfly.
//
// **Supported operations on foreign tables:** filter_query, field selection, limit/offset.
// **Not supported:** full_text_search, semantic_search, graph_searches, aggregations, reranker.
//
// **Example - Join Antfly products with Postgres customers:**
// “`json
// {
// "table": "products",
// "full_text_search": {"query": "category:electronics"},
// "join": {
// "right_table": "pg_customers",
// "on": {"left_field": "customer_id", "right_field": "id"}
// },
// "foreign_sources": {
// "pg_customers": {
// "type": "postgres",
// "dsn": "${secret:pg_dsn}",
// "postgres_table": "customers"
// }
// }
// }
// “`
ForeignSources map[string]ForeignSource `json:"foreign_sources,omitempty,omitzero"`
// FullTextSearch Bleve query for full-text search. Supports all Bleve query types.
//
// See bleve-query-openapi.yaml for complete type definitions.
//
// Examples:
// - Simple: `{"query": "computer"}`
// - Field-specific: `{"query": "body:computer"}`
// - Boolean: `{"query": "+artificial +intelligence"}`
// - Range: `{"query": "year:>2020"}`
// - Phrase: `{"query": "\"exact phrase\""}`
FullTextSearch json.RawMessage `json:"full_text_search,omitempty,omitzero"`
// GraphSearches Declarative graph queries to execute after full-text/vector searches.
// Results can reference search results using node selectors like $full_text_results.
GraphSearches map[string]GraphQuery `json:"graph_searches,omitempty,omitzero"`
// Indexes List of vector index names to use for semantic search. Required when using semantic_search.
// Multiple indexes can be specified, and their results will be merged using RRF.
Indexes []string `json:"indexes,omitempty,omitzero"`
// Join Configuration for joining data from another table.
// Supports inner, left, and right joins with automatic strategy selection.
Join JoinClause `json:"join,omitempty,omitzero"`
// Limit Maximum number of results to return. For semantic_search, this is the topk parameter.
// Default varies by query type (typically 10).
Limit int `json:"limit,omitempty,omitzero"`
// MergeConfig Configuration for result fusion when combining multiple search indexes.
MergeConfig MergeConfig `json:"merge_config,omitempty,omitzero"`
// Offset Number of results to skip for pagination. Only available for full_text_search queries.
// Not supported for semantic_search due to vector index limitations.
Offset int `json:"offset,omitempty,omitzero"`
// OrderBy Sort order for results. Map of field names to sort direction (true = descending, false = ascending).
// Only applicable for full_text_search queries. Semantic searches are always sorted by similarity score.
OrderBy map[string]SortDirection `json:"order_by,omitempty,omitzero"`
// Pruner Configuration for pruning search results based on score quality.
// Helps filter out low-relevance results in RAG pipelines by detecting
// score gaps or deviations from top results.
Pruner Pruner `json:"pruner,omitempty,omitzero"`
// Reranker A unified configuration for a reranking provider.
Reranker *RerankerConfig `json:"reranker,omitempty"`
// SemanticSearch Natural language query for vector similarity search. Results are ranked by semantic similarity
// to the query and can be combined with full_text_search using Reciprocal Rank Fusion (RRF).
//
// The semantic_search string is automatically embedded using the configured embedding model
// for the specified indexes. Use `embedding_template` for multimodal queries.
SemanticSearch string `json:"semantic_search,omitempty,omitzero"`
// Table Name of the table to query. Optional for global queries.
Table string `json:"table,omitempty,omitzero"`
// TreeSearch Configuration for tree search strategy. Tree search navigates hierarchical
// document structures by evaluating summaries at each level.
TreeSearch TreeSearchConfig `json:"tree_search,omitempty,omitzero"`
}
RetrievalQueryRequest defines model for RetrievalQueryRequest.
type RetrievalQueryRequestExpandStrategy ¶
type RetrievalQueryRequestExpandStrategy string
RetrievalQueryRequestExpandStrategy Strategy for merging graph results with search results: - union: Include nodes from both search and graph results - intersection: Only include nodes appearing in both
const ( RetrievalQueryRequestExpandStrategyIntersection RetrievalQueryRequestExpandStrategy = "intersection" RetrievalQueryRequestExpandStrategyUnion RetrievalQueryRequestExpandStrategy = "union" )
Defines values for RetrievalQueryRequestExpandStrategy.
type RetrievalReasoningStep ¶
type RetrievalReasoningStep struct {
// Action What action was taken
Action string `json:"action"`
// Details Additional details about the step (e.g., tool arguments, result count)
Details map[string]interface{} `json:"details,omitempty,omitzero"`
// DurationMs Server-side execution time in milliseconds
DurationMs int `json:"duration_ms,omitempty,omitzero"`
// ErrorMessage Error details when status is "error"
ErrorMessage string `json:"error_message,omitempty,omitzero"`
// Id Unique step ID for correlation and tracing
Id string `json:"id,omitempty,omitzero"`
// Status Outcome of this step
Status RetrievalReasoningStepStatus `json:"status,omitempty,omitzero"`
// Step Name of the tool call or action taken
Step string `json:"step"`
}
RetrievalReasoningStep A step in the retrieval reasoning chain
type RetrievalReasoningStepStatus ¶
type RetrievalReasoningStepStatus string
RetrievalReasoningStepStatus Outcome of this step
const ( RetrievalReasoningStepStatusError RetrievalReasoningStepStatus = "error" RetrievalReasoningStepStatusSkipped RetrievalReasoningStepStatus = "skipped" RetrievalReasoningStepStatusSuccess RetrievalReasoningStepStatus = "success" )
Defines values for RetrievalReasoningStepStatus.
type RetrievalStrategy ¶
type RetrievalStrategy string
RetrievalStrategy Strategy for document retrieval: - semantic: Vector similarity search using embeddings - bm25: Full-text search using BM25 scoring - metadata: Structured query on document fields - tree: Iterative tree navigation with summarization - graph: Relationship-based traversal - hybrid: Combine multiple strategies with RRF or rerank
const ( RetrievalStrategyBm25 RetrievalStrategy = "bm25" RetrievalStrategyGraph RetrievalStrategy = "graph" RetrievalStrategyHybrid RetrievalStrategy = "hybrid" RetrievalStrategyMetadata RetrievalStrategy = "metadata" RetrievalStrategySemantic RetrievalStrategy = "semantic" RetrievalStrategyTree RetrievalStrategy = "tree" )
Defines values for RetrievalStrategy.
type RetryConfig ¶
type RetryConfig struct {
// BackoffMultiplier Multiplier for exponential backoff
BackoffMultiplier float32 `json:"backoff_multiplier,omitempty,omitzero"`
// InitialBackoffMs Initial backoff delay in milliseconds
InitialBackoffMs int `json:"initial_backoff_ms,omitempty,omitzero"`
// MaxAttempts Maximum number of retry attempts
MaxAttempts int `json:"max_attempts,omitempty,omitzero"`
// MaxBackoffMs Maximum backoff delay in milliseconds
MaxBackoffMs int `json:"max_backoff_ms,omitempty,omitzero"`
}
RetryConfig Retry configuration for generator calls
type RouteType ¶
type RouteType string
RouteType Classification of query type: question (specific factual query) or search (exploratory query)
type ScanKeysJSONRequestBody ¶
type ScanKeysJSONRequestBody = ScanKeysRequest
ScanKeysJSONRequestBody defines body for ScanKeys for application/json ContentType.
type ScanKeysRequest ¶
type ScanKeysRequest struct {
// ExclusiveTo If true, exclude keys matching 'to' from the results.
// Default: false (inclusive upper bound).
ExclusiveTo bool `json:"exclusive_to,omitempty,omitzero"`
// Fields List of fields to include in each result. If not specified,
// only returns the key. Supports:
// - Simple fields: "title", "author"
// - Nested paths: "user.address.city"
// - Wildcards: "_chunks.*"
// - Exclusions: "-_chunks.*._embedding"
// - Special fields: "_embeddings", "_summaries", "_chunks"
Fields []string `json:"fields,omitempty,omitzero"`
// FilterQuery Bleve query to filter documents. Only documents matching this query
// are included in results. Uses the sear library for efficient per-document
// matching without requiring a full index.
//
// Examples:
// - Status filtering: `{"query": "status:published"}`
// - Date ranges: `{"query": "created_at:>2023-01-01"}`
// - Field matching: `{"query": "category:technology"}`
FilterQuery json.RawMessage `json:"filter_query,omitempty,omitzero"`
// From Start of the key range to scan (exclusive by default).
// Can be a full key or a prefix. If not specified, starts from
// the beginning of the table.
From string `json:"from,omitempty,omitzero"`
// InclusiveFrom If true, include keys matching 'from' in the results.
// Default: false (exclusive lower bound for pagination).
InclusiveFrom bool `json:"inclusive_from,omitempty,omitzero"`
// Limit Maximum number of results to return. If not specified, returns all
// matching keys in the range. Useful for pagination or sampling.
Limit int `json:"limit,omitempty,omitzero"`
// To End of the key range to scan (inclusive by default).
// Can be a full key or a prefix. If not specified, scans to
// the end of the table.
To string `json:"to,omitempty,omitzero"`
}
ScanKeysRequest Request to scan keys in a table within a key range. If no range is specified, scans all keys in the table.
type ScanKeysResponse ¶
type ScanKeysResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
func ParseScanKeysResponse ¶
func ParseScanKeysResponse(rsp *http.Response) (*ScanKeysResponse, error)
ParseScanKeysResponse parses an HTTP response from a ScanKeysWithResponse call
func (ScanKeysResponse) Status ¶
func (r ScanKeysResponse) Status() string
Status returns HTTPResponse.Status
func (ScanKeysResponse) StatusCode ¶
func (r ScanKeysResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SchemasAntflyType ¶
type SchemasAntflyType string
SchemasAntflyType Field type annotations for schema fields
const ( SchemasAntflyTypeBlob SchemasAntflyType = "blob" SchemasAntflyTypeBoolean SchemasAntflyType = "boolean" SchemasAntflyTypeDatetime SchemasAntflyType = "datetime" SchemasAntflyTypeEmbedding SchemasAntflyType = "embedding" SchemasAntflyTypeGeopoint SchemasAntflyType = "geopoint" SchemasAntflyTypeGeoshape SchemasAntflyType = "geoshape" SchemasAntflyTypeHtml SchemasAntflyType = "html" SchemasAntflyTypeKeyword SchemasAntflyType = "keyword" SchemasAntflyTypeLink SchemasAntflyType = "link" SchemasAntflyTypeNumeric SchemasAntflyType = "numeric" SchemasAntflyTypeSearchAsYouType SchemasAntflyType = "search_as_you_type" SchemasAntflyTypeText SchemasAntflyType = "text" )
Defines values for SchemasAntflyType.
type SecretEntry ¶
type SecretEntry struct {
CreatedAt time.Time `json:"created_at,omitempty,omitzero"`
// EnvVar Corresponding environment variable name (e.g., OPENAI_API_KEY)
EnvVar string `json:"env_var,omitempty,omitzero"`
// Key Secret name (e.g., openai.api_key)
Key string `json:"key"`
// Status Source of the secret configuration
Status SecretStatus `json:"status"`
UpdatedAt time.Time `json:"updated_at,omitempty,omitzero"`
}
SecretEntry defines model for SecretEntry.
type SecretList ¶
type SecretList struct {
Secrets []SecretEntry `json:"secrets"`
}
SecretList defines model for SecretList.
type SecretStatus ¶
type SecretStatus string
SecretStatus Source of the secret configuration
const ( SecretStatusConfiguredBoth SecretStatus = "configured_both" SecretStatusConfiguredEnv SecretStatus = "configured_env" SecretStatusConfiguredKeystore SecretStatus = "configured_keystore" )
Defines values for SecretStatus.
type SecretWriteRequest ¶
type SecretWriteRequest struct {
// Value Secret value (stored encrypted, never returned)
Value string `json:"value"`
}
SecretWriteRequest defines model for SecretWriteRequest.
type SemanticQueryMode ¶
type SemanticQueryMode string
SemanticQueryMode Mode for semantic query generation: - rewrite: Transform query into expanded keywords/concepts optimized for vector search (Level 2 optimization) - hypothetical: Generate a hypothetical answer that would appear in relevant documents (HyDE - Level 3 optimization)
const ( SemanticQueryModeHypothetical SemanticQueryMode = "hypothetical" SemanticQueryModeRewrite SemanticQueryMode = "rewrite" )
Defines values for SemanticQueryMode.
type SerperSearchConfig ¶
type SerperSearchConfig struct {
// ApiKey Serper API key (or set SERPER_API_KEY env var)
ApiKey string `json:"api_key,omitempty,omitzero"`
// Language Preferred language for results (e.g., 'en', 'es', 'fr')
Language string `json:"language,omitempty,omitzero"`
// MaxResults Maximum number of search results to return
MaxResults int `json:"max_results,omitempty,omitzero"`
// Provider The web search provider to use.
//
// - **google**: Google Custom Search API (requires CSE setup)
// - **bing**: Microsoft Bing Web Search API
// - **serper**: Serper.dev Google Search API (simpler setup)
// - **tavily**: Tavily AI Search API (optimized for RAG)
// - **brave**: Brave Search API
// - **duckduckgo**: DuckDuckGo Instant Answer API (limited, no API key)
Provider WebSearchProvider `json:"provider"`
// Region Preferred region for results (e.g., 'us', 'uk', 'de')
Region string `json:"region,omitempty,omitzero"`
// SafeSearch Enable safe search filtering
SafeSearch *bool `json:"safe_search,omitempty"`
// SearchType Type of search to perform
SearchType SerperSearchConfigSearchType `json:"search_type,omitempty,omitzero"`
// TimePeriod Time period filter: d=day, w=week, m=month, y=year
TimePeriod SerperSearchConfigTimePeriod `json:"time_period,omitempty,omitzero"`
// TimeoutMs Request timeout in milliseconds
TimeoutMs int `json:"timeout_ms,omitempty,omitzero"`
}
SerperSearchConfig defines model for SerperSearchConfig.
type SerperSearchConfigSearchType ¶
type SerperSearchConfigSearchType string
SerperSearchConfigSearchType Type of search to perform
const ( SerperSearchConfigSearchTypeImages SerperSearchConfigSearchType = "images" SerperSearchConfigSearchTypeNews SerperSearchConfigSearchType = "news" SerperSearchConfigSearchTypePlaces SerperSearchConfigSearchType = "places" SerperSearchConfigSearchTypeSearch SerperSearchConfigSearchType = "search" SerperSearchConfigSearchTypeShopping SerperSearchConfigSearchType = "shopping" )
Defines values for SerperSearchConfigSearchType.
type SerperSearchConfigTimePeriod ¶
type SerperSearchConfigTimePeriod string
SerperSearchConfigTimePeriod Time period filter: d=day, w=week, m=month, y=year
const ( SerperSearchConfigTimePeriodD SerperSearchConfigTimePeriod = "d" SerperSearchConfigTimePeriodM SerperSearchConfigTimePeriod = "m" SerperSearchConfigTimePeriodW SerperSearchConfigTimePeriod = "w" SerperSearchConfigTimePeriodY SerperSearchConfigTimePeriod = "y" )
Defines values for SerperSearchConfigTimePeriod.
type ShardConfig ¶
type ShardConfig struct {
ByteRange ByteRange `json:"byte_range"`
}
ShardConfig defines model for ShardConfig.
type SignificanceAlgorithm ¶
type SignificanceAlgorithm string
SignificanceAlgorithm Algorithm for computing term significance: - jlh: JLH algorithm (default) - mutual_information: Mutual Information - chi_squared: Chi-squared test - percentage: Simple percentage comparison
const ( SignificanceAlgorithmChiSquared SignificanceAlgorithm = "chi_squared" SignificanceAlgorithmJlh SignificanceAlgorithm = "jlh" SignificanceAlgorithmMutualInformation SignificanceAlgorithm = "mutual_information" SignificanceAlgorithmPercentage SignificanceAlgorithm = "percentage" )
Defines values for SignificanceAlgorithm.
type SortDirection ¶
type SortDirection = bool
SortDirection Sort direction for a single field. true = descending, false = ascending.
type StorageStatus ¶
type StorageStatus struct {
// DiskUsage Disk usage in bytes.
DiskUsage uint64 `json:"disk_usage,omitempty,omitzero"`
// Empty Whether the table has received data.
Empty bool `json:"empty,omitempty,omitzero"`
}
StorageStatus defines model for StorageStatus.
type SuccessMessage ¶
type SuccessMessage struct {
Message string `json:"message,omitempty,omitzero"`
}
SuccessMessage defines model for SuccessMessage.
type SyncLevel ¶
type SyncLevel string
SyncLevel Synchronization level for batch operations: - "propose": Wait for Raft proposal acceptance (fastest, default) - "write": Wait for Pebble KV write - "full_text": Wait for full-text index WAL write - "enrichments": Pre-compute enrichments before Raft proposal (synchronous enrichment generation) - "aknn": Wait for vector index write with best-effort synchronous embedding (falls back to async on timeout, slowest, most durable)
type Table ¶
type Table struct {
// Description Optional description of the table.
Description string `json:"description,omitempty,omitzero"`
Indexes map[string]IndexConfig `json:"indexes"`
Name string `json:"name"`
// ReplicationSources PostgreSQL CDC replication sources configured for this table.
ReplicationSources []ReplicationSource `json:"replication_sources,omitempty,omitzero"`
// Schema Schema definition for a table with multiple document types
Schema TableSchema `json:"schema,omitempty,omitzero"`
Shards map[string]ShardConfig `json:"shards"`
}
Table defines model for Table.
type TableBackupStatus ¶
type TableBackupStatus struct {
// Error Error message if backup failed
Error string `json:"error,omitempty,omitzero"`
// Name Table name
Name string `json:"name"`
// Status Backup status for this table
Status TableBackupStatusStatus `json:"status"`
}
TableBackupStatus defines model for TableBackupStatus.
type TableBackupStatusStatus ¶
type TableBackupStatusStatus string
TableBackupStatusStatus Backup status for this table
const ( TableBackupStatusStatusCompleted TableBackupStatusStatus = "completed" TableBackupStatusStatusFailed TableBackupStatusStatus = "failed" TableBackupStatusStatusSkipped TableBackupStatusStatus = "skipped" )
Defines values for TableBackupStatusStatus.
type TableRestoreStatus ¶
type TableRestoreStatus struct {
// Error Error message if restore failed
Error string `json:"error,omitempty,omitzero"`
// Name Table name
Name string `json:"name"`
// Status Restore status for this table
Status TableRestoreStatusStatus `json:"status"`
}
TableRestoreStatus defines model for TableRestoreStatus.
type TableRestoreStatusStatus ¶
type TableRestoreStatusStatus string
TableRestoreStatusStatus Restore status for this table
const ( TableRestoreStatusStatusFailed TableRestoreStatusStatus = "failed" TableRestoreStatusStatusSkipped TableRestoreStatusStatus = "skipped" TableRestoreStatusStatusTriggered TableRestoreStatusStatus = "triggered" )
Defines values for TableRestoreStatusStatus.
type TableSchema ¶
type TableSchema struct {
// DefaultType Default type to use from the document_types.
DefaultType string `json:"default_type,omitempty,omitzero"`
// DocumentSchemas A map of type names to their document json schemas.
DocumentSchemas map[string]DocumentSchema `json:"document_schemas,omitempty,omitzero"`
// DynamicTemplates Rules for mapping dynamically detected fields. When a document contains fields
// that don't have explicit mappings and dynamic mapping is enabled, templates are
// evaluated in order to determine how those fields should be indexed.
DynamicTemplates []DynamicTemplate `json:"dynamic_templates,omitempty,omitzero"`
// EnforceTypes Whether to enforce that documents must match one of the provided document types.
// If false, documents not matching any type will be accepted but not indexed.
EnforceTypes bool `json:"enforce_types,omitempty,omitzero"`
// TtlDuration The duration after which documents should expire, based on the ttl_field timestamp (optional).
// Uses Go duration format (e.g., '24h', '7d', '168h').
TtlDuration string `json:"ttl_duration,omitempty,omitzero"`
// TtlField The field containing the timestamp for TTL expiration (optional).
// Defaults to "_timestamp" if ttl_duration is specified but ttl_field is not.
TtlField string `json:"ttl_field,omitempty,omitzero"`
// Version Version of the schema. Used for migrations.
Version uint32 `json:"version,omitempty,omitzero"`
}
TableSchema Schema definition for a table with multiple document types
type TableStatistics ¶
type TableStatistics struct {
// FieldStats Per-field statistics for query optimization.
FieldStats map[string]FieldStatistics `json:"field_stats,omitempty,omitzero"`
// LastUpdated When these statistics were last computed.
LastUpdated time.Time `json:"last_updated,omitempty,omitzero"`
// RowCount Approximate number of rows in the table.
RowCount int64 `json:"row_count,omitempty,omitzero"`
// SizeBytes Approximate size of the table in bytes.
SizeBytes int64 `json:"size_bytes,omitempty,omitzero"`
}
TableStatistics Statistics about a table used for query planning.
type TableStatus ¶
type TableStatus struct {
// Description Optional description of the table.
Description string `json:"description,omitempty,omitzero"`
Indexes map[string]IndexConfig `json:"indexes"`
Name string `json:"name"`
// ReplicationSources PostgreSQL CDC replication sources configured for this table.
ReplicationSources []ReplicationSource `json:"replication_sources,omitempty,omitzero"`
// Schema Schema definition for a table with multiple document types
Schema TableSchema `json:"schema,omitempty,omitzero"`
Shards map[string]ShardConfig `json:"shards"`
StorageStatus StorageStatus `json:"storage_status"`
}
TableStatus defines model for TableStatus.
type TavilySearchConfig ¶
type TavilySearchConfig struct {
// ApiKey Tavily API key (or set TAVILY_API_KEY env var)
ApiKey string `json:"api_key,omitempty,omitzero"`
// ExcludeDomains Exclude results from these domains
ExcludeDomains []string `json:"exclude_domains,omitempty,omitzero"`
// IncludeAnswer Include AI-generated answer summary
IncludeAnswer bool `json:"include_answer,omitempty,omitzero"`
// IncludeDomains Only include results from these domains
IncludeDomains []string `json:"include_domains,omitempty,omitzero"`
// IncludeRawContent Include raw HTML content of pages
IncludeRawContent bool `json:"include_raw_content,omitempty,omitzero"`
// Language Preferred language for results (e.g., 'en', 'es', 'fr')
Language string `json:"language,omitempty,omitzero"`
// MaxResults Maximum number of search results to return
MaxResults int `json:"max_results,omitempty,omitzero"`
// Provider The web search provider to use.
//
// - **google**: Google Custom Search API (requires CSE setup)
// - **bing**: Microsoft Bing Web Search API
// - **serper**: Serper.dev Google Search API (simpler setup)
// - **tavily**: Tavily AI Search API (optimized for RAG)
// - **brave**: Brave Search API
// - **duckduckgo**: DuckDuckGo Instant Answer API (limited, no API key)
Provider WebSearchProvider `json:"provider"`
// Region Preferred region for results (e.g., 'us', 'uk', 'de')
Region string `json:"region,omitempty,omitzero"`
// SafeSearch Enable safe search filtering
SafeSearch *bool `json:"safe_search,omitempty"`
// SearchDepth Search depth:
// - basic: Fast search with standard results
// - advanced: Deeper search with more comprehensive results
SearchDepth TavilySearchConfigSearchDepth `json:"search_depth,omitempty,omitzero"`
// TimeoutMs Request timeout in milliseconds
TimeoutMs int `json:"timeout_ms,omitempty,omitzero"`
}
TavilySearchConfig defines model for TavilySearchConfig.
type TavilySearchConfigSearchDepth ¶
type TavilySearchConfigSearchDepth string
TavilySearchConfigSearchDepth Search depth: - basic: Fast search with standard results - advanced: Deeper search with more comprehensive results
const ( TavilySearchConfigSearchDepthAdvanced TavilySearchConfigSearchDepth = "advanced" TavilySearchConfigSearchDepthBasic TavilySearchConfigSearchDepth = "basic" )
Defines values for TavilySearchConfigSearchDepth.
type TemplateFieldMapping ¶
type TemplateFieldMapping struct {
// Analyzer Analyzer name (e.g., "standard", "keyword", "en", "html_analyzer").
// Used for text fields to control tokenization and normalization.
Analyzer string `json:"analyzer,omitempty,omitzero"`
// DocValues Whether to enable doc values for sorting/faceting
DocValues bool `json:"doc_values,omitempty,omitzero"`
// IncludeInAll Whether to include in the _all field for cross-field search
IncludeInAll bool `json:"include_in_all,omitempty,omitzero"`
// Index Whether to index the field (default true)
Index bool `json:"index,omitempty,omitzero"`
// Store Whether to store the field value (default false)
Store bool `json:"store,omitempty,omitzero"`
// Type Field type annotations for schema fields
Type SchemasAntflyType `json:"type,omitempty,omitzero"`
}
TemplateFieldMapping Field mapping to apply when a dynamic template matches
type TermQuery ¶
type TermQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
Term string `json:"term"`
}
TermQuery defines model for TermQuery.
type TermRangeQuery ¶
type TermRangeQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
InclusiveMax bool `json:"inclusive_max,omitzero"`
InclusiveMin bool `json:"inclusive_min,omitzero"`
Max string `json:"max,omitzero"`
Min string `json:"min,omitzero"`
}
TermRangeQuery defines model for TermRangeQuery.
type TermiteChunkerConfig ¶
type TermiteChunkerConfig struct {
// ApiUrl The URL of the Termite API endpoint (e.g., 'http://localhost:8080'). Can also be set via ANTFLY_TERMITE_URL environment variable.
ApiUrl string `json:"api_url,omitempty,omitzero"`
// Audio Options specific to audio chunking.
Audio AudioChunkOptions `json:"audio,omitempty,omitzero"`
// MaxChunks Maximum number of chunks to generate per document.
MaxChunks int `json:"max_chunks,omitempty,omitzero"`
// Model The chunking model to use. Either 'fixed' for simple token-based chunking, or a model name from models/chunkers/{name}/.
Model string `json:"model"`
// Text Options specific to text chunking.
Text TextChunkOptions `json:"text,omitempty,omitzero"`
// Threshold Confidence threshold for model-based chunking (0.0-1.0).
Threshold float32 `json:"threshold,omitempty,omitzero"`
}
TermiteChunkerConfig defines model for TermiteChunkerConfig.
type TermiteEmbedderConfig ¶
type TermiteEmbedderConfig struct {
// ApiUrl The URL of the Termite API endpoint. Can also be set via ANTFLY_TERMITE_URL environment variable.
ApiUrl string `json:"api_url,omitempty,omitzero"`
// Model The embedding model name (maps to models/embedders/{name}/ directory).
Model string `json:"model"`
}
TermiteEmbedderConfig Configuration for the Termite embedding provider.
Termite is Antfly's built-in ML service for local embeddings using ONNX models. It provides embedding generation with multi-tier caching (memory + persistent).
**Features:** - Local ONNX-based embedding generation - L1 memory cache with configurable TTL - L2 persistent Pebble database cache - Singleflight deduplication for concurrent identical requests
**Example Models:** bge-base-en-v1.5 (768 dims), all-MiniLM-L6-v2 (384 dims)
Models are loaded from the `models/embedders/{name}/` directory.
type TermiteGeneratorConfig ¶
type TermiteGeneratorConfig struct {
// ApiUrl The URL of the Termite API endpoint.
ApiUrl string `json:"api_url,omitempty,omitzero"`
// MaxTokens Maximum number of tokens to generate.
MaxTokens int `json:"max_tokens,omitempty,omitzero"`
// Model The name of the generator model (maps to models/generators/{name}/ directory).
Model string `json:"model"`
// Temperature Controls randomness in generation (0.0-2.0).
Temperature float32 `json:"temperature,omitempty,omitzero"`
// Timeout HTTP response timeout in seconds for Termite API calls. Defaults to 540 (9 minutes). Increase for large models on slow hardware.
Timeout int `json:"timeout,omitempty,omitzero"`
// TopK Top-k sampling parameter.
TopK int `json:"top_k,omitempty,omitzero"`
// TopP Nucleus sampling parameter.
TopP float32 `json:"top_p,omitempty,omitzero"`
}
TermiteGeneratorConfig Configuration for the Termite generative AI provider.
Termite is Antfly's built-in ML service for local LLM inference using ONNX Runtime GenAI models. It provides text generation with automatic model discovery from the `models/generators/` directory.
**Example Models:** onnxruntime/Gemma-3-ONNX (from HuggingFace)
**Features:** - Local inference with no external API dependencies - ONNX Runtime GenAI for efficient CPU/GPU execution - Auto-discovery of models from `models/generators/` directory - OpenAI-compatible chat format
type TermiteRerankerConfig ¶
type TermiteRerankerConfig struct {
// Model The name of the reranking model (e.g., cross-encoder model name).
Model string `json:"model"`
// Url The URL of the Termite API endpoint.
Url string `json:"url,omitempty,omitzero"`
}
TermiteRerankerConfig Configuration for the Termite reranking provider.
type TextChunkOptions ¶
type TextChunkOptions struct {
// OverlapTokens Number of tokens to overlap between consecutive chunks. Helps maintain context across chunk boundaries. Only used by fixed-size chunkers.
OverlapTokens int `json:"overlap_tokens,omitempty,omitzero"`
// Separator Separator string for splitting (e.g., '\n\n' for paragraphs). Only used by fixed-size chunkers.
Separator string `json:"separator,omitempty,omitzero"`
// TargetTokens Target number of tokens per chunk.
TargetTokens int `json:"target_tokens,omitempty,omitzero"`
}
TextChunkOptions Options specific to text chunking.
type TransactionCommitRequest ¶
type TransactionCommitRequest struct {
// ReadSet Set of keys that were read during the transaction, with their observed versions.
// The server verifies these versions still match before committing writes.
ReadSet []TransactionReadItem `json:"read_set"`
// SyncLevel Synchronization level for batch operations:
// - "propose": Wait for Raft proposal acceptance (fastest, default)
// - "write": Wait for Pebble KV write
// - "full_text": Wait for full-text index WAL write
// - "enrichments": Pre-compute enrichments before Raft proposal (synchronous enrichment generation)
// - "aknn": Wait for vector index write with best-effort synchronous embedding (falls back to async on timeout, slowest, most durable)
SyncLevel SyncLevel `json:"sync_level,omitempty,omitzero"`
// Tables Write set: map of table names to batch operations, same format as MultiBatchRequest.tables.
Tables map[string]BatchRequest `json:"tables"`
}
TransactionCommitRequest Stateless OCC (Optimistic Concurrency Control) transaction commit request.
The client reads documents (capturing version tokens from the X-Antfly-Version response header on lookups), computes writes locally, then submits everything in this single commit request. The server validates that all read versions still match before executing writes atomically via 2PC.
**No server-side state**: There is no "begin" endpoint. The client manages its own read set and submits the full transaction in one request.
type TransactionCommitResponse ¶
type TransactionCommitResponse struct {
// Conflict Details about the conflict that caused an abort (only present when status is "aborted")
Conflict struct {
// Key Key that had a version mismatch
Key string `json:"key,omitempty,omitzero"`
// Message Human-readable conflict description
Message string `json:"message,omitempty,omitzero"`
// Table Table where the conflict was detected
Table string `json:"table,omitempty,omitzero"`
} `json:"conflict,omitempty,omitzero"`
// Status Whether the transaction was committed or aborted due to a conflict
Status TransactionCommitResponseStatus `json:"status"`
// Tables Per-table batch results (only present when status is "committed")
Tables map[string]BatchResponse `json:"tables,omitempty,omitzero"`
}
TransactionCommitResponse Result of an OCC transaction commit attempt.
type TransactionCommitResponseStatus ¶
type TransactionCommitResponseStatus string
TransactionCommitResponseStatus Whether the transaction was committed or aborted due to a conflict
const ( TransactionCommitResponseStatusAborted TransactionCommitResponseStatus = "aborted" TransactionCommitResponseStatusCommitted TransactionCommitResponseStatus = "committed" )
Defines values for TransactionCommitResponseStatus.
type TransactionReadItem ¶
type TransactionReadItem struct {
// Key Document key that was read
Key string `json:"key"`
// Table Table name the key belongs to
Table string `json:"table"`
// Version Version token observed at read time (from X-Antfly-Version header).
// Use "0" to assert the key did not exist at read time.
Version string `json:"version"`
}
TransactionReadItem A key that was read as part of an OCC transaction, along with the version observed at read time. Used to detect conflicts at commit time.
type Transform ¶
type Transform struct {
// Key Document key (must be a string, not an object like inserts)
Key string `json:"key"`
// Operations List of operations to apply in sequence
Operations []TransformOp `json:"operations"`
// Upsert If true, create document if it doesn't exist (like MongoDB upsert)
Upsert bool `json:"upsert,omitempty,omitzero"`
}
Transform In-place document transformation using MongoDB-style operators. Transforms are applied atomically at the storage layer, eliminating read-modify-write races.
**Important:** Transform results are NOT validated against the table schema. This improves performance but means it's possible to create invalid documents. Use with care and ensure your operations maintain schema compliance.
type TransformOp ¶
type TransformOp struct {
// Op MongoDB-style update operator
Op TransformOpType `json:"op"`
// Path JSONPath to field (e.g., "$.user.name", "$.tags", or "user.name")
Path string `json:"path"`
// Value Value for operation (not required for $unset, $currentDate). Type depends on operator (number for $inc/$mul, any for $set, etc.)
Value interface{} `json:"value,omitempty,omitzero"`
}
TransformOp defines model for TransformOp.
type TransformOpType ¶
type TransformOpType string
TransformOpType MongoDB-style update operator
const ( TransformOpTypeAddToSet TransformOpType = "$addToSet" TransformOpTypeCurrentDate TransformOpType = "$currentDate" TransformOpTypeInc TransformOpType = "$inc" TransformOpTypeMax TransformOpType = "$max" TransformOpTypeMin TransformOpType = "$min" TransformOpTypeMul TransformOpType = "$mul" TransformOpTypePop TransformOpType = "$pop" TransformOpTypePull TransformOpType = "$pull" TransformOpTypePush TransformOpType = "$push" TransformOpTypeRename TransformOpType = "$rename" TransformOpTypeSet TransformOpType = "$set" TransformOpTypeUnset TransformOpType = "$unset" )
Defines values for TransformOpType.
type TraversalResult ¶
type TraversalResult struct {
// Depth Distance from start node (0 = start node)
Depth int `json:"depth"`
// Document Document data (if loaded)
Document map[string]interface{} `json:"document,omitempty,omitzero"`
// Key Base64-encoded document key
Key []byte `json:"key"`
// Path Sequence of keys from start to this node (if include_paths=true)
Path [][]byte `json:"path,omitempty,omitzero"`
// PathEdges Sequence of edges from start to this node (if include_paths=true)
PathEdges []Edge `json:"path_edges,omitempty,omitzero"`
// TotalWeight Product of edge weights along the path
TotalWeight float64 `json:"total_weight,omitempty,omitzero"`
}
TraversalResult A single result from graph traversal
type TraversalRules ¶
type TraversalRules struct {
// DeduplicateNodes Visit each node only once
DeduplicateNodes bool `json:"deduplicate_nodes,omitempty,omitzero"`
// Direction Direction of edges to query:
// - out: Outgoing edges from the node
// - in: Incoming edges to the node
// - both: Both outgoing and incoming edges
Direction EdgeDirection `json:"direction,omitempty,omitzero"`
// EdgeTypes Filter edges by type (empty = all types)
EdgeTypes []string `json:"edge_types,omitempty,omitzero"`
// IncludePaths Include path information in results
IncludePaths bool `json:"include_paths,omitempty,omitzero"`
// MaxDepth Maximum traversal depth (0 = unlimited)
MaxDepth int `json:"max_depth,omitempty,omitzero"`
// MaxResults Maximum results to return (0 = unlimited)
MaxResults int `json:"max_results,omitempty,omitzero"`
// MaxWeight Maximum edge weight filter
MaxWeight float64 `json:"max_weight,omitempty,omitzero"`
// MinWeight Minimum edge weight filter
MinWeight float64 `json:"min_weight,omitempty,omitzero"`
}
TraversalRules Rules for graph traversal
type TraverseResponse ¶
type TraverseResponse struct {
// Count Total number of results
Count int `json:"count,omitempty,omitzero"`
Results []TraversalResult `json:"results,omitempty,omitzero"`
}
TraverseResponse defines model for TraverseResponse.
type TreeSearchConfig ¶
type TreeSearchConfig struct {
// BeamWidth Number of branches to explore at each level
BeamWidth int `json:"beam_width,omitempty,omitzero"`
// Index Name of the graph index to use for tree navigation
Index string `json:"index"`
// MaxDepth Maximum depth to traverse in the tree
MaxDepth int `json:"max_depth,omitempty,omitzero"`
// StartNodes Starting nodes for tree search:
// - "$roots" - Query for root nodes (nodes with no parents)
// - Comma-separated explicit node IDs
// When omitted and combined with a QueryRequest in a RetrievalQueryRequest,
// the query results are used as start nodes.
StartNodes string `json:"start_nodes,omitempty,omitzero"`
}
TreeSearchConfig Configuration for tree search strategy. Tree search navigates hierarchical document structures by evaluating summaries at each level.
type UpdatePasswordRequest ¶
type UpdatePasswordRequest struct {
NewPassword string `json:"new_password"`
}
UpdatePasswordRequest defines model for UpdatePasswordRequest.
type UpdateSchemaJSONRequestBody ¶
type UpdateSchemaJSONRequestBody = TableSchema
UpdateSchemaJSONRequestBody defines body for UpdateSchema for application/json ContentType.
type UpdateSchemaResponse ¶
type UpdateSchemaResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Table
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
func ParseUpdateSchemaResponse ¶
func ParseUpdateSchemaResponse(rsp *http.Response) (*UpdateSchemaResponse, error)
ParseUpdateSchemaResponse parses an HTTP response from a UpdateSchemaWithResponse call
func (UpdateSchemaResponse) Status ¶
func (r UpdateSchemaResponse) Status() string
Status returns HTTPResponse.Status
func (UpdateSchemaResponse) StatusCode ¶
func (r UpdateSchemaResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type UpdateUserPasswordJSONRequestBody ¶
type UpdateUserPasswordJSONRequestBody = UpdatePasswordRequest
UpdateUserPasswordJSONRequestBody defines body for UpdateUserPassword for application/json ContentType.
type UpdateUserPasswordResponse ¶
type UpdateUserPasswordResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *SuccessMessage
JSON400 *Error
JSON404 *Error
JSON500 *Error
}
func ParseUpdateUserPasswordResponse ¶
func ParseUpdateUserPasswordResponse(rsp *http.Response) (*UpdateUserPasswordResponse, error)
ParseUpdateUserPasswordResponse parses an HTTP response from a UpdateUserPasswordWithResponse call
func (UpdateUserPasswordResponse) Status ¶
func (r UpdateUserPasswordResponse) Status() string
Status returns HTTPResponse.Status
func (UpdateUserPasswordResponse) StatusCode ¶
func (r UpdateUserPasswordResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type User ¶
type User struct {
// PasswordHash Base64 encoded password hash. Exposing this is a security risk.
PasswordHash []byte `json:"password_hash"`
Username string `json:"username"`
}
User defines model for User.
type UserNamePathParameter ¶
type UserNamePathParameter = string
UserNamePathParameter defines model for UserNamePathParameter.
type ValidationError ¶
ValidationError represents a single validation error from document schema validation
type ValidationResult ¶
type ValidationResult struct {
Valid bool
Errors []ValidationError
}
ValidationResult contains the results of document validation
type VertexEmbedderConfig ¶
type VertexEmbedderConfig struct {
// CredentialsPath Path to service account JSON key file. Alternative to ADC for non-GCP environments.
CredentialsPath string `json:"credentials_path,omitempty,omitzero"`
// Dimension The dimension of the embedding vector (768, 1536, or 3072 for gemini-embedding-001; 128-1408 for multimodalembedding).
Dimension int `json:"dimension,omitempty,omitzero"`
// Location Google Cloud region for Vertex AI API (e.g., 'us-central1', 'europe-west1'). Can also be set via GOOGLE_CLOUD_LOCATION. Defaults to 'us-central1'.
Location string `json:"location,omitempty,omitzero"`
// Model The name of the Vertex AI embedding model to use.
Model string `json:"model"`
// ProjectId Google Cloud project ID. Can also be set via GOOGLE_CLOUD_PROJECT environment variable.
ProjectId string `json:"project_id,omitempty,omitzero"`
}
VertexEmbedderConfig Configuration for Google Cloud Vertex AI embedding models (enterprise-grade).
Uses Application Default Credentials (ADC) for authentication. Requires IAM role `roles/aiplatform.user`.
**Example Models:** gemini-embedding-001 (default, 3072 dims), multimodalembedding (images/audio/video)
**Docs:** https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings
type VertexGeneratorConfig ¶
type VertexGeneratorConfig struct {
// CredentialsPath Path to service account JSON key file. Sets GOOGLE_APPLICATION_CREDENTIALS environment variable. Alternative to ADC for non-GCP environments.
CredentialsPath string `json:"credentials_path,omitempty,omitzero"`
// Location Google Cloud region for Vertex AI API (e.g., 'us-central1', 'europe-west1'). Can also be set via GOOGLE_CLOUD_LOCATION. Defaults to 'us-central1'.
Location string `json:"location,omitempty,omitzero"`
// MaxTokens Maximum number of tokens to generate in the response.
MaxTokens int `json:"max_tokens,omitempty,omitzero"`
// Model The name of the Vertex AI model to use.
Model string `json:"model"`
// ProjectId Google Cloud project ID. Can also be set via GOOGLE_CLOUD_PROJECT environment variable.
ProjectId string `json:"project_id,omitempty,omitzero"`
// Temperature Controls randomness in generation (0.0-2.0). Higher values make output more random.
Temperature float32 `json:"temperature,omitempty,omitzero"`
// TopK Top-k sampling parameter. Only sample from the top K options for each subsequent token.
TopK int `json:"top_k,omitempty,omitzero"`
// TopP Nucleus sampling parameter (0.0-1.0). Alternative to temperature.
TopP float32 `json:"top_p,omitempty,omitzero"`
}
VertexGeneratorConfig Configuration for Google Cloud Vertex AI generative models (enterprise-grade).
Uses Application Default Credentials (ADC) for authentication. In GCP environments (Cloud Run, GKE, Compute Engine) this is automatic. For local dev, run `gcloud auth application-default login`. Requires IAM role `roles/aiplatform.user`.
**Example Models:** gemini-2.5-flash (default), gemini-2.5-pro, gemini-3.0-pro
**Docs:** https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models
type VertexRerankerConfig ¶
type VertexRerankerConfig struct {
// CredentialsPath Path to service account JSON file. Falls back to GOOGLE_APPLICATION_CREDENTIALS environment variable.
CredentialsPath string `json:"credentials_path,omitempty,omitzero"`
// Model The ranking model to use.
Model string `json:"model"`
// ProjectId Google Cloud project ID. Falls back to GOOGLE_CLOUD_PROJECT environment variable.
ProjectId string `json:"project_id,omitempty,omitzero"`
// TopN Maximum number of records to return. If not specified, returns all documents with scores.
TopN int `json:"top_n,omitempty,omitzero"`
}
VertexRerankerConfig Configuration for the Google Vertex AI Ranking API.
Uses Application Default Credentials (ADC) or explicit credentials path.
**Prerequisites:** - Enable Discovery Engine API: `gcloud services enable discoveryengine.googleapis.com` - Grant IAM role: `roles/discoveryengine.admin` (includes `discoveryengine.rankingConfigs.rank` permission)
**Models:** semantic-ranker-default@latest (default), semantic-ranker-fast-004
**Docs:** https://cloud.google.com/generative-ai-app-builder/docs/ranking
**IAM:** https://cloud.google.com/generative-ai-app-builder/docs/access-control
type WebSearchConfig ¶
type WebSearchConfig struct {
// Language Preferred language for results (e.g., 'en', 'es', 'fr')
Language string `json:"language,omitempty,omitzero"`
// MaxResults Maximum number of search results to return
MaxResults int `json:"max_results,omitempty,omitzero"`
// Provider The web search provider to use.
//
// - **google**: Google Custom Search API (requires CSE setup)
// - **bing**: Microsoft Bing Web Search API
// - **serper**: Serper.dev Google Search API (simpler setup)
// - **tavily**: Tavily AI Search API (optimized for RAG)
// - **brave**: Brave Search API
// - **duckduckgo**: DuckDuckGo Instant Answer API (limited, no API key)
Provider WebSearchProvider `json:"provider"`
// Region Preferred region for results (e.g., 'us', 'uk', 'de')
Region string `json:"region,omitempty,omitzero"`
// SafeSearch Enable safe search filtering
SafeSearch *bool `json:"safe_search,omitempty"`
// TimeoutMs Request timeout in milliseconds
TimeoutMs int `json:"timeout_ms,omitempty,omitzero"`
}
WebSearchConfig A unified configuration for web search providers.
Each provider has specific configuration requirements. Use the appropriate provider-specific config or set common options at the top level.
**Environment Variables (fallbacks):** - GOOGLE_CSE_API_KEY, GOOGLE_CSE_ID - BING_SEARCH_API_KEY - SERPER_API_KEY - TAVILY_API_KEY - BRAVE_API_KEY
type WebSearchProvider ¶
type WebSearchProvider string
WebSearchProvider The web search provider to use.
- **google**: Google Custom Search API (requires CSE setup) - **bing**: Microsoft Bing Web Search API - **serper**: Serper.dev Google Search API (simpler setup) - **tavily**: Tavily AI Search API (optimized for RAG) - **brave**: Brave Search API - **duckduckgo**: DuckDuckGo Instant Answer API (limited, no API key)
const ( WebSearchProviderBing WebSearchProvider = "bing" WebSearchProviderBrave WebSearchProvider = "brave" WebSearchProviderDuckduckgo WebSearchProvider = "duckduckgo" WebSearchProviderGoogle WebSearchProvider = "google" WebSearchProviderSerper WebSearchProvider = "serper" WebSearchProviderTavily WebSearchProvider = "tavily" )
Defines values for WebSearchProvider.
type WildcardQuery ¶
type WildcardQuery struct {
// Boost A floating-point number used to decrease or increase the relevance scores of a query.
Boost Boost `json:"boost,omitzero"`
Field string `json:"field,omitempty,omitzero"`
Wildcard string `json:"wildcard"`
}
WildcardQuery defines model for WildcardQuery.