AstraDBQueryResult#

class langchain_astradb.vectorstores.AstraDBQueryResult(
document: Document,
id: str,
embedding: list[float] | None,
similarity: float | None,
)[source]#

The complete information contained in a vector store entry.

This class represents all that can be returned from the collection when running a query, which goes beyond just the corresponding Document.

Parameters:
  • document (Document)

  • id (str)

  • embedding (list[float] | None)

  • similarity (float | None)

document#

a langchain.schema.Document object representing the query result.

Type:

langchain_core.documents.base.Document

id#

the ID of the returned document.

Type:

str

embedding#

the embedding vector associated to the document. This may be None, depending on whether the embeddings were requested in the query or not.

Type:

list[float] | None

similarity#

the numeric similarity score of the document in the query. In case this quantity was not requested by the query, it will be set to None.

Type:

float | None

Create new instance of AstraDBQueryResult(document, id, embedding, similarity)

Attributes

document

Alias for field number 0

embedding

Alias for field number 2

id

Alias for field number 1

similarity

Alias for field number 3

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

count(value, /)#

Return number of occurrences of value.

index(
value,
start=0,
stop=9223372036854775807,
/,
)#

Return first index of value.

Raises ValueError if the value is not present.