Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute vector store usage bytes #84

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

phact
Copy link
Collaborator

@phact phact commented Dec 2, 2024

Fixes #31

Compute vector store usage bytes in create_vector_store and create_vector_store_file functions.

  • impl/routes_v2/vector_stores.py:

    • Import os and HTTPException.
    • Compute usage_bytes in create_vector_store by summing usage_bytes of each file.
    • Compute usage_bytes in create_vector_store_file by reading file size from the database.
    • Return DeleteVectorStoreFileResponse in delete_vector_store_file.
  • client/.github/workflows/run-tests.yml:

    • Add a new job for running vector store bytes tests.
  • client/tests/astra-assistants/test_vector_store_bytes.py:

    • Add a new test file to verify the usage_bytes attribute for vector stores.
    • Set up the test environment and write a test function that creates a vector store, attaches files to it, and verifies the usage_bytes attribute.

For more details, open the Copilot Workspace session.

Fixes #31

Compute vector store usage bytes in `create_vector_store` and `create_vector_store_file` functions.

* **`impl/routes_v2/vector_stores.py`**:
  - Import `os` and `HTTPException`.
  - Compute `usage_bytes` in `create_vector_store` by summing `usage_bytes` of each file.
  - Compute `usage_bytes` in `create_vector_store_file` by reading file size from the database.
  - Return `DeleteVectorStoreFileResponse` in `delete_vector_store_file`.

* **`client/.github/workflows/run-tests.yml`**:
  - Add a new job for running vector store bytes tests.

* **`client/tests/astra-assistants/test_vector_store_bytes.py`**:
  - Add a new test file to verify the `usage_bytes` attribute for vector stores.
  - Set up the test environment and write a test function that creates a vector store, attaches files to it, and verifies the `usage_bytes` attribute.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/datastax/astra-assistants-api/issues/31?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compute vector store usage bytes
1 participant