Summary of entries of Methods for llama-index-alloydb-pg.
llama_index_alloydb_pg.engine._get_iam_principal_email
_get_iam_principal_email(credentials: google.auth.credentials.Credentials) -> strGet email address associated with current authenticated IAM principal.
See more: llama_index_alloydb_pg.engine._get_iam_principal_email
llama_index_alloydb_pg.postprocessor._has_text
_has_text(node: llama_index.core.schema.NodeWithScore) -> boolWhether the text has a character other than whitespace or format (Cf).
llama_index_alloydb_pg.postprocessor._to_ranked_nodes
_to_ranked_nodes(
nodes: typing.Sequence[llama_index.core.schema.NodeWithScore],
rows: typing.Sequence[sqlalchemy.engine.row.RowMapping],
) -> typing.List[llama_index.core.schema.NodeWithScore]Map 1-based (index, score) rows to new nodes, highest score first.
See more: llama_index_alloydb_pg.postprocessor._to_ranked_nodes
llama_index_alloydb_pg.chat_store.AlloyDBChatStore
AlloyDBChatStore(
key: object, engine: AlloyDBEngine, chat_store: AsyncAlloyDBChatStore
)AlloyDBChatStore constructor.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.add_message
add_message(
key: str, message: llama_index.core.base.llms.types.ChatMessage
) -> NoneSynchronously adds a new chat message to the specified key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.add_message
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.adelete_last_message
adelete_last_message(
key: str,
) -> typing.Optional[llama_index.core.base.llms.types.ChatMessage]Asynchronously deletes the last chat message associated with a given key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.adelete_last_message
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.adelete_message
adelete_message(
key: str, idx: int
) -> typing.Optional[llama_index.core.base.llms.types.ChatMessage]Asynchronously deletes a specific chat message by index from the messages associated with a given key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.adelete_message
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.adelete_messages
adelete_messages(
key: str,
) -> typing.Optional[typing.List[llama_index.core.base.llms.types.ChatMessage]]Asynchronously deletes the chat messages associated with a specific key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.adelete_messages
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.aget_keys
aget_keys() -> typing.List[str]Asynchronously retrieves a list of all keys.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.aget_keys
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.aget_messages
aget_messages(
key: str,
) -> typing.List[llama_index.core.base.llms.types.ChatMessage]Asynchronously retrieves the chat messages associated with a specific key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.aget_messages
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.aset_messages
aset_messages(
key: str, messages: typing.List[llama_index.core.base.llms.types.ChatMessage]
) -> NoneAsynchronously sets the chat messages for a specific key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.aset_messages
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.async_add_message
async_add_message(
key: str, message: llama_index.core.base.llms.types.ChatMessage
) -> NoneAsynchronously adds a new chat message to the specified key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.async_add_message
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.class_name
class_name() -> strGet class name.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.class_name
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.create
create(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
table_name: str,
schema_name: str = "public",
) -> llama_index_alloydb_pg.chat_store.AlloyDBChatStoreCreate a new AlloyDBChatStore instance.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.create
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.create_sync
create_sync(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
table_name: str,
schema_name: str = "public",
) -> llama_index_alloydb_pg.chat_store.AlloyDBChatStoreCreate a new AlloyDBChatStore sync instance.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.create_sync
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.delete_last_message
delete_last_message(
key: str,
) -> typing.Optional[llama_index.core.base.llms.types.ChatMessage]Synchronously deletes the last chat message associated with a given key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.delete_last_message
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.delete_message
delete_message(
key: str, idx: int
) -> typing.Optional[llama_index.core.base.llms.types.ChatMessage]Synchronously deletes a specific chat message by index from the messages associated with a given key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.delete_message
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.delete_messages
delete_messages(
key: str,
) -> typing.Optional[typing.List[llama_index.core.base.llms.types.ChatMessage]]Synchronously deletes the chat messages associated with a specific key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.delete_messages
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.get_keys
get_keys() -> typing.List[str]Synchronously retrieves a list of all keys.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.get_keys
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.get_messages
get_messages(key: str) -> typing.List[llama_index.core.base.llms.types.ChatMessage]Synchronously retrieves the chat messages associated with a specific key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.get_messages
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.model_post_init
model_post_init(context: Any, /) -> NoneThis function is meant to behave like a BaseModel method to initialize private attributes.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.model_post_init
llama_index_alloydb_pg.chat_store.AlloyDBChatStore.set_messages
set_messages(
key: str, messages: typing.List[llama_index.core.base.llms.types.ChatMessage]
) -> NoneSynchronously sets the chat messages for a specific key.
See more: llama_index_alloydb_pg.chat_store.AlloyDBChatStore.set_messages
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore
AlloyDBDocumentStore(
key: object,
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
document_store: llama_index_alloydb_pg.async_document_store.AsyncAlloyDBDocumentStore,
)"AlloyDBDocumentStore constructor.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.add_documents
add_documents(
docs: typing.Sequence[llama_index.core.schema.BaseNode],
allow_update: bool = True,
batch_size: int = 1,
store_text: bool = True,
) -> NoneAdds a document to the store.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.add_documents
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.adelete_document
adelete_document(doc_id: str, raise_error: bool = True) -> NoneDelete a document from the store.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.adelete_document
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.adelete_ref_doc
adelete_ref_doc(ref_doc_id: str, raise_error: bool = True) -> NoneDelete a ref_doc and all it's associated nodes.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.adelete_ref_doc
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.adocument_exists
adocument_exists(doc_id: str) -> boolCheck if document exists.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.adocument_exists
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aget_all_document_hashes
aget_all_document_hashes() -> dict[str, str]Get the stored hash for all documents.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aget_all_document_hashes
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aget_all_ref_doc_info
aget_all_ref_doc_info() -> (
typing.Optional[dict[str, llama_index.core.storage.docstore.types.RefDocInfo]]
)Get a mapping of ref_doc_id -> RefDocInfo for all ingested documents.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aget_all_ref_doc_info
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aget_document
aget_document(
doc_id: str, raise_error: bool = True
) -> typing.Optional[llama_index.core.schema.BaseNode]Retrieves a document from the table by its doc_id.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aget_document
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aget_document_hash
aget_document_hash(doc_id: str) -> typing.Optional[str]Get the stored hash for a document, if it exists.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aget_document_hash
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aget_ref_doc_info
aget_ref_doc_info(
ref_doc_id: str,
) -> typing.Optional[llama_index.core.storage.docstore.types.RefDocInfo]Get the RefDocInfo for a given ref_doc_id.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aget_ref_doc_info
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aref_doc_exists
aref_doc_exists(ref_doc_id: str) -> boolCheck if a ref_doc_id has been ingested.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aref_doc_exists
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aset_document_hash
aset_document_hash(doc_id: str, doc_hash: str) -> NoneSet the hash for a given doc_id.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aset_document_hash
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aset_document_hashes
aset_document_hashes(doc_hashes: dict[str, str]) -> NoneSet the hash for a given doc_id.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.aset_document_hashes
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.async_add_documents
async_add_documents(
docs: typing.Sequence[llama_index.core.schema.BaseNode],
allow_update: bool = True,
batch_size: int = 1,
store_text: bool = True,
) -> NoneAdds a document to the store.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.async_add_documents
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.create
create(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
table_name: str,
schema_name: str = "public",
batch_size: int = 1,
) -> llama_index_alloydb_pg.document_store.AlloyDBDocumentStoreCreate a new AlloyDBDocumentStore instance.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.create
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.create_sync
create_sync(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
table_name: str,
schema_name: str = "public",
batch_size: int = 1,
) -> llama_index_alloydb_pg.document_store.AlloyDBDocumentStoreCreate a new AlloyDBDocumentStore sync instance.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.create_sync
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.delete_document
delete_document(doc_id: str, raise_error: bool = True) -> NoneDelete a document from the store.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.delete_document
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.delete_ref_doc
delete_ref_doc(ref_doc_id: str, raise_error: bool = True) -> NoneDelete a ref_doc and all it's associated nodes.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.delete_ref_doc
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.document_exists
document_exists(doc_id: str) -> boolCheck if document exists.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.document_exists
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.get_all_document_hashes
get_all_document_hashes() -> dict[str, str]Get the stored hash for all documents.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.get_all_document_hashes
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.get_all_ref_doc_info
get_all_ref_doc_info() -> (
typing.Optional[dict[str, llama_index.core.storage.docstore.types.RefDocInfo]]
)Get a mapping of ref_doc_id -> RefDocInfo for all ingested documents.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.get_all_ref_doc_info
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.get_document
get_document(
doc_id: str, raise_error: bool = True
) -> typing.Optional[llama_index.core.schema.BaseNode]Retrieves a document from the table by its doc_id.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.get_document
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.get_document_hash
get_document_hash(doc_id: str) -> typing.Optional[str]Get the stored hash for a document, if it exists.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.get_document_hash
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.get_ref_doc_info
get_ref_doc_info(
ref_doc_id: str,
) -> typing.Optional[llama_index.core.storage.docstore.types.RefDocInfo]Get the RefDocInfo for a given ref_doc_id.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.get_ref_doc_info
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.ref_doc_exists
ref_doc_exists(ref_doc_id: str) -> boolCheck if a ref_doc_id has been ingested.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.ref_doc_exists
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.set_document_hash
set_document_hash(doc_id: str, doc_hash: str) -> NoneSet the hash for a given doc_id.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.set_document_hash
llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.set_document_hashes
set_document_hashes(doc_hashes: dict[str, str]) -> NoneSet the hash for a given doc_id.
See more: llama_index_alloydb_pg.document_store.AlloyDBDocumentStore.set_document_hashes
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding
AlloyDBEmbedding(engine: AlloyDBEngine, model_id: str, embed_batch_size: int = 10, num_workers: Optional[int] = 4, *, model_name: str = 'unknown', callback_manager: llama_index.core.callbacks.base.CallbackManager = AlloyDBEmbedding constructor.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.__aembed
__aembed(texts: typing.List[str]) -> typing.List[typing.List[float]]Embed a batch of texts with one SQL statement, in input order.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.__aembed
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.__aembed_one
__aembed_one(text: str) -> typing.List[float]Embed one text, raising ValueError if it is empty.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.__aembed_one
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.__check_texts
__check_texts() -> NoneRaise ValueError naming the position of the first empty text.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.__check_texts
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.__sync_model_name
__sync_model_name() -> llama_index_alloydb_pg.embeddings.AlloyDBEmbeddingKeep model_name equal to model_id, on construction and assignment.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.__sync_model_name
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._aget_query_embedding
_aget_query_embedding(query: str) -> typing.List[float]Embed a query asynchronously.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._aget_query_embedding
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._aget_text_embedding
_aget_text_embedding(text: str) -> typing.List[float]Embed a text asynchronously.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._aget_text_embedding
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._aget_text_embeddings
_aget_text_embeddings(texts: typing.List[str]) -> typing.List[typing.List[float]]Embed a batch of texts asynchronously.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._aget_text_embeddings
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._get_query_embedding
_get_query_embedding(query: str) -> typing.List[float]Embed a query synchronously.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._get_query_embedding
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._get_text_embedding
_get_text_embedding(text: str) -> typing.List[float]Embed a text synchronously.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._get_text_embedding
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._get_text_embeddings
_get_text_embeddings(texts: typing.List[str]) -> typing.List[typing.List[float]]Embed a batch of texts synchronously.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding._get_text_embeddings
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.aget_text_embedding_batch
aget_text_embedding_batch(
texts: typing.List[str], *args: typing.Any, **kwargs: typing.Any
) -> typing.List[typing.List[float]]Embed texts in batches, raising ValueError for an empty text.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.aget_text_embedding_batch
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.class_name
class_name() -> strGet the class name, used as a unique ID in serialization.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.class_name
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.get_text_embedding_batch
get_text_embedding_batch(
texts: typing.List[str], *args: typing.Any, **kwargs: typing.Any
) -> typing.List[typing.List[float]]Embed texts in batches, raising ValueError for an empty text.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.get_text_embedding_batch
llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.model_post_init
model_post_init(context: Any, /) -> NoneThis function is meant to behave like a BaseModel method to initialize private attributes.
See more: llama_index_alloydb_pg.embeddings.AlloyDBEmbedding.model_post_init
llama_index_alloydb_pg.engine.AlloyDBEngine
AlloyDBEngine(
key: object,
pool: sqlalchemy.ext.asyncio.engine.AsyncEngine,
loop: typing.Optional[asyncio.events.AbstractEventLoop],
thread: typing.Optional[threading.Thread],
)AlloyDBEngine constructor.
llama_index_alloydb_pg.engine.AlloyDBEngine._ainit_chat_store_table
_ainit_chat_store_table(
table_name: str, schema_name: str = "public", overwrite_existing: bool = False
) -> NoneCreate an AlloyDB table to save chat store.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine._ainit_chat_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine._ainit_doc_store_table
_ainit_doc_store_table(
table_name: str, schema_name: str = "public", overwrite_existing: bool = False
) -> NoneCreate an AlloyDB table for the DocumentStore.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine._ainit_doc_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine._ainit_index_store_table
_ainit_index_store_table(
table_name: str, schema_name: str = "public", overwrite_existing: bool = False
) -> NoneCreate an AlloyDB table to save Index metadata.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine._ainit_index_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine._ainit_vector_store_table
_ainit_vector_store_table(
table_name: str,
vector_size: int,
schema_name: str = "public",
id_column: typing.Union[str, llama_index_alloydb_pg.engine.Column] = "node_id",
text_column: str = "text",
embedding_column: str = "embedding",
metadata_json_column: str = "li_metadata",
metadata_columns: list[llama_index_alloydb_pg.engine.Column] = [],
ref_doc_id_column: str = "ref_doc_id",
node_column: str = "node_data",
stores_text: bool = True,
overwrite_existing: bool = False,
) -> NoneCreate an AlloyDB table for the VectorStore.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine._ainit_vector_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine._aload_table_schema
_aload_table_schema(
table_name: str, schema_name: str = "public"
) -> sqlalchemy.sql.schema.TableLoad table schema from an existing table in a PgSQL database, potentially from a specific database schema.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine._aload_table_schema
llama_index_alloydb_pg.engine.AlloyDBEngine._create
_create(
project_id: str,
region: str,
cluster: str,
instance: str,
database: str,
ip_type: typing.Union[str, google.cloud.alloydbconnector.enums.IPTypes],
user: typing.Optional[str] = None,
password: typing.Optional[str] = None,
loop: typing.Optional[asyncio.events.AbstractEventLoop] = None,
thread: typing.Optional[threading.Thread] = None,
iam_account_email: typing.Optional[str] = None,
) -> llama_index_alloydb_pg.engine.AlloyDBEngineCreate an AlloyDBEngine from an AlloyDB instance.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine._create
llama_index_alloydb_pg.engine.AlloyDBEngine._run_as_async
_run_as_async(
coro: typing.Awaitable[llama_index_alloydb_pg.engine.T],
) -> llama_index_alloydb_pg.engine.TRun an async coroutine asynchronously.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine._run_as_async
llama_index_alloydb_pg.engine.AlloyDBEngine._run_as_sync
_run_as_sync(
coro: typing.Awaitable[llama_index_alloydb_pg.engine.T],
) -> llama_index_alloydb_pg.engine.TRun an async coroutine synchronously.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine._run_as_sync
llama_index_alloydb_pg.engine.AlloyDBEngine.afrom_instance
afrom_instance(
project_id: str,
region: str,
cluster: str,
instance: str,
database: str,
user: typing.Optional[str] = None,
password: typing.Optional[str] = None,
ip_type: typing.Union[
str, google.cloud.alloydbconnector.enums.IPTypes
] = IPTypes.PUBLIC,
iam_account_email: typing.Optional[str] = None,
) -> llama_index_alloydb_pg.engine.AlloyDBEngineCreate an AlloyDBEngine from an AlloyDB instance.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.afrom_instance
llama_index_alloydb_pg.engine.AlloyDBEngine.ainit_chat_store_table
ainit_chat_store_table(
table_name: str, schema_name: str = "public", overwrite_existing: bool = False
) -> NoneCreate an AlloyDB table to save chat store.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.ainit_chat_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine.ainit_doc_store_table
ainit_doc_store_table(
table_name: str, schema_name: str = "public", overwrite_existing: bool = False
) -> NoneCreate an AlloyDB table for the DocumentStore.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.ainit_doc_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine.ainit_index_store_table
ainit_index_store_table(
table_name: str, schema_name: str = "public", overwrite_existing: bool = False
) -> NoneCreate an AlloyDB table to save Index metadata.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.ainit_index_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine.ainit_vector_store_table
ainit_vector_store_table(
table_name: str,
vector_size: int,
schema_name: str = "public",
id_column: typing.Union[str, llama_index_alloydb_pg.engine.Column] = "node_id",
text_column: str = "text",
embedding_column: str = "embedding",
metadata_json_column: str = "li_metadata",
metadata_columns: list[llama_index_alloydb_pg.engine.Column] = [],
ref_doc_id_column: str = "ref_doc_id",
node_column: str = "node_data",
stores_text: bool = True,
overwrite_existing: bool = False,
) -> NoneCreate an AlloyDB table for the VectorStore.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.ainit_vector_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine.close
close() -> NoneDispose of connection pool.
llama_index_alloydb_pg.engine.AlloyDBEngine.from_connection_string
from_connection_string(
url: typing.Union[str, sqlalchemy.engine.url.URL], **kwargs: typing.Any
) -> llama_index_alloydb_pg.engine.AlloyDBEngineCreate an AlloyDBEngine instance from arguments .
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.from_connection_string
llama_index_alloydb_pg.engine.AlloyDBEngine.from_engine
from_engine(
engine: sqlalchemy.ext.asyncio.engine.AsyncEngine,
loop: typing.Optional[asyncio.events.AbstractEventLoop] = None,
) -> llama_index_alloydb_pg.engine.AlloyDBEngineCreate an AlloyDBEngine instance from an AsyncEngine.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.from_engine
llama_index_alloydb_pg.engine.AlloyDBEngine.from_instance
from_instance(
project_id: str,
region: str,
cluster: str,
instance: str,
database: str,
user: typing.Optional[str] = None,
password: typing.Optional[str] = None,
ip_type: typing.Union[
str, google.cloud.alloydbconnector.enums.IPTypes
] = IPTypes.PUBLIC,
iam_account_email: typing.Optional[str] = None,
) -> llama_index_alloydb_pg.engine.AlloyDBEngineCreate an AlloyDBEngine from an AlloyDB instance.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.from_instance
llama_index_alloydb_pg.engine.AlloyDBEngine.init_chat_store_table
init_chat_store_table(
table_name: str, schema_name: str = "public", overwrite_existing: bool = False
) -> NoneCreate an AlloyDB table to save chat store.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.init_chat_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine.init_doc_store_table
init_doc_store_table(
table_name: str, schema_name: str = "public", overwrite_existing: bool = False
) -> NoneCreate an AlloyDB table for the DocumentStore.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.init_doc_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine.init_index_store_table
init_index_store_table(
table_name: str, schema_name: str = "public", overwrite_existing: bool = False
) -> NoneCreate an AlloyDB table to save Index metadata.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.init_index_store_table
llama_index_alloydb_pg.engine.AlloyDBEngine.init_vector_store_table
init_vector_store_table(
table_name: str,
vector_size: int,
schema_name: str = "public",
id_column: typing.Union[str, llama_index_alloydb_pg.engine.Column] = "node_id",
text_column: str = "text",
embedding_column: str = "embedding",
metadata_json_column: str = "li_metadata",
metadata_columns: list[llama_index_alloydb_pg.engine.Column] = [],
ref_doc_id_column: str = "ref_doc_id",
node_column: str = "node_data",
stores_text: bool = True,
overwrite_existing: bool = False,
) -> NoneCreate an AlloyDB table for the VectorStore.
See more: llama_index_alloydb_pg.engine.AlloyDBEngine.init_vector_store_table
llama_index_alloydb_pg.engine.Column.__post_init__
__post_init__() -> NoneCheck if initialization parameters are valid.
llama_index_alloydb_pg.index_store.AlloyDBIndexStore
AlloyDBIndexStore(
key: object,
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
index_store: llama_index_alloydb_pg.async_index_store.AsyncAlloyDBIndexStore,
)AlloyDBIndexStore constructor.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.aadd_index_struct
aadd_index_struct(
index_struct: llama_index.core.data_structs.data_structs.IndexStruct,
) -> NoneAdd an index struct.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.aadd_index_struct
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.add_index_struct
add_index_struct(
index_struct: llama_index.core.data_structs.data_structs.IndexStruct,
) -> NoneAdd an index struct.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.add_index_struct
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.adelete_index_struct
adelete_index_struct(key: str) -> NoneDelete an index struct.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.adelete_index_struct
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.aget_index_struct
aget_index_struct(
struct_id: typing.Optional[str] = None,
) -> typing.Optional[llama_index.core.data_structs.data_structs.IndexStruct]Get an index struct.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.aget_index_struct
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.aindex_structs
aindex_structs() -> list[llama_index.core.data_structs.data_structs.IndexStruct]Get all index structs.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.aindex_structs
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.async_add_index_struct
async_add_index_struct(
index_struct: llama_index.core.data_structs.data_structs.IndexStruct,
) -> NoneAdd an index struct.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.async_add_index_struct
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.async_index_structs
async_index_structs() -> (
list[llama_index.core.data_structs.data_structs.IndexStruct]
)Get all index structs.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.async_index_structs
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.create
create(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
table_name: str,
schema_name: str = "public",
) -> llama_index_alloydb_pg.index_store.AlloyDBIndexStoreCreate a new AlloyDBIndexStore instance.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.create
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.create_sync
create_sync(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
table_name: str,
schema_name: str = "public",
) -> llama_index_alloydb_pg.index_store.AlloyDBIndexStoreCreate a new AlloyDBIndexStore sync instance.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.create_sync
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.delete_index_struct
delete_index_struct(key: str) -> NoneDelete an index struct.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.delete_index_struct
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.get_index_struct
get_index_struct(
struct_id: typing.Optional[str] = None,
) -> typing.Optional[llama_index.core.data_structs.data_structs.IndexStruct]Get an index struct.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.get_index_struct
llama_index_alloydb_pg.index_store.AlloyDBIndexStore.index_structs
index_structs() -> list[llama_index.core.data_structs.data_structs.IndexStruct]Get all index structs.
See more: llama_index_alloydb_pg.index_store.AlloyDBIndexStore.index_structs
llama_index_alloydb_pg.indexes.BaseIndex.index_options
index_options() -> strSet index query options for vector store initialization.
See more: llama_index_alloydb_pg.indexes.BaseIndex.index_options
llama_index_alloydb_pg.indexes.DistanceStrategy._generate_next_value_
_generate_next_value_(start, count, last_values)Generate the next value when not given.
See more: llama_index_alloydb_pg.indexes.DistanceStrategy.generate_next_value
llama_index_alloydb_pg.indexes.HNSWIndex.index_options
index_options() -> strSet index query options for vector store initialization.
See more: llama_index_alloydb_pg.indexes.HNSWIndex.index_options
llama_index_alloydb_pg.indexes.HNSWQueryOptions.to_parameter
to_parameter() -> list[str]Convert index attributes to list of configurations.
See more: llama_index_alloydb_pg.indexes.HNSWQueryOptions.to_parameter
llama_index_alloydb_pg.indexes.HNSWQueryOptions.to_string
to_string() -> strConvert index attributes to string.
See more: llama_index_alloydb_pg.indexes.HNSWQueryOptions.to_string
llama_index_alloydb_pg.indexes.IVFFlatIndex.index_options
index_options() -> strSet index query options for vector store initialization.
See more: llama_index_alloydb_pg.indexes.IVFFlatIndex.index_options
llama_index_alloydb_pg.indexes.IVFFlatQueryOptions.to_parameter
to_parameter() -> list[str]Convert index attributes to list of configurations.
See more: llama_index_alloydb_pg.indexes.IVFFlatQueryOptions.to_parameter
llama_index_alloydb_pg.indexes.IVFFlatQueryOptions.to_string
to_string() -> strConvert index attributes to string.
See more: llama_index_alloydb_pg.indexes.IVFFlatQueryOptions.to_string
llama_index_alloydb_pg.indexes.IVFIndex.index_options
index_options() -> strSet index query options for vector store initialization.
See more: llama_index_alloydb_pg.indexes.IVFIndex.index_options
llama_index_alloydb_pg.indexes.IVFQueryOptions.to_parameter
to_parameter() -> list[str]Convert index attributes to list of configurations.
See more: llama_index_alloydb_pg.indexes.IVFQueryOptions.to_parameter
llama_index_alloydb_pg.indexes.IVFQueryOptions.to_string
to_string() -> strConvert index attributes to string.
See more: llama_index_alloydb_pg.indexes.IVFQueryOptions.to_string
llama_index_alloydb_pg.indexes.QueryOptions.to_parameter
to_parameter() -> list[str]Convert index attributes to list of configurations.
See more: llama_index_alloydb_pg.indexes.QueryOptions.to_parameter
llama_index_alloydb_pg.indexes.QueryOptions.to_string
to_string() -> strConvert index attributes to string.
See more: llama_index_alloydb_pg.indexes.QueryOptions.to_string
llama_index_alloydb_pg.indexes.ScaNNIndex.index_options
index_options() -> strSet index query options for vector store initialization.
See more: llama_index_alloydb_pg.indexes.ScaNNIndex.index_options
llama_index_alloydb_pg.indexes.ScaNNQueryOptions.to_parameter
to_parameter() -> list[str]Convert index attributes to list of configurations.
See more: llama_index_alloydb_pg.indexes.ScaNNQueryOptions.to_parameter
llama_index_alloydb_pg.indexes.ScaNNQueryOptions.to_string
to_string() -> strConvert index attributes to string.
See more: llama_index_alloydb_pg.indexes.ScaNNQueryOptions.to_string
llama_index_alloydb_pg.model_manager.AlloyDBModelManager
AlloyDBModelManager(
key: object, engine: llama_index_alloydb_pg.engine.AlloyDBEngine
)AlloyDBModelManager constructor.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.__acreate_model
__acreate_model(**args: typing.Optional[str]) -> NoneCall google_ml.create_model with the arguments that are not None.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.__acreate_model
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.__adrop_model
__adrop_model(model_id: str) -> NoneDrop a model endpoint with google_ml.drop_model.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.__adrop_model
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.__aget_model
__aget_model(
model_id: str,
) -> typing.Optional[llama_index_alloydb_pg.model_manager.AlloyDBModel]Get a registered model endpoint.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.__aget_model
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.__alist_models
__alist_models() -> list[llama_index_alloydb_pg.model_manager.AlloyDBModel]List all model endpoints.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.__alist_models
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.__avalidate
__avalidate() -> NoneRaise ValueError if model endpoint management is unavailable.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.__avalidate
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.acreate_model
acreate_model(
model_id: str,
*,
model_provider: str,
model_type: str,
model_qualified_name: typing.Optional[str] = None,
model_request_url: typing.Optional[str] = None,
model_auth_type: typing.Optional[str] = None,
model_auth_id: typing.Optional[str] = None,
generate_headers_fn: typing.Optional[str] = None,
model_in_transform_fn: typing.Optional[str] = None,
model_out_transform_fn: typing.Optional[str] = None
) -> NoneRegister a model endpoint.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.acreate_model
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.adrop_model
adrop_model(model_id: str) -> NoneDrop a registered model endpoint.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.adrop_model
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.aget_model
aget_model(
model_id: str,
) -> typing.Optional[llama_index_alloydb_pg.model_manager.AlloyDBModel]Get a registered model endpoint.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.aget_model
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.alist_models
alist_models() -> list[llama_index_alloydb_pg.model_manager.AlloyDBModel]List all model endpoints, including the built-in ones.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.alist_models
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.create
create(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
) -> llama_index_alloydb_pg.model_manager.AlloyDBModelManagerCreate an AlloyDBModelManager after checking model endpoint support.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.create
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.create_model
create_model(
model_id: str,
*,
model_provider: str,
model_type: str,
model_qualified_name: typing.Optional[str] = None,
model_request_url: typing.Optional[str] = None,
model_auth_type: typing.Optional[str] = None,
model_auth_id: typing.Optional[str] = None,
generate_headers_fn: typing.Optional[str] = None,
model_in_transform_fn: typing.Optional[str] = None,
model_out_transform_fn: typing.Optional[str] = None
) -> NoneSynchronously register a model endpoint.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.create_model
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.create_sync
create_sync(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
) -> llama_index_alloydb_pg.model_manager.AlloyDBModelManagerSynchronously create an AlloyDBModelManager after checking support.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.create_sync
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.drop_model
drop_model(model_id: str) -> NoneSynchronously drop a registered model endpoint.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.drop_model
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.get_model
get_model(
model_id: str,
) -> typing.Optional[llama_index_alloydb_pg.model_manager.AlloyDBModel]Synchronously get a registered model endpoint.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.get_model
llama_index_alloydb_pg.model_manager.AlloyDBModelManager.list_models
list_models() -> list[llama_index_alloydb_pg.model_manager.AlloyDBModel]Synchronously list all model endpoints, including the built-in ones.
See more: llama_index_alloydb_pg.model_manager.AlloyDBModelManager.list_models
llama_index_alloydb_pg.postprocessor.AlloyDBRerank
AlloyDBRerank(engine: llama_index_alloydb_pg.engine.AlloyDBEngine, model_id: str, top_n: int = 2, *, callback_manager: llama_index.core.callbacks.base.CallbackManager = Create an AlloyDBRerank instance.
See more: llama_index_alloydb_pg.postprocessor.AlloyDBRerank
llama_index_alloydb_pg.postprocessor.AlloyDBRerank.__arank
__arank(
nodes: typing.List[llama_index.core.schema.NodeWithScore], query: str
) -> typing.Sequence[sqlalchemy.engine.row.RowMapping]Call google_ml.rank on the node texts.
See more: llama_index_alloydb_pg.postprocessor.AlloyDBRerank.__arank
llama_index_alloydb_pg.postprocessor.AlloyDBRerank.__finish
__finish(
event: llama_index.core.callbacks.base.EventContext,
nodes: typing.List[llama_index.core.schema.NodeWithScore],
rows: typing.Sequence[sqlalchemy.engine.row.RowMapping],
) -> typing.List[llama_index.core.schema.NodeWithScore]Map the rows to new nodes and emit the rerank end events.
See more: llama_index_alloydb_pg.postprocessor.AlloyDBRerank.__finish
llama_index_alloydb_pg.postprocessor.AlloyDBRerank.__payload
__payload(
nodes: typing.List[llama_index.core.schema.NodeWithScore], query: str
) -> dict[str, typing.Any]Build the payload of the reranking callback event.
See more: llama_index_alloydb_pg.postprocessor.AlloyDBRerank.__payload
llama_index_alloydb_pg.postprocessor.AlloyDBRerank.__start
__start(
nodes: typing.List[llama_index.core.schema.NodeWithScore],
query_bundle: typing.Optional[llama_index.core.schema.QueryBundle],
) -> typing.Tuple[str, typing.List[llama_index.core.schema.NodeWithScore]]Validate the query, skip nodes without text, emit the start event.
See more: llama_index_alloydb_pg.postprocessor.AlloyDBRerank.__start
llama_index_alloydb_pg.postprocessor.AlloyDBRerank._apostprocess_nodes
_apostprocess_nodes(
nodes: typing.List[llama_index.core.schema.NodeWithScore],
query_bundle: typing.Optional[llama_index.core.schema.QueryBundle] = None,
) -> typing.List[llama_index.core.schema.NodeWithScore]Async version of _postprocess_nodes, run on the engine's loop.
See more: llama_index_alloydb_pg.postprocessor.AlloyDBRerank._apostprocess_nodes
llama_index_alloydb_pg.postprocessor.AlloyDBRerank._postprocess_nodes
_postprocess_nodes(
nodes: typing.List[llama_index.core.schema.NodeWithScore],
query_bundle: typing.Optional[llama_index.core.schema.QueryBundle] = None,
) -> typing.List[llama_index.core.schema.NodeWithScore]Rerank nodes by relevance to the query with google_ml.rank.
See more: llama_index_alloydb_pg.postprocessor.AlloyDBRerank._postprocess_nodes
llama_index_alloydb_pg.postprocessor.AlloyDBRerank.class_name
class_name() -> strGet the class name, used as a unique ID in serialization.
See more: llama_index_alloydb_pg.postprocessor.AlloyDBRerank.class_name
llama_index_alloydb_pg.postprocessor.AlloyDBRerank.model_post_init
model_post_init(context: Any, /) -> NoneThis function is meant to behave like a BaseModel method to initialize private attributes.
See more: llama_index_alloydb_pg.postprocessor.AlloyDBRerank.model_post_init
llama_index_alloydb_pg.reader.AlloyDBReader
AlloyDBReader(
key: object,
engine: AlloyDBEngine,
reader: AsyncAlloyDBReader,
is_remote: bool = True,
)AlloyDBReader constructor.
llama_index_alloydb_pg.reader.AlloyDBReader.alazy_load_data
alazy_load_data() -> typing.AsyncIterable[llama_index.core.schema.Document]Asynchronously load AlloyDB data into Document objects lazily.
See more: llama_index_alloydb_pg.reader.AlloyDBReader.alazy_load_data
llama_index_alloydb_pg.reader.AlloyDBReader.aload_data
aload_data() -> list[llama_index.core.schema.Document]Asynchronously load AlloyDB data into Document objects.
See more: llama_index_alloydb_pg.reader.AlloyDBReader.aload_data
llama_index_alloydb_pg.reader.AlloyDBReader.class_name
class_name() -> strGet class name.
See more: llama_index_alloydb_pg.reader.AlloyDBReader.class_name
llama_index_alloydb_pg.reader.AlloyDBReader.create
create(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
query: typing.Optional[str] = None,
table_name: typing.Optional[str] = None,
schema_name: str = "public",
content_columns: typing.Optional[list[str]] = None,
metadata_columns: typing.Optional[list[str]] = None,
metadata_json_column: typing.Optional[str] = None,
format: typing.Optional[str] = None,
formatter: typing.Optional[typing.Callable] = None,
is_remote: bool = True,
) -> llama_index_alloydb_pg.reader.AlloyDBReaderAsynchronously create an AlloyDBReader instance.
See more: llama_index_alloydb_pg.reader.AlloyDBReader.create
llama_index_alloydb_pg.reader.AlloyDBReader.create_sync
create_sync(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
query: typing.Optional[str] = None,
table_name: typing.Optional[str] = None,
schema_name: str = "public",
content_columns: typing.Optional[list[str]] = None,
metadata_columns: typing.Optional[list[str]] = None,
metadata_json_column: typing.Optional[str] = None,
format: typing.Optional[str] = None,
formatter: typing.Optional[typing.Callable] = None,
is_remote: bool = True,
) -> llama_index_alloydb_pg.reader.AlloyDBReaderSynchronously create an AlloyDBReader instance.
See more: llama_index_alloydb_pg.reader.AlloyDBReader.create_sync
llama_index_alloydb_pg.reader.AlloyDBReader.lazy_load_data
lazy_load_data() -> typing.Iterable[llama_index.core.schema.Document]Synchronously aoad AlloyDB data into Document objects lazily.
See more: llama_index_alloydb_pg.reader.AlloyDBReader.lazy_load_data
llama_index_alloydb_pg.reader.AlloyDBReader.load_data
load_data() -> list[llama_index.core.schema.Document]Synchronously load AlloyDB data into Document objects.
See more: llama_index_alloydb_pg.reader.AlloyDBReader.load_data
llama_index_alloydb_pg.reader.AlloyDBReader.model_post_init
model_post_init(context: Any, /) -> NoneThis function is meant to behave like a BaseModel method to initialize private attributes.
See more: llama_index_alloydb_pg.reader.AlloyDBReader.model_post_init
llama_index_alloydb_pg.tools.AlloyDBToolSpec.aanalyze_sentiment
aanalyze_sentiment(text: str) -> strClassify the sentiment of a text as positive, negative or neutral.
See more: llama_index_alloydb_pg.tools.AlloyDBToolSpec.aanalyze_sentiment
llama_index_alloydb_pg.tools.AlloyDBToolSpec.aevaluate_condition
aevaluate_condition(condition: str) -> boolDecide whether a natural-language condition is true or false.
See more: llama_index_alloydb_pg.tools.AlloyDBToolSpec.aevaluate_condition
llama_index_alloydb_pg.tools.AlloyDBToolSpec.analyze_sentiment
analyze_sentiment(text: str) -> strClassify the sentiment of a text as positive, negative or neutral.
See more: llama_index_alloydb_pg.tools.AlloyDBToolSpec.analyze_sentiment
llama_index_alloydb_pg.tools.AlloyDBToolSpec.asummarize
asummarize(text: str, *, instructions: typing.Optional[str] = None) -> strSummarize a text, such as an article or a set of reviews.
See more: llama_index_alloydb_pg.tools.AlloyDBToolSpec.asummarize
llama_index_alloydb_pg.tools.AlloyDBToolSpec.evaluate_condition
evaluate_condition(condition: str) -> boolDecide whether a natural-language condition is true or false.
See more: llama_index_alloydb_pg.tools.AlloyDBToolSpec.evaluate_condition
llama_index_alloydb_pg.tools.AlloyDBToolSpec.summarize
summarize(text: str, *, instructions: typing.Optional[str] = None) -> strSummarize a text, such as an article or a set of reviews.
See more: llama_index_alloydb_pg.tools.AlloyDBToolSpec.summarize
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore
AlloyDBVectorStore(
key: object,
engine: AlloyDBEngine,
vs: AsyncAlloyDBVectorStore,
stores_text: bool = True,
is_embedding_query: bool = True,
)AlloyDBVectorStore constructor.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.aapply_vector_index
aapply_vector_index(
index: llama_index_alloydb_pg.indexes.BaseIndex,
name: typing.Optional[str] = None,
concurrently: bool = False,
) -> NoneCreate an index on the vector store table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.aapply_vector_index
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.aclear
aclear() -> NoneAsynchronously delete all nodes from the table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.aclear
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.add
add(
nodes: typing.Sequence[llama_index.core.schema.BaseNode], **add_kwargs: typing.Any
) -> list[str]Synchronously add nodes to the table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.add
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.adelete
adelete(ref_doc_id: str, **delete_kwargs: typing.Any) -> NoneAsynchronously delete nodes belonging to provided parent document from the table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.adelete
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.adelete_nodes
adelete_nodes(
node_ids: typing.Optional[list[str]] = None,
filters: typing.Optional[
llama_index.core.vector_stores.types.MetadataFilters
] = None,
**delete_kwargs: typing.Any
) -> NoneAsynchronously delete a set of nodes from the table matching the provided nodes and filters.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.adelete_nodes
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.adrop_vector_index
adrop_vector_index(index_name: typing.Optional[str] = None) -> NoneDrop the vector index.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.adrop_vector_index
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.aget_nodes
aget_nodes(
node_ids: typing.Optional[list[str]] = None,
filters: typing.Optional[
llama_index.core.vector_stores.types.MetadataFilters
] = None,
) -> list[llama_index.core.schema.BaseNode]Asynchronously get nodes from the table matching the provided nodes and filters.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.aget_nodes
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.ais_valid_index
ais_valid_index(index_name: typing.Optional[str] = None) -> boolCheck if index exists in the table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.ais_valid_index
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.apply_vector_index
apply_vector_index(
index: llama_index_alloydb_pg.indexes.BaseIndex,
name: typing.Optional[str] = None,
concurrently: bool = False,
) -> NoneCreate an index on the vector store table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.apply_vector_index
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.aquery
aquery(
query: llama_index.core.vector_stores.types.VectorStoreQuery, **kwargs: typing.Any
) -> llama_index.core.vector_stores.types.VectorStoreQueryResultAsynchronously query vector store, see query for the query modes.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.aquery
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.areindex
areindex(index_name: typing.Optional[str] = None) -> NoneRe-index the vector store table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.areindex
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.aset_maintenance_work_mem
aset_maintenance_work_mem(num_leaves: int, vector_size: int) -> NoneSet database maintenance work memory (for ScaNN index creation).
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.aset_maintenance_work_mem
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.async_add
async_add(
nodes: typing.Sequence[llama_index.core.schema.BaseNode], **kwargs: typing.Any
) -> list[str]Asynchronously add nodes to the table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.async_add
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.class_name
class_name() -> strGet the class name, used as a unique ID in serialization.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.class_name
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.clear
clear() -> NoneSynchronously delete all nodes from the table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.clear
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.create
create(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
table_name: str,
schema_name: str = "public",
id_column: str = "node_id",
text_column: str = "text",
embedding_column: str = "embedding",
metadata_json_column: str = "li_metadata",
metadata_columns: list[str] = [],
ref_doc_id_column: str = "ref_doc_id",
node_column: str = "node_data",
stores_text: bool = True,
is_embedding_query: bool = True,
distance_strategy: llama_index_alloydb_pg.indexes.DistanceStrategy = DistanceStrategy.COSINE_DISTANCE,
index_query_options: typing.Optional[
llama_index_alloydb_pg.indexes.QueryOptions
] = None,
*,
hybrid_search_column: typing.Optional[str] = None,
text_search_config: str = "english"
) -> llama_index_alloydb_pg.vector_store.AlloyDBVectorStoreCreate an AlloyDBVectorStore instance and validates the table schema.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.create
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.create_sync
create_sync(
engine: llama_index_alloydb_pg.engine.AlloyDBEngine,
table_name: str,
schema_name: str = "public",
id_column: str = "node_id",
text_column: str = "text",
embedding_column: str = "embedding",
metadata_json_column: str = "li_metadata",
metadata_columns: list[str] = [],
ref_doc_id_column: str = "ref_doc_id",
node_column: str = "node_data",
stores_text: bool = True,
is_embedding_query: bool = True,
distance_strategy: llama_index_alloydb_pg.indexes.DistanceStrategy = DistanceStrategy.COSINE_DISTANCE,
index_query_options: typing.Optional[
llama_index_alloydb_pg.indexes.QueryOptions
] = None,
*,
hybrid_search_column: typing.Optional[str] = None,
text_search_config: str = "english"
) -> llama_index_alloydb_pg.vector_store.AlloyDBVectorStoreCreate an AlloyDBVectorStore instance and validates the table schema.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.create_sync
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.delete
delete(ref_doc_id: str, **delete_kwargs: typing.Any) -> NoneSynchronously delete nodes belonging to provided parent document from the table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.delete
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.delete_nodes
delete_nodes(
node_ids: typing.Optional[list[str]] = None,
filters: typing.Optional[
llama_index.core.vector_stores.types.MetadataFilters
] = None,
**delete_kwargs: typing.Any
) -> NoneSynchronously delete a set of nodes from the table matching the provided nodes and filters.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.delete_nodes
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.drop_vector_index
drop_vector_index(index_name: typing.Optional[str] = None) -> NoneDrop the vector index.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.drop_vector_index
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.get_nodes
get_nodes(
node_ids: typing.Optional[list[str]] = None,
filters: typing.Optional[
llama_index.core.vector_stores.types.MetadataFilters
] = None,
) -> list[llama_index.core.schema.BaseNode]Asynchronously get nodes from the table matching the provided nodes and filters.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.get_nodes
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.is_valid_index
is_valid_index(index_name: typing.Optional[str] = None) -> boolCheck if index exists in the table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.is_valid_index
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.model_post_init
model_post_init(context: Any, /) -> NoneThis function is meant to behave like a BaseModel method to initialize private attributes.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.model_post_init
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.query
query(
query: llama_index.core.vector_stores.types.VectorStoreQuery, **kwargs: typing.Any
) -> llama_index.core.vector_stores.types.VectorStoreQueryResultSynchronously query vector store.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.query
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.reindex
reindex(index_name: typing.Optional[str] = None) -> NoneRe-index the vector store table.
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.reindex
llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.set_maintenance_work_mem
set_maintenance_work_mem(num_leaves: int, vector_size: int) -> NoneSet database maintenance work memory (for ScaNN index creation).
See more: llama_index_alloydb_pg.vector_store.AlloyDBVectorStore.set_maintenance_work_mem