Merge remote-tracking branch 'origin/main' into feat/trigger

This commit is contained in:
lyzno1
2025-10-13 13:21:51 +08:00
268 changed files with 6311 additions and 2497 deletions

View File

@ -111,7 +111,7 @@ class BuiltinToolProviderController(ToolProviderController):
:return: the credentials schema
"""
return self.get_credentials_schema_by_type(CredentialType.API_KEY.value)
return self.get_credentials_schema_by_type(CredentialType.API_KEY)
def get_credentials_schema_by_type(self, credential_type: str) -> list[ProviderConfig]:
"""
@ -122,7 +122,7 @@ class BuiltinToolProviderController(ToolProviderController):
"""
if credential_type == CredentialType.OAUTH2.value:
return self.entity.oauth_schema.credentials_schema.copy() if self.entity.oauth_schema else []
if credential_type == CredentialType.API_KEY.value:
if credential_type == CredentialType.API_KEY:
return self.entity.credentials_schema.copy() if self.entity.credentials_schema else []
raise ValueError(f"Invalid credential type: {credential_type}")
@ -134,15 +134,15 @@ class BuiltinToolProviderController(ToolProviderController):
"""
return self.entity.oauth_schema.client_schema.copy() if self.entity.oauth_schema else []
def get_supported_credential_types(self) -> list[str]:
def get_supported_credential_types(self) -> list[CredentialType]:
"""
returns the credential support type of the provider
"""
types = []
if self.entity.credentials_schema is not None and len(self.entity.credentials_schema) > 0:
types.append(CredentialType.API_KEY.value)
types.append(CredentialType.API_KEY)
if self.entity.oauth_schema is not None and len(self.entity.oauth_schema.credentials_schema) > 0:
types.append(CredentialType.OAUTH2.value)
types.append(CredentialType.OAUTH2)
return types
def get_tools(self) -> list[BuiltinTool]: