Documentation
¶
Index ¶
- func EmbeddingsDBRecordToGrpcEmbeddingsDBRecord(record *Record) *embeddingsdb_grpc.EmbeddingsDBRecord
- func EmbeddingsDBSimilarRecordsToGrpcSimilarRecords(results []*SimilarRecord) []*embeddingsdb_grpc.SimilarRecord
- type GetRecordRequest
- type GetRecordResponse
- type Record
- type RemoveRecordRequest
- type SimilarRecord
- type SimilarRecordResponse
- type SimilarRecordsByIdRequest
- type SimilarRecordsRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmbeddingsDBRecordToGrpcEmbeddingsDBRecord ¶
func EmbeddingsDBRecordToGrpcEmbeddingsDBRecord(record *Record) *embeddingsdb_grpc.EmbeddingsDBRecord
func EmbeddingsDBSimilarRecordsToGrpcSimilarRecords ¶
func EmbeddingsDBSimilarRecordsToGrpcSimilarRecords(results []*SimilarRecord) []*embeddingsdb_grpc.SimilarRecord
Types ¶
type GetRecordRequest ¶
type GetRecordRequest struct {
// Provider is the name (or context) of the provider responsible for DepictionId.
Provider string `json:"provider"`
// Model is the name of the model to specify when querying for similar embeddings.
Model string `json:"model"`
// DepictionId is the unique identifier for the depiction for which embeddings have been generated.
DepictionId string `json:"depiction_id"`
}
func (*GetRecordRequest) Key ¶ added in v0.8.0
func (r *GetRecordRequest) Key() string
type GetRecordResponse ¶
type GetRecordResponse struct {
Record *Record `json:"record"`
}
type Record ¶
type Record struct {
// Provider is the name (or context) of the provider responsible for DepictionId.
Provider string `json:"provider" parquet:"provider,dict,zstd" bleve:"store"`
// DepictionId is the unique identifier for the depiction for which embeddings have been generated.
DepictionId string `json:"depiction_id" parquet:"depiction_id,dict,zstd" bleve:"store"`
// SubjectId is the unique identifier associated with the record that DepictionId depicts.
SubjectId string `json:"subject_id" parquet:"subject_id,dict,zstd" bleve:"store"`
// Model is the label for the model used to generate embeddings for DepictionId.
Model string `json:"model" parquet:"model,dict,zstd" bleve:"store"`
// Embeddings are the embeddings generated for DepictionId using Model.
Embeddings []float32 `json:"embeddings" parquet:"embeddings,plain,list" bleve:"store"` // Note the 'plain,list'. This is important in order to prevent DLBA which makes DuckDB sad.
// Created is the Unix timestamp when Embeddings were generated.
Created int64 `json:"created" parquet:"created" bleve:"store"`
// Attributes is an arbitrary map of key-value properties associated with the embeddings. Record attributes
// are encouraged to include the required [OEmbeddings] fields but this is not a requirement.
Attributes map[string]string `json:"attributes" parquet:"attributes" bleve:"store"`
}
Record defines a struct containing properties associated with individual records stored in an embeddings database.
func GrpcEmbeddingsRecordToEmbeddingsDBRecord ¶
func GrpcEmbeddingsRecordToEmbeddingsDBRecord(grpc_record *embeddingsdb_grpc.EmbeddingsDBRecord) *Record
func (*Record) OEmbeddings ¶ added in v0.7.0
func (r *Record) OEmbeddings() (*oembeddings.OEmbeddings, error)
Derive an oembeddings.OEmbeddings instance from the attributes in 'r'.
func (*Record) OEmbeddingsOrNil ¶ added in v0.7.0
func (r *Record) OEmbeddingsOrNil() *oembeddings.OEmbeddings
Derive an oembeddings.OEmbeddings instance from the attributes in 'r'. Return nil if this is not possible.
type RemoveRecordRequest ¶ added in v0.6.0
type RemoveRecordRequest struct {
// Provider is the name (or context) of the provider responsible for DepictionId.
Provider string `json:"provider"`
// Model is the name of the model to specify when querying for similar embeddings.
Model string `json:"model"`
// DepictionId is the unique identifier for the depiction for which embeddings have been generated.
DepictionId string `json:"depiction_id"`
}
func (*RemoveRecordRequest) Key ¶ added in v0.8.0
func (r *RemoveRecordRequest) Key() string
type SimilarRecord ¶
type SimilarRecord struct {
// Provider is the name (or context) of the provider responsible for DepictionId.
Provider string `json:"provider"`
// DepictionID is the unique identifier for the depiction associated with the result.
DepictionId string `json:"depiction_id"`
// DepictionID is the unique identifier for the subject associated with the result depiction.
SubjectId string `json:"subject_id"`
// Distance is the distance between the input embeddings and the result embeddings.
Distance float32 `json:"similarity"`
// Attributes is an arbitrary map of key-value properties associated with the embeddings.
Attributes map[string]string `json:"attributes"`
}
SimilarRecord is a struct containing properties for similar records returned from an embeddings database.
func GrpcSimilarRecordsResultsToEmbeddingDBSimilarRecords ¶
func GrpcSimilarRecordsResultsToEmbeddingDBSimilarRecords(records []*embeddingsdb_grpc.SimilarRecord) []*SimilarRecord
func (*SimilarRecord) OEmbeddings ¶ added in v0.7.0
func (r *SimilarRecord) OEmbeddings() (*oembeddings.OEmbeddings, error)
Derive an oembeddings.OEmbeddings instance from the attributes in 'r'.
func (*SimilarRecord) OEmbeddingsOrNil ¶ added in v0.7.0
func (r *SimilarRecord) OEmbeddingsOrNil() *oembeddings.OEmbeddings
Derive an oembeddings.OEmbeddings instance from the attributes in 'r'. Return nil if this is not possible.
type SimilarRecordResponse ¶
type SimilarRecordResponse struct {
Records []*SimilarRecord `json:"records"`
}
type SimilarRecordsByIdRequest ¶
type SimilarRecordsByIdRequest struct {
// Provider is the name (or context) of the provider responsible for DepictionId.
Provider string `json:"provider"`
// Model is the name of the model to specify when querying for similar embeddings.
Model string `json:"model"`
// DepictionId is the unique identifier for the depiction for which embeddings have been generated.
DepictionId string `json:"depiction_id"`
}
type SimilarRecordsRequest ¶
type SimilarRecordsRequest struct {
// Model is the name of the model to specify when querying for similar embeddings.
Model string `json:"model"`
// Embeddings are the embeddings to use for querying similar records.
Embeddings []float32 `json:"embeddings"`
// Zero or more depiction IDs to explicitly exclude from results.
Exclude []string `json:"exclude,omitempty"`
}
SimilarRecordsRequest is a struct containing properties for retrieving records from an embeddings database.
Directories
¶
| Path | Synopsis |
|---|---|
|
app
|
|
|
cmd
|
|
|
client
command
|
|
|
inspector
command
|
|
|
parquet-export
command
|
|
|
parquet-import
command
|
|
|
parquet-merge
command
|
|
|
s3vectors-add-metadata
command
|
|
|
server
command
|
|
|
s3vectors
Package s3vectors contains helper code for maintaining a DynamoDB table that mirrors the records stored in an S3 Vectors index.
|
Package s3vectors contains helper code for maintaining a DynamoDB table that mirrors the records stored in an S3 Vectors index. |