docarray

package
v0.0.0-...-2c5e70e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_docarray_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type DenseNdArrayProto

type DenseNdArrayProto struct {

	// the actual array data, in bytes
	Buffer []byte `protobuf:"bytes,1,opt,name=buffer,proto3" json:"buffer,omitempty"`
	// the shape (dimensions) of the array
	Shape []uint32 `protobuf:"varint,2,rep,packed,name=shape,proto3" json:"shape,omitempty"`
	// the data type of the array
	Dtype string `protobuf:"bytes,3,opt,name=dtype,proto3" json:"dtype,omitempty"`
	// contains filtered or unexported fields
}

* Represents a (quantized) dense n-dim array

func (*DenseNdArrayProto) Descriptor deprecated

func (*DenseNdArrayProto) Descriptor() ([]byte, []int)

Deprecated: Use DenseNdArrayProto.ProtoReflect.Descriptor instead.

func (*DenseNdArrayProto) GetBuffer

func (x *DenseNdArrayProto) GetBuffer() []byte

func (*DenseNdArrayProto) GetDtype

func (x *DenseNdArrayProto) GetDtype() string

func (*DenseNdArrayProto) GetShape

func (x *DenseNdArrayProto) GetShape() []uint32

func (*DenseNdArrayProto) ProtoMessage

func (*DenseNdArrayProto) ProtoMessage()

func (*DenseNdArrayProto) ProtoReflect

func (x *DenseNdArrayProto) ProtoReflect() protoreflect.Message

func (*DenseNdArrayProto) Reset

func (x *DenseNdArrayProto) Reset()

func (*DenseNdArrayProto) String

func (x *DenseNdArrayProto) String() string

type DocumentArrayProto

type DocumentArrayProto struct {
	Docs []*DocumentProto `protobuf:"bytes,1,rep,name=docs,proto3" json:"docs,omitempty"` // a list of Documents
	// contains filtered or unexported fields
}

func (*DocumentArrayProto) Descriptor deprecated

func (*DocumentArrayProto) Descriptor() ([]byte, []int)

Deprecated: Use DocumentArrayProto.ProtoReflect.Descriptor instead.

func (*DocumentArrayProto) GetDocs

func (x *DocumentArrayProto) GetDocs() []*DocumentProto

func (*DocumentArrayProto) ProtoMessage

func (*DocumentArrayProto) ProtoMessage()

func (*DocumentArrayProto) ProtoReflect

func (x *DocumentArrayProto) ProtoReflect() protoreflect.Message

func (*DocumentArrayProto) Reset

func (x *DocumentArrayProto) Reset()

func (*DocumentArrayProto) String

func (x *DocumentArrayProto) String() string

type DocumentProto

type DocumentProto struct {

	// A hexdigest that represents a unique document ID
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are assignable to Content:
	//	*DocumentProto_Blob
	//	*DocumentProto_Tensor
	//	*DocumentProto_Text
	Content isDocumentProto_Content `protobuf_oneof:"content"`
	// the depth of the recursive chunk structure
	Granularity uint32 `protobuf:"varint,5,opt,name=granularity,proto3" json:"granularity,omitempty"`
	// the width of the recursive match structure
	Adjacency uint32 `protobuf:"varint,6,opt,name=adjacency,proto3" json:"adjacency,omitempty"`
	// the parent id from the previous granularity
	ParentId string `protobuf:"bytes,7,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
	// The weight of this document
	Weight float32 `protobuf:"fixed32,8,opt,name=weight,proto3" json:"weight,omitempty"`
	// a uri of the document could be: a local file path, a remote url starts with http or https or data URI scheme
	Uri string `protobuf:"bytes,9,opt,name=uri,proto3" json:"uri,omitempty"`
	// modality, an identifier to the modality this document belongs to. In the scope of multi/cross modal search
	Modality string `protobuf:"bytes,10,opt,name=modality,proto3" json:"modality,omitempty"`
	// mime type of this document, for buffer content, this is required; for other contents, this can be guessed
	MimeType string `protobuf:"bytes,11,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
	// the offset of the doc
	Offset float32 `protobuf:"fixed32,12,opt,name=offset,proto3" json:"offset,omitempty"`
	// the position of the doc, could be start and end index of a string; could be x,y (top, left) coordinate of an image crop; could be timestamp of an audio clip
	Location []float32 `protobuf:"fixed32,13,rep,packed,name=location,proto3" json:"location,omitempty"`
	// list of the sub-documents of this document (recursive structure)
	Chunks []*DocumentProto `protobuf:"bytes,14,rep,name=chunks,proto3" json:"chunks,omitempty"`
	// the matched documents on the same level (recursive structure)
	Matches []*DocumentProto `protobuf:"bytes,15,rep,name=matches,proto3" json:"matches,omitempty"`
	// the embedding of this document
	Embedding *NdArrayProto `protobuf:"bytes,16,opt,name=embedding,proto3" json:"embedding,omitempty"`
	// a structured data value, consisting of field which map to dynamically typed values.
	Tags *structpb.Struct `protobuf:"bytes,17,opt,name=tags,proto3" json:"tags,omitempty"`
	// Scores performed on the document, each element corresponds to a metric
	Scores map[string]*NamedScoreProto `` /* 154-byte string literal not displayed */
	// Evaluations performed on the document, each element corresponds to a metric
	Evaluations map[string]*NamedScoreProto `` /* 164-byte string literal not displayed */
	// system-defined meta attributes represented in a structured data value.
	XMetadata *structpb.Struct `protobuf:"bytes,20,opt,name=_metadata,json=Metadata,proto3" json:"_metadata,omitempty"`
	// contains filtered or unexported fields
}

* Represents a Document

func (*DocumentProto) Descriptor deprecated

func (*DocumentProto) Descriptor() ([]byte, []int)

Deprecated: Use DocumentProto.ProtoReflect.Descriptor instead.

func (*DocumentProto) GetAdjacency

func (x *DocumentProto) GetAdjacency() uint32

func (*DocumentProto) GetBlob

func (x *DocumentProto) GetBlob() []byte

func (*DocumentProto) GetChunks

func (x *DocumentProto) GetChunks() []*DocumentProto

func (*DocumentProto) GetContent

func (m *DocumentProto) GetContent() isDocumentProto_Content

func (*DocumentProto) GetEmbedding

func (x *DocumentProto) GetEmbedding() *NdArrayProto

func (*DocumentProto) GetEvaluations

func (x *DocumentProto) GetEvaluations() map[string]*NamedScoreProto

func (*DocumentProto) GetGranularity

func (x *DocumentProto) GetGranularity() uint32

func (*DocumentProto) GetId

func (x *DocumentProto) GetId() string

func (*DocumentProto) GetLocation

func (x *DocumentProto) GetLocation() []float32

func (*DocumentProto) GetMatches

func (x *DocumentProto) GetMatches() []*DocumentProto

func (*DocumentProto) GetMimeType

func (x *DocumentProto) GetMimeType() string

func (*DocumentProto) GetModality

func (x *DocumentProto) GetModality() string

func (*DocumentProto) GetOffset

func (x *DocumentProto) GetOffset() float32

func (*DocumentProto) GetParentId

func (x *DocumentProto) GetParentId() string

func (*DocumentProto) GetScores

func (x *DocumentProto) GetScores() map[string]*NamedScoreProto

func (*DocumentProto) GetTags

func (x *DocumentProto) GetTags() *structpb.Struct

func (*DocumentProto) GetTensor

func (x *DocumentProto) GetTensor() *NdArrayProto

func (*DocumentProto) GetText

func (x *DocumentProto) GetText() string

func (*DocumentProto) GetUri

func (x *DocumentProto) GetUri() string

func (*DocumentProto) GetWeight

func (x *DocumentProto) GetWeight() float32

func (*DocumentProto) GetXMetadata

func (x *DocumentProto) GetXMetadata() *structpb.Struct

func (*DocumentProto) MarshalJSON

func (x *DocumentProto) MarshalJSON() ([]byte, error)

Custom JSON marshalling for DocumentProto

func (*DocumentProto) ProtoMessage

func (*DocumentProto) ProtoMessage()

func (*DocumentProto) ProtoReflect

func (x *DocumentProto) ProtoReflect() protoreflect.Message

func (*DocumentProto) Reset

func (x *DocumentProto) Reset()

func (*DocumentProto) String

func (x *DocumentProto) String() string

func (*DocumentProto) UnmarshalJSON

func (x *DocumentProto) UnmarshalJSON(data []byte) error

Custom JSON unmarshalling for DocumentProto

type DocumentProto_Blob

type DocumentProto_Blob struct {
	// the raw binary content of this document, which often represents the original document when comes into jina
	Blob []byte `protobuf:"bytes,2,opt,name=blob,proto3,oneof"`
}

type DocumentProto_Tensor

type DocumentProto_Tensor struct {
	// the ndarray of the image/audio/video document
	Tensor *NdArrayProto `protobuf:"bytes,3,opt,name=tensor,proto3,oneof"`
}

type DocumentProto_Text

type DocumentProto_Text struct {
	// a text document
	Text string `protobuf:"bytes,4,opt,name=text,proto3,oneof"`
}

type NamedScoreProto

type NamedScoreProto struct {
	Value       float32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"`               // value
	OpName      string  `protobuf:"bytes,2,opt,name=op_name,json=opName,proto3" json:"op_name,omitempty"` // the name of the operator/score function
	Description string  `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`     // text description of the score
	RefId       string  `protobuf:"bytes,4,opt,name=ref_id,json=refId,proto3" json:"ref_id,omitempty"`    // the score is computed between doc `id` and `ref_id`
	// contains filtered or unexported fields
}

* Represents the relevance model to `ref_id`

func (*NamedScoreProto) Descriptor deprecated

func (*NamedScoreProto) Descriptor() ([]byte, []int)

Deprecated: Use NamedScoreProto.ProtoReflect.Descriptor instead.

func (*NamedScoreProto) GetDescription

func (x *NamedScoreProto) GetDescription() string

func (*NamedScoreProto) GetOpName

func (x *NamedScoreProto) GetOpName() string

func (*NamedScoreProto) GetRefId

func (x *NamedScoreProto) GetRefId() string

func (*NamedScoreProto) GetValue

func (x *NamedScoreProto) GetValue() float32

func (*NamedScoreProto) ProtoMessage

func (*NamedScoreProto) ProtoMessage()

func (*NamedScoreProto) ProtoReflect

func (x *NamedScoreProto) ProtoReflect() protoreflect.Message

func (*NamedScoreProto) Reset

func (x *NamedScoreProto) Reset()

func (*NamedScoreProto) String

func (x *NamedScoreProto) String() string

type NdArrayProto

type NdArrayProto struct {

	// Types that are assignable to Content:
	//	*NdArrayProto_Dense
	//	*NdArrayProto_Sparse
	Content isNdArrayProto_Content `protobuf_oneof:"content"`
	// the name of the ndarray class
	ClsName    string           `protobuf:"bytes,3,opt,name=cls_name,json=clsName,proto3" json:"cls_name,omitempty"`
	Parameters *structpb.Struct `protobuf:"bytes,4,opt,name=parameters,proto3" json:"parameters,omitempty"`
	// contains filtered or unexported fields
}

* Represents a general n-dim array, can be either dense or sparse

func (*NdArrayProto) Descriptor deprecated

func (*NdArrayProto) Descriptor() ([]byte, []int)

Deprecated: Use NdArrayProto.ProtoReflect.Descriptor instead.

func (*NdArrayProto) GetClsName

func (x *NdArrayProto) GetClsName() string

func (*NdArrayProto) GetContent

func (m *NdArrayProto) GetContent() isNdArrayProto_Content

func (*NdArrayProto) GetDense

func (x *NdArrayProto) GetDense() *DenseNdArrayProto

func (*NdArrayProto) GetParameters

func (x *NdArrayProto) GetParameters() *structpb.Struct

func (*NdArrayProto) GetSparse

func (x *NdArrayProto) GetSparse() *SparseNdArrayProto

func (*NdArrayProto) ProtoMessage

func (*NdArrayProto) ProtoMessage()

func (*NdArrayProto) ProtoReflect

func (x *NdArrayProto) ProtoReflect() protoreflect.Message

func (*NdArrayProto) Reset

func (x *NdArrayProto) Reset()

func (*NdArrayProto) String

func (x *NdArrayProto) String() string

type NdArrayProto_Dense

type NdArrayProto_Dense struct {
	Dense *DenseNdArrayProto `protobuf:"bytes,1,opt,name=dense,proto3,oneof"` // dense representation of the ndarray
}

type NdArrayProto_Sparse

type NdArrayProto_Sparse struct {
	Sparse *SparseNdArrayProto `protobuf:"bytes,2,opt,name=sparse,proto3,oneof"` // sparse representation of the ndarray
}

type SparseNdArrayProto

type SparseNdArrayProto struct {

	// A 2-D int64 tensor of shape [N, ndims], which specifies the indices of the elements in the sparse tensor that contain nonzero values (elements are zero-indexed)
	Indices *DenseNdArrayProto `protobuf:"bytes,1,opt,name=indices,proto3" json:"indices,omitempty"`
	// A 1-D tensor of any type and shape [N], which supplies the values for each element in indices.
	Values *DenseNdArrayProto `protobuf:"bytes,2,opt,name=values,proto3" json:"values,omitempty"`
	// A 1-D int64 tensor of shape [ndims], which specifies the shape of the sparse tensor.
	Shape []uint32 `protobuf:"varint,3,rep,packed,name=shape,proto3" json:"shape,omitempty"`
	// contains filtered or unexported fields
}

* Represents a sparse ndarray

func (*SparseNdArrayProto) Descriptor deprecated

func (*SparseNdArrayProto) Descriptor() ([]byte, []int)

Deprecated: Use SparseNdArrayProto.ProtoReflect.Descriptor instead.

func (*SparseNdArrayProto) GetIndices

func (x *SparseNdArrayProto) GetIndices() *DenseNdArrayProto

func (*SparseNdArrayProto) GetShape

func (x *SparseNdArrayProto) GetShape() []uint32

func (*SparseNdArrayProto) GetValues

func (x *SparseNdArrayProto) GetValues() *DenseNdArrayProto

func (*SparseNdArrayProto) ProtoMessage

func (*SparseNdArrayProto) ProtoMessage()

func (*SparseNdArrayProto) ProtoReflect

func (x *SparseNdArrayProto) ProtoReflect() protoreflect.Message

func (*SparseNdArrayProto) Reset

func (x *SparseNdArrayProto) Reset()

func (*SparseNdArrayProto) String

func (x *SparseNdArrayProto) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL