Feat/support tool credentials bool schema (#2875)

This commit is contained in:
Yeuoly
2024-03-18 16:55:26 +08:00
committed by GitHub
parent cb79a90031
commit 95b74c211d
7 changed files with 204 additions and 50 deletions

View File

@@ -171,6 +171,7 @@ class ToolProviderCredentials(BaseModel):
SECRET_INPUT = "secret-input"
TEXT_INPUT = "text-input"
SELECT = "select"
BOOLEAN = "boolean"
@classmethod
def value_of(cls, value: str) -> "ToolProviderCredentials.CredentialsType":
@@ -192,7 +193,7 @@ class ToolProviderCredentials(BaseModel):
name: str = Field(..., description="The name of the credentials")
type: CredentialsType = Field(..., description="The type of the credentials")
required: bool = False
default: Optional[str] = None
default: Optional[Union[int, str]] = None
options: Optional[list[ToolCredentialsOption]] = None
label: Optional[I18nObject] = None
help: Optional[I18nObject] = None