-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added embedding reading + doctrings updates
- Loading branch information
1 parent
32d67bc
commit 831e950
Showing
11 changed files
with
194 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from typing import Literal | ||
from uuid import UUID | ||
|
||
from beartype import beartype | ||
from sqlglot import parse_one | ||
|
||
from ..utils import pg_query | ||
|
||
# TODO: This is a placeholder for the actual query | ||
vectorizer_query = None | ||
|
||
|
||
@pg_query | ||
@beartype | ||
async def embed_snippets( | ||
*, | ||
developer_id: UUID, | ||
doc_id: UUID, | ||
owner_type: Literal["user", "agent"] | None = None, | ||
owner_id: UUID | None = None, | ||
) -> tuple[str, list]: | ||
""" | ||
Trigger the vectorizer to generate embeddings for documents. | ||
Parameters: | ||
developer_id (UUID): The ID of the developer. | ||
doc_id (UUID): The ID of the document. | ||
owner_type (Literal["user", "agent"]): The type of the owner of the documents. | ||
owner_id (UUID): The ID of the owner of the documents. | ||
Returns: | ||
tuple[str, list]: SQL query and parameters for embedding the snippets. | ||
""" | ||
return ( | ||
vectorizer_query, | ||
[developer_id, doc_id, owner_type, owner_id], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters