gpt-code-assistant
gpt-code-assistant copied to clipboard
Delete Project command not working as intended.
gpt-code-assistant delete-project gpt-code-assistant Deleting embeddings for project - gpt-code-assistant ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ C:\Users\angwm\AppData\Roaming\Python\Python311\site-packages\core\main.py:90 in delete_project │ │ │ │ 87 │ """ │ │ 88 │ Delete a project and all its data (embeddings included) │ │ 89 │ """ │ │ ❱ 90 │ projects.delete_project(name) │ │ 91 │ │ 92 │ │ 93 @app.command() │ │ │ │ ╭────────── locals ───────────╮ │ │ │ name = 'gpt-code-assistant' │ │ │ ╰─────────────────────────────╯ │ │ │ │ C:\Users\angwm\AppData\Roaming\Python\Python311\site-packages\repository\projects.py:97 in │ │ delete_project │ │ │ │ 94 │ │ project = session.query(Project).filter_by(name=name).first() │ │ 95 │ │ if project: │ │ 96 │ │ │ console.print(f"Deleting embeddings for project - {project.name}") │ │ ❱ 97 │ │ │ delete_all_file_section_embeddings(project.id) │ │ 98 │ │ │ console.print(f"Deleting project - {project.name} at {project.path}") │ │ 99 │ │ │ session.delete(project) │ │ 100 │ │ │ console.print(f"Project - {project.name} deleted.") │ │ │ │ ╭──────────────────────────────── locals ─────────────────────────────────╮ │ │ │ name = 'gpt-code-assistant' │ │ │ │ project = <data.projects.Project object at 0x0000020608180450> │ │ │ │ session = <sqlalchemy.orm.session.Session object at 0x0000020608C7F310> │ │ │ ╰─────────────────────────────────────────────────────────────────────────╯ │ │ │ │ C:\Users\angwm\AppData\Roaming\Python\Python311\site-packages\data\chroma.py:23 in │ │ delete_all_file_section_embeddings │ │ │ │ 20 │ ) │ │ 21 │ │ 22 def delete_all_file_section_embeddings(project_id: UUID): │ │ ❱ 23 │ get_file_section_collection(project_id).delete() │ │ 24 │ │ 25 def create_file_section_embeddings(project_id: UUID, file_section_id: UUID, file_section │ │ 26 │ embedding = open_ai.create_embedding(file_section) │ │ │ │ ╭───────────────────────── locals ──────────────────────────╮ │ │ │ project_id = UUID('f75d760a-7a35-48c5-9d89-54f444502572') │ │ │ ╰───────────────────────────────────────────────────────────╯ │ │ │ │ C:\Users\angwm\AppData\Roaming\Python\Python311\site-packages\chromadb\api\models\Collection.py: │ │ 521 in delete │ │ │ │ 518 │ │ │ validate_where_document(where_document) if where_document else None │ │ 519 │ │ ) │ │ 520 │ │ │ │ ❱ 521 │ │ self._client._delete(self.id, ids, where, where_document) │ │ 522 │ │ │ 523 │ def validate_embedding_set( │ │ 524 │ │ self, │ │ │ │ ╭──────────────────────────────────── locals ─────────────────────────────────────╮ │ │ │ ids = None │ │ │ │ self = Collection( │ │ │ │ │ name='f75d760a-7a35-48c5-9d89-54f444502572-file_sections', │ │ │ │ │ id=UUID('f1e51aa5-e326-4f99-b8c6-cd80b2111937'), │ │ │ │ │ metadata=None, │ │ │ │ │ tenant='default_tenant', │ │ │ │ │ database='default_database' │ │ │ │ ) │ │ │ │ where = None │ │ │ │ where_document = None │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ C:\Users\angwm\AppData\Roaming\Python\Python311\site-packages\chromadb\telemetry\opentelemetry_ │ │ init.py:127 in wrapper │ │ │ │ 124 │ │ def wrapper(*args: Any, **kwargs: Dict[Any, Any]) -> Any: │ │ 125 │ │ │ global tracer, granularity │ │ 126 │ │ │ if trace_granularity < granularity: │ │ ❱ 127 │ │ │ │ return f(*args, **kwargs) │ │ 128 │ │ │ if not tracer: │ │ 129 │ │ │ │ return f(*args, **kwargs) │ │ 130 │ │ │ with tracer.start_as_current_span(trace_name, attributes=attributes): │ │ │ │ ╭──────────────────────────────────────── locals ─────────────────────────────────────────╮ │ │ │ args = ( │ │ │ │ │ <chromadb.api.segment.SegmentAPI object at 0x0000020606AD69D0>, │ │ │ │ │ UUID('f1e51aa5-e326-4f99-b8c6-cd80b2111937'), │ │ │ │ │ None, │ │ │ │ │ None, │ │ │ │ │ None │ │ │ │ ) │ │ │ │ attributes = None │ │ │ │ kwargs = {} │ │ │ │ trace_granularity = <OpenTelemetryGranularity.OPERATION: 'operation'> │ │ │ │ trace_name = 'SegmentAPI._delete' │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ C:\Users\angwm\AppData\Roaming\Python\Python311\site-packages\chromadb\api\segment.py:603 in │ │ _delete │ │ │ │ 600 │ │ │ │ or (where_document is not None and len(where_document) == 0) │ │ 601 │ │ │ ) │ │ 602 │ │ ): │ │ ❱ 603 │ │ │ raise ValueError( │ │ 604 │ │ │ │ """ │ │ 605 │ │ │ │ You must provide either ids, where, or where_document to delete. If │ │ 606 │ │ │ │ you want to delete all data in a collection you can delete the │ │ │ │ ╭──────────────────────────────────── locals ─────────────────────────────────────╮ │ │ │ collection_id = UUID('f1e51aa5-e326-4f99-b8c6-cd80b2111937') │ │ │ │ ids = None │ │ │ │ self = <chromadb.api.segment.SegmentAPI object at 0x0000020606AD69D0> │ │ │ │ where = None │ │ │ │ where_document = None │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ValueError: You must provide either ids, where, or where_document to delete. If you want to delete all data in a collection you can delete the collection itself using the delete_collection method. Or alternatively, you can get() all the relevant ids and then delete them.