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.

Atributes:

document: a langchain.schema.Document object representing the query result. id: the ID of the returned document. embedding: the embedding vector associated to the document. This may be None,

depending on whether the embeddings were requested in the query or not.

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.

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.

Parameters:
  • document (Document)

  • id (str)

  • embedding (list[float] | None)

  • similarity (float | None)

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.