Skip to content

Conversation

loeng2023
Copy link
Contributor

@loeng2023 loeng2023 commented Feb 13, 2024

User can now specify customized content column and metadata JSON column in replace of the default "page_content" and "langchain_metadata" column.

Summary of changes:

  • MySQLEngine
    • init_document_table can create column with non-default name content_column and metadata_json_column, deprecate store_metadata.
  • MySQLLoader
    • Add metadata_json_column for loading document.metadata from non-default JSON metadata field.
    • raise ValueError if specified columns cannot be found in table.
  • MySQLSaver
    • Add content_column for saving document.page_content into non-default content field.
    • Add metadata_json_column for saving document.metadata into non-default JSON metadata field.
    • Support deleting document with non-default content and JSON metadata field.
  • test_mysql_loader.py
    • test_save_doc_with_customized_metadata will use non-default content and JSON metadata column.
    • test_delete_doc_with_customized_metadata will use non-default content and JSON metadata column.

@loeng2023 loeng2023 requested a review from a team as a code owner February 13, 2024 00:40
@product-auto-label product-auto-label bot added the api: cloudsql-mysql Issues related to the googleapis/langchain-google-cloud-sql-mysql-python API. label Feb 13, 2024
@loeng2023 loeng2023 requested review from totoleon, jackwotherspoon and kurtisvg and removed request for totoleon February 13, 2024 00:41
@loeng2023 loeng2023 merged commit b489a43 into main Feb 15, 2024
@loeng2023 loeng2023 deleted the doc-loader-update branch February 15, 2024 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: cloudsql-mysql Issues related to the googleapis/langchain-google-cloud-sql-mysql-python API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants