Package Methods (0.2.3)

Summary of entries of Methods for llama-index-cloud-sql-pg.

llama_index_cloud_sql_pg.engine._get_iam_principal_email

_get_iam_principal_email(credentials: google.auth.credentials.Credentials) -> str

Get email address associated with current authenticated IAM principal.

See more: llama_index_cloud_sql_pg.engine._get_iam_principal_email

llama_index_cloud_sql_pg.chat_store.PostgresChatStore

PostgresChatStore( key: object, engine: PostgresEngine, chat_store: AsyncPostgresChatStore )

PostgresChatStore constructor.

See more: llama_index_cloud_sql_pg.chat_store.PostgresChatStore

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.add_message

add_message( key: str, message: llama_index.core.base.llms.types.ChatMessage ) -> None

Synchronously adds a new chat message to the specified key.

See more: llama_index_cloud_sql_pg.chat_store.PostgresChatStore.add_message

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.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_cloud_sql_pg.chat_store.PostgresChatStore.adelete_last_message

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.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_cloud_sql_pg.chat_store.PostgresChatStore.adelete_message

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.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_cloud_sql_pg.chat_store.PostgresChatStore.adelete_messages

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.aget_keys

aget_keys() -> typing.List[str]

Asynchronously retrieves a list of all keys.

See more: llama_index_cloud_sql_pg.chat_store.PostgresChatStore.aget_keys

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.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_cloud_sql_pg.chat_store.PostgresChatStore.aget_messages

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.aset_messages

aset_messages( key: str, messages: typing.List[llama_index.core.base.llms.types.ChatMessage] ) -> None

Asynchronously sets the chat messages for a specific key.

See more: llama_index_cloud_sql_pg.chat_store.PostgresChatStore.aset_messages

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.async_add_message

async_add_message( key: str, message: llama_index.core.base.llms.types.ChatMessage ) -> None

Asynchronously adds a new chat message to the specified key.

See more: llama_index_cloud_sql_pg.chat_store.PostgresChatStore.async_add_message

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.class_name

class_name() -> str

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.create

create( engine: llama_index_cloud_sql_pg.engine.PostgresEngine, table_name: str, schema_name: str = "public", ) -> llama_index_cloud_sql_pg.chat_store.PostgresChatStore

Create a new PostgresChatStore instance.

See more: llama_index_cloud_sql_pg.chat_store.PostgresChatStore.create

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.create_sync

create_sync( engine: llama_index_cloud_sql_pg.engine.PostgresEngine, table_name: str, schema_name: str = "public", ) -> llama_index_cloud_sql_pg.chat_store.PostgresChatStore

Create a new PostgresChatStore sync instance.

See more: llama_index_cloud_sql_pg.chat_store.PostgresChatStore.create_sync

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.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_cloud_sql_pg.chat_store.PostgresChatStore.delete_last_message

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.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_cloud_sql_pg.chat_store.PostgresChatStore.delete_message

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.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_cloud_sql_pg.chat_store.PostgresChatStore.delete_messages

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.get_keys

get_keys() -> typing.List[str]

Synchronously retrieves a list of all keys.

See more: llama_index_cloud_sql_pg.chat_store.PostgresChatStore.get_keys

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.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_cloud_sql_pg.chat_store.PostgresChatStore.get_messages

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.model_post_init

model_post_init(context: Any, /) -> None

This function is meant to behave like a BaseModel method to initialise private attributes.

See more: llama_index_cloud_sql_pg.chat_store.PostgresChatStore.model_post_init

llama_index_cloud_sql_pg.chat_store.PostgresChatStore.set_messages

set_messages( key: str, messages: typing.List[llama_index.core.base.llms.types.ChatMessage] ) -> None

Synchronously sets the chat messages for a specific key.

See more: llama_index_cloud_sql_pg.chat_store.PostgresChatStore.set_messages

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore

PostgresDocumentStore( key: object, engine: llama_index_cloud_sql_pg.engine.PostgresEngine, document_store: llama_index_cloud_sql_pg.async_document_store.AsyncPostgresDocumentStore, )

"PostgresDocumentStore constructor.

See more: llama_index_cloud_sql_pg.document_store.PostgresDocumentStore

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.add_documents

add_documents( docs: typing.Sequence[llama_index.core.schema.BaseNode], allow_update: bool = True, batch_size: int = 1, store_text: bool = True, ) -> None

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.adelete_document

adelete_document(doc_id: str, raise_error: bool = True) -> None

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.adelete_ref_doc

adelete_ref_doc(ref_doc_id: str, raise_error: bool = True) -> None

Delete a ref_doc and all it's associated nodes.

See more: llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.adelete_ref_doc

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.adocument_exists

adocument_exists(doc_id: str) -> bool

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.aget_all_document_hashes

aget_all_document_hashes() -> dict[str, str]

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.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_cloud_sql_pg.document_store.PostgresDocumentStore.aget_all_ref_doc_info

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.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_cloud_sql_pg.document_store.PostgresDocumentStore.aget_document

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.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_cloud_sql_pg.document_store.PostgresDocumentStore.aget_document_hash

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.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_cloud_sql_pg.document_store.PostgresDocumentStore.aget_ref_doc_info

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.aref_doc_exists

aref_doc_exists(ref_doc_id: str) -> bool

Check if a ref_doc_id has been ingested.

See more: llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.aref_doc_exists

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.aset_document_hash

aset_document_hash(doc_id: str, doc_hash: str) -> None

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.aset_document_hashes

aset_document_hashes(doc_hashes: dict[str, str]) -> None

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.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, ) -> None

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.create

create( engine: llama_index_cloud_sql_pg.engine.PostgresEngine, table_name: str, schema_name: str = "public", batch_size: int = 1, ) -> llama_index_cloud_sql_pg.document_store.PostgresDocumentStore

Create a new PostgresDocumentStore instance.

See more: llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.create

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.create_sync

create_sync( engine: llama_index_cloud_sql_pg.engine.PostgresEngine, table_name: str, schema_name: str = "public", batch_size: int = 1, ) -> llama_index_cloud_sql_pg.document_store.PostgresDocumentStore

Create a new PostgresDocumentStore sync instance.

See more: llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.create_sync

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.delete_document

delete_document(doc_id: str, raise_error: bool = True) -> None

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.delete_ref_doc

delete_ref_doc(ref_doc_id: str, raise_error: bool = True) -> None

Delete a ref_doc and all it's associated nodes.

See more: llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.delete_ref_doc

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.document_exists

document_exists(doc_id: str) -> bool

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.get_all_document_hashes

get_all_document_hashes() -> dict[str, str]

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.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_cloud_sql_pg.document_store.PostgresDocumentStore.get_all_ref_doc_info

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.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_cloud_sql_pg.document_store.PostgresDocumentStore.get_document

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.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_cloud_sql_pg.document_store.PostgresDocumentStore.get_document_hash

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.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_cloud_sql_pg.document_store.PostgresDocumentStore.get_ref_doc_info

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.ref_doc_exists

ref_doc_exists(ref_doc_id: str) -> bool

Check if a ref_doc_id has been ingested.

See more: llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.ref_doc_exists

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.set_document_hash

set_document_hash(doc_id: str, doc_hash: str) -> None

llama_index_cloud_sql_pg.document_store.PostgresDocumentStore.set_document_hashes

set_document_hashes(doc_hashes: dict[str, str]) -> None

llama_index_cloud_sql_pg.engine.Column.__post_init__

__post_init__()

Check if initialization parameters are valid.

See more: llama_index_cloud_sql_pg.engine.Column.post_init

llama_index_cloud_sql_pg.engine.PostgresEngine

PostgresEngine( key: object, pool: sqlalchemy.ext.asyncio.engine.AsyncEngine, loop: typing.Optional[asyncio.events.AbstractEventLoop], thread: typing.Optional[threading.Thread], )

PostgresEngine constructor.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine

llama_index_cloud_sql_pg.engine.PostgresEngine._ainit_chat_store_table

_ainit_chat_store_table( table_name: str, schema_name: str = "public", overwrite_existing: bool = False ) -> None

llama_index_cloud_sql_pg.engine.PostgresEngine._ainit_doc_store_table

_ainit_doc_store_table( table_name: str, schema_name: str = "public", overwrite_existing: bool = False ) -> None

Create an table for the DocumentStore.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine._ainit_doc_store_table

llama_index_cloud_sql_pg.engine.PostgresEngine._ainit_index_store_table

_ainit_index_store_table( table_name: str, schema_name: str = "public", overwrite_existing: bool = False ) -> None

Create a table to save Index metadata.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine._ainit_index_store_table

llama_index_cloud_sql_pg.engine.PostgresEngine._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_cloud_sql_pg.engine.Column] = "node_id", text_column: str = "text", embedding_column: str = "embedding", metadata_json_column: str = "li_metadata", metadata_columns: list[llama_index_cloud_sql_pg.engine.Column] = [], ref_doc_id_column: str = "ref_doc_id", node_column: str = "node_data", stores_text: bool = True, overwrite_existing: bool = False, ) -> None

llama_index_cloud_sql_pg.engine.PostgresEngine._aload_table_schema

_aload_table_schema( table_name: str, schema_name: str = "public" ) -> sqlalchemy.sql.schema.Table

Load table schema from an existing table in a PgSQL database, potentially from a specific database schema.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine._aload_table_schema

llama_index_cloud_sql_pg.engine.PostgresEngine._create

_create( project_id: str, region: str, instance: str, database: str, ip_type: typing.Union[str, google.cloud.sql.connector.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, quota_project: typing.Optional[str] = None, iam_account_email: typing.Optional[str] = None, ) -> llama_index_cloud_sql_pg.engine.PostgresEngine

Create a PostgresEngine instance.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine._create

llama_index_cloud_sql_pg.engine.PostgresEngine._run_as_async

_run_as_async( coro: typing.Awaitable[llama_index_cloud_sql_pg.engine.T], ) -> llama_index_cloud_sql_pg.engine.T

Run an async coroutine asynchronously.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine._run_as_async

llama_index_cloud_sql_pg.engine.PostgresEngine._run_as_sync

_run_as_sync( coro: typing.Awaitable[llama_index_cloud_sql_pg.engine.T], ) -> llama_index_cloud_sql_pg.engine.T

Run an async coroutine synchronously.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine._run_as_sync

llama_index_cloud_sql_pg.engine.PostgresEngine.afrom_instance

afrom_instance( project_id: str, region: str, instance: str, database: str, user: typing.Optional[str] = None, password: typing.Optional[str] = None, ip_type: typing.Union[ str, google.cloud.sql.connector.enums.IPTypes ] = IPTypes.PUBLIC, quota_project: typing.Optional[str] = None, iam_account_email: typing.Optional[str] = None, ) -> llama_index_cloud_sql_pg.engine.PostgresEngine

Create a PostgresEngine from a Postgres instance.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.afrom_instance

llama_index_cloud_sql_pg.engine.PostgresEngine.ainit_chat_store_table

ainit_chat_store_table( table_name: str, schema_name: str = "public", overwrite_existing: bool = False ) -> None

Create a table to save chat store.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.ainit_chat_store_table

llama_index_cloud_sql_pg.engine.PostgresEngine.ainit_doc_store_table

ainit_doc_store_table( table_name: str, schema_name: str = "public", overwrite_existing: bool = False ) -> None

Create a table for the DocumentStore.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.ainit_doc_store_table

llama_index_cloud_sql_pg.engine.PostgresEngine.ainit_index_store_table

ainit_index_store_table( table_name: str, schema_name: str = "public", overwrite_existing: bool = False ) -> None

Create a table to save Index metadata.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.ainit_index_store_table

llama_index_cloud_sql_pg.engine.PostgresEngine.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_cloud_sql_pg.engine.Column] = "node_id", text_column: str = "text", embedding_column: str = "embedding", metadata_json_column: str = "li_metadata", metadata_columns: list[llama_index_cloud_sql_pg.engine.Column] = [], ref_doc_id_column: str = "ref_doc_id", node_column: str = "node_data", stores_text: bool = True, overwrite_existing: bool = False, ) -> None

llama_index_cloud_sql_pg.engine.PostgresEngine.close

close() -> None

Dispose of connection pool.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.close

llama_index_cloud_sql_pg.engine.PostgresEngine.from_engine

from_engine( engine: sqlalchemy.ext.asyncio.engine.AsyncEngine, loop: typing.Optional[asyncio.events.AbstractEventLoop] = None, ) -> llama_index_cloud_sql_pg.engine.PostgresEngine

Create an PostgresEngine instance from an AsyncEngine.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.from_engine

llama_index_cloud_sql_pg.engine.PostgresEngine.from_engine_args

from_engine_args( url: typing.Union[str, sqlalchemy.engine.url.URL], **kwargs: typing.Any ) -> llama_index_cloud_sql_pg.engine.PostgresEngine

Create an PostgresEngine instance from arguments.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.from_engine_args

llama_index_cloud_sql_pg.engine.PostgresEngine.from_instance

from_instance( project_id: str, region: str, instance: str, database: str, user: typing.Optional[str] = None, password: typing.Optional[str] = None, ip_type: typing.Union[ str, google.cloud.sql.connector.enums.IPTypes ] = IPTypes.PUBLIC, quota_project: typing.Optional[str] = None, iam_account_email: typing.Optional[str] = None, ) -> llama_index_cloud_sql_pg.engine.PostgresEngine

Create a PostgresEngine from a Postgres instance.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.from_instance

llama_index_cloud_sql_pg.engine.PostgresEngine.init_chat_store_table

init_chat_store_table( table_name: str, schema_name: str = "public", overwrite_existing: bool = False ) -> None

Create a table to save chat store.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.init_chat_store_table

llama_index_cloud_sql_pg.engine.PostgresEngine.init_doc_store_table

init_doc_store_table( table_name: str, schema_name: str = "public", overwrite_existing: bool = False ) -> None

Create a table for the DocumentStore.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.init_doc_store_table

llama_index_cloud_sql_pg.engine.PostgresEngine.init_index_store_table

init_index_store_table( table_name: str, schema_name: str = "public", overwrite_existing: bool = False ) -> None

Create a table to save Index metadata.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.init_index_store_table

llama_index_cloud_sql_pg.engine.PostgresEngine.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_cloud_sql_pg.engine.Column] = "node_id", text_column: str = "text", embedding_column: str = "embedding", metadata_json_column: str = "li_metadata", metadata_columns: list[llama_index_cloud_sql_pg.engine.Column] = [], ref_doc_id_column: str = "ref_doc_id", node_column: str = "node_data", stores_text: bool = True, overwrite_existing: bool = False, ) -> None

Create a table for the VectorStore.

See more: llama_index_cloud_sql_pg.engine.PostgresEngine.init_vector_store_table

llama_index_cloud_sql_pg.index_store.PostgresIndexStore

PostgresIndexStore( key: object, engine: llama_index_cloud_sql_pg.engine.PostgresEngine, index_store: llama_index_cloud_sql_pg.async_index_store.AsyncPostgresIndexStore, )

PostgresIndexStore constructor.

See more: llama_index_cloud_sql_pg.index_store.PostgresIndexStore

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.aadd_index_struct

aadd_index_struct( index_struct: llama_index.core.data_structs.data_structs.IndexStruct, ) -> None

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.add_index_struct

add_index_struct( index_struct: llama_index.core.data_structs.data_structs.IndexStruct, ) -> None

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.adelete_index_struct

adelete_index_struct(key: str) -> None

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.aget_index_struct

aget_index_struct( struct_id: typing.Optional[str] = None, ) -> typing.Optional[llama_index.core.data_structs.data_structs.IndexStruct]

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.aindex_structs

aindex_structs() -> list[llama_index.core.data_structs.data_structs.IndexStruct]

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.async_add_index_struct

async_add_index_struct( index_struct: llama_index.core.data_structs.data_structs.IndexStruct, ) -> None

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.async_index_structs

async_index_structs() -> ( list[llama_index.core.data_structs.data_structs.IndexStruct] )

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.create

create( engine: llama_index_cloud_sql_pg.engine.PostgresEngine, table_name: str, schema_name: str = "public", ) -> llama_index_cloud_sql_pg.index_store.PostgresIndexStore

Create a new PostgresIndexStore instance.

See more: llama_index_cloud_sql_pg.index_store.PostgresIndexStore.create

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.create_sync

create_sync( engine: llama_index_cloud_sql_pg.engine.PostgresEngine, table_name: str, schema_name: str = "public", ) -> llama_index_cloud_sql_pg.index_store.PostgresIndexStore

Create a new PostgresIndexStore sync instance.

See more: llama_index_cloud_sql_pg.index_store.PostgresIndexStore.create_sync

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.delete_index_struct

delete_index_struct(key: str) -> None

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.get_index_struct

get_index_struct( struct_id: typing.Optional[str] = None, ) -> typing.Optional[llama_index.core.data_structs.data_structs.IndexStruct]

llama_index_cloud_sql_pg.index_store.PostgresIndexStore.index_structs

index_structs() -> list[llama_index.core.data_structs.data_structs.IndexStruct]

llama_index_cloud_sql_pg.indexes.BaseIndex.index_options

index_options() -> str

Set index query options for vector store initialization.

See more: llama_index_cloud_sql_pg.indexes.BaseIndex.index_options

llama_index_cloud_sql_pg.indexes.DistanceStrategy._generate_next_value_

_generate_next_value_(start, count, last_values)

Generate the next value when not given.

See more: llama_index_cloud_sql_pg.indexes.DistanceStrategy.generate_next_value

llama_index_cloud_sql_pg.indexes.HNSWIndex.index_options

index_options() -> str

Set index query options for vector store initialization.

See more: llama_index_cloud_sql_pg.indexes.HNSWIndex.index_options

llama_index_cloud_sql_pg.indexes.HNSWQueryOptions.to_string

to_string() -> str

Convert index attributes to string.

See more: llama_index_cloud_sql_pg.indexes.HNSWQueryOptions.to_string

llama_index_cloud_sql_pg.indexes.IVFFlatIndex.index_options

index_options() -> str

Set index query options for vector store initialization.

See more: llama_index_cloud_sql_pg.indexes.IVFFlatIndex.index_options

llama_index_cloud_sql_pg.indexes.IVFFlatQueryOptions.to_string

to_string() -> str

Convert index attributes to string.

See more: llama_index_cloud_sql_pg.indexes.IVFFlatQueryOptions.to_string

llama_index_cloud_sql_pg.indexes.QueryOptions.to_string

to_string() -> str

Convert index attributes to string.

See more: llama_index_cloud_sql_pg.indexes.QueryOptions.to_string

llama_index_cloud_sql_pg.reader.PostgresReader

PostgresReader( key: object, engine: PostgresEngine, reader: AsyncPostgresReader, is_remote: bool = True, )

PostgresReader constructor.

See more: llama_index_cloud_sql_pg.reader.PostgresReader

llama_index_cloud_sql_pg.reader.PostgresReader.alazy_load_data

alazy_load_data() -> typing.AsyncIterable[llama_index.core.schema.Document]

Asynchronously load Cloud SQL postgres data into Document objects lazily.

See more: llama_index_cloud_sql_pg.reader.PostgresReader.alazy_load_data

llama_index_cloud_sql_pg.reader.PostgresReader.aload_data

aload_data() -> list[llama_index.core.schema.Document]

Asynchronously load Cloud SQL postgres data into Document objects.

See more: llama_index_cloud_sql_pg.reader.PostgresReader.aload_data

llama_index_cloud_sql_pg.reader.PostgresReader.class_name

class_name() -> str

llama_index_cloud_sql_pg.reader.PostgresReader.create

create( engine: llama_index_cloud_sql_pg.engine.PostgresEngine, 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_cloud_sql_pg.reader.PostgresReader

Asynchronously create an PostgresReader instance.

See more: llama_index_cloud_sql_pg.reader.PostgresReader.create

llama_index_cloud_sql_pg.reader.PostgresReader.create_sync

create_sync( engine: llama_index_cloud_sql_pg.engine.PostgresEngine, 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_cloud_sql_pg.reader.PostgresReader

Synchronously create an PostgresReader instance.

See more: llama_index_cloud_sql_pg.reader.PostgresReader.create_sync

llama_index_cloud_sql_pg.reader.PostgresReader.lazy_load_data

lazy_load_data() -> typing.Iterable[llama_index.core.schema.Document]

Synchronously load Cloud SQL postgres data into Document objects lazily.

See more: llama_index_cloud_sql_pg.reader.PostgresReader.lazy_load_data

llama_index_cloud_sql_pg.reader.PostgresReader.load_data

load_data() -> list[llama_index.core.schema.Document]

Synchronously load Cloud SQL postgres data into Document objects.

See more: llama_index_cloud_sql_pg.reader.PostgresReader.load_data

llama_index_cloud_sql_pg.reader.PostgresReader.model_post_init

model_post_init(context: Any, /) -> None

This function is meant to behave like a BaseModel method to initialise private attributes.

See more: llama_index_cloud_sql_pg.reader.PostgresReader.model_post_init

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore

PostgresVectorStore( key: object, engine: PostgresEngine, vs: AsyncPostgresVectorStore, stores_text: bool = True, is_embedding_query: bool = True, )

PostgresVectorStore constructor.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.aapply_vector_index

aapply_vector_index( index: llama_index_cloud_sql_pg.indexes.BaseIndex, name: typing.Optional[str] = None, concurrently: bool = False, ) -> None

Create an index on the vector store table.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.aapply_vector_index

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.aclear

aclear() -> None

Asynchronously delete all nodes from the table.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.aclear

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.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_cloud_sql_pg.vector_store.PostgresVectorStore.add

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.adelete

adelete(ref_doc_id: str, **delete_kwargs: typing.Any) -> None

Asynchronously delete nodes belonging to provided parent document from the table.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.adelete

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.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 ) -> None

Asynchronously delete a set of nodes from the table matching the provided nodes and filters.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.adelete_nodes

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.adrop_vector_index

adrop_vector_index(index_name: typing.Optional[str] = None) -> None

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.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_cloud_sql_pg.vector_store.PostgresVectorStore.aget_nodes

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.ais_valid_index

ais_valid_index(index_name: typing.Optional[str] = None) -> bool

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.apply_vector_index

apply_vector_index( index: llama_index_cloud_sql_pg.indexes.BaseIndex, name: typing.Optional[str] = None, concurrently: bool = False, ) -> None

Create an index on the vector store table.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.apply_vector_index

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.aquery

aquery( query: llama_index.core.vector_stores.types.VectorStoreQuery, **kwargs: typing.Any ) -> llama_index.core.vector_stores.types.VectorStoreQueryResult

Asynchronously query vector store.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.aquery

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.areindex

areindex(index_name: typing.Optional[str] = None) -> None

Re-index the vector store table.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.areindex

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.aset_maintenance_work_mem

aset_maintenance_work_mem(num_leaves: int, vector_size: int) -> None

Set database maintenance work memory (for index creation).

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.aset_maintenance_work_mem

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.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_cloud_sql_pg.vector_store.PostgresVectorStore.async_add

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.class_name

class_name() -> str

Get the class name, used as a unique ID in serialization.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.class_name

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.clear

clear() -> None

Synchronously delete all nodes from the table.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.clear

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.create

create( engine: llama_index_cloud_sql_pg.engine.PostgresEngine, 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_cloud_sql_pg.indexes.DistanceStrategy = DistanceStrategy.COSINE_DISTANCE, index_query_options: typing.Optional[ llama_index_cloud_sql_pg.indexes.QueryOptions ] = None, ) -> llama_index_cloud_sql_pg.vector_store.PostgresVectorStore

Create an PostgresVectorStore instance and validates the table schema.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.create

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.create_sync

create_sync( engine: llama_index_cloud_sql_pg.engine.PostgresEngine, 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_cloud_sql_pg.indexes.DistanceStrategy = DistanceStrategy.COSINE_DISTANCE, index_query_options: typing.Optional[ llama_index_cloud_sql_pg.indexes.QueryOptions ] = None, ) -> llama_index_cloud_sql_pg.vector_store.PostgresVectorStore

Create an PostgresVectorStore instance and validates the table schema.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.create_sync

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.delete

delete(ref_doc_id: str, **delete_kwargs: typing.Any) -> None

Synchronously delete nodes belonging to provided parent document from the table.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.delete

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.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 ) -> None

Synchronously delete a set of nodes from the table matching the provided nodes and filters.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.delete_nodes

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.drop_vector_index

drop_vector_index(index_name: typing.Optional[str] = None) -> None

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.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_cloud_sql_pg.vector_store.PostgresVectorStore.get_nodes

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.is_valid_index

is_valid_index(index_name: typing.Optional[str] = None) -> bool

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.model_post_init

model_post_init(context: Any, /) -> None

This function is meant to behave like a BaseModel method to initialise private attributes.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.model_post_init

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.query

query( query: llama_index.core.vector_stores.types.VectorStoreQuery, **kwargs: typing.Any ) -> llama_index.core.vector_stores.types.VectorStoreQueryResult

Synchronously query vector store.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.query

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.reindex

reindex(index_name: typing.Optional[str] = None) -> None

Re-index the vector store table.

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.reindex

llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.set_maintenance_work_mem

set_maintenance_work_mem(num_leaves: int, vector_size: int) -> None

Set database maintenance work memory (for index creation).

See more: llama_index_cloud_sql_pg.vector_store.PostgresVectorStore.set_maintenance_work_mem