Skip to content

Commit

Permalink
move Vector type from crud_vector_content to Typedef
Browse files Browse the repository at this point in the history
  • Loading branch information
gphorvath committed Sep 25, 2024
1 parent b1c1208 commit 4290c6d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 1 addition & 10 deletions src/leapfrogai_api/data/crud_vector_content.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
"""CRUD Operations for VectorStore."""

from pydantic import BaseModel
from supabase import AClient as AsyncClient
from leapfrogai_api.data.crud_base import get_user_id
import ast
from leapfrogai_api.typedef.vectorstores import SearchItem, SearchResponse
from leapfrogai_api.backend.constants import TOP_K


class Vector(BaseModel):
id: str = ""
vector_store_id: str
file_id: str
content: str
metadata: dict
embedding: list[float]
from leapfrogai_api.typedef.vectorstores import Vector


class CRUDVectorContent:
Expand Down
1 change: 1 addition & 0 deletions src/leapfrogai_api/typedef/vectorstores/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ListVectorStoresResponse as ListVectorStoresResponse,
)
from .search_types import (
Vector as Vector,
SearchItem as SearchItem,
SearchResponse as SearchResponse,
)
9 changes: 9 additions & 0 deletions src/leapfrogai_api/typedef/vectorstores/search_types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
from pydantic import BaseModel, Field


class Vector(BaseModel):
id: str = ""
vector_store_id: str
file_id: str
content: str
metadata: dict
embedding: list[float]


class SearchItem(BaseModel):
"""Object representing a single item in a search result."""

Expand Down

0 comments on commit 4290c6d

Please sign in to comment.