mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
feat: unify handling of native and legacy document types for Google connectors
- Introduced a mapping of native Google document types to their legacy Composio equivalents, ensuring seamless search and indexing for both types. - Updated relevant components to utilize the new mapping, enhancing the consistency of document type handling across the application. - Improved search functionality to transparently include legacy types, maintaining accessibility for older documents until re-indexed.
This commit is contained in:
parent
aaf34800e6
commit
d21593ee71
7 changed files with 104 additions and 34 deletions
|
|
@ -63,6 +63,16 @@ class DocumentType(StrEnum):
|
|||
COMPOSIO_GOOGLE_CALENDAR_CONNECTOR = "COMPOSIO_GOOGLE_CALENDAR_CONNECTOR"
|
||||
|
||||
|
||||
# Native Google document types → their legacy Composio equivalents.
|
||||
# Old documents may still carry the Composio type until they are re-indexed;
|
||||
# search, browse, and indexing must transparently handle both.
|
||||
NATIVE_TO_LEGACY_DOCTYPE: dict[str, str] = {
|
||||
"GOOGLE_DRIVE_FILE": "COMPOSIO_GOOGLE_DRIVE_CONNECTOR",
|
||||
"GOOGLE_GMAIL_CONNECTOR": "COMPOSIO_GMAIL_CONNECTOR",
|
||||
"GOOGLE_CALENDAR_CONNECTOR": "COMPOSIO_GOOGLE_CALENDAR_CONNECTOR",
|
||||
}
|
||||
|
||||
|
||||
class SearchSourceConnectorType(StrEnum):
|
||||
SERPER_API = "SERPER_API" # NOT IMPLEMENTED YET : DON'T REMEMBER WHY : MOST PROBABLY BECAUSE WE NEED TO CRAWL THE RESULTS RETURNED BY IT
|
||||
TAVILY_API = "TAVILY_API"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue