Refactor Credential model to use Optional for provider field
This commit is contained in:
parent
1558934429
commit
84f4c32076
1 changed files with 2 additions and 3 deletions
|
|
@ -2,9 +2,8 @@ from datetime import datetime
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from sqlmodel import Field, Relationship, SQLModel
|
||||
|
||||
from langflow.services.database.models.credential.schema import CredentialType
|
||||
from sqlmodel import Field, Relationship, SQLModel
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langflow.services.database.models.user import User
|
||||
|
|
@ -28,7 +27,7 @@ class Credential(CredentialBase, table=True):
|
|||
|
||||
class CredentialCreate(CredentialBase):
|
||||
# AcceptedProviders is a custom Enum
|
||||
provider: CredentialType = Field(description="Provider of the credential (e.g OpenAI)")
|
||||
provider: Optional[CredentialType] = Field(None, description="Provider of the credential (e.g OpenAI)")
|
||||
|
||||
|
||||
class CredentialRead(SQLModel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue