mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-14 17:03:29 +03:00
feat(integration): improve (#2199)
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
This commit is contained in:
parent
1099d1664f
commit
ef6ee14440
@ -1,3 +1,4 @@
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
@ -14,6 +15,11 @@ from pydantic import BaseModel, Extra
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
||||
class IntegrationType(str, Enum):
|
||||
CUSTOM = "custom"
|
||||
SYNC = "sync"
|
||||
|
||||
|
||||
class CreateApiBrainDefinition(BaseModel, extra=Extra.forbid):
|
||||
method: ApiBrainAllowedMethods
|
||||
url: str
|
||||
@ -28,6 +34,9 @@ class CreateIntegrationBrain(BaseModel, extra=Extra.forbid):
|
||||
integration_name: str
|
||||
integration_logo_url: str
|
||||
connection_settings: dict
|
||||
integration_type: IntegrationType
|
||||
description: str
|
||||
max_files: int
|
||||
|
||||
|
||||
class BrainIntegrationSettings(BaseModel, extra=Extra.forbid):
|
||||
|
@ -1,6 +1,7 @@
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
from modules.brain.dto.inputs import IntegrationType
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
@ -9,6 +10,9 @@ class IntegrationDescriptionEntity(BaseModel):
|
||||
integration_name: str
|
||||
integration_logo_url: Optional[str] = None
|
||||
connection_settings: Optional[dict] = None
|
||||
integration_type: IntegrationType
|
||||
description: str
|
||||
max_files: int
|
||||
|
||||
|
||||
class IntegrationEntity(BaseModel):
|
||||
|
7
supabase/migrations/20240216192826_integration.sql
Normal file
7
supabase/migrations/20240216192826_integration.sql
Normal file
@ -0,0 +1,7 @@
|
||||
create type "public"."integration_type" as enum ('custom', 'sync');
|
||||
|
||||
alter table "public"."integrations" add column "description" text not null default 'Default description'::text;
|
||||
|
||||
alter table "public"."integrations" add column "integration_type" integration_type not null default 'custom'::integration_type;
|
||||
|
||||
alter table "public"."integrations" add column "max_files" integer not null default 0;
|
Loading…
Reference in New Issue
Block a user