-
Notifications
You must be signed in to change notification settings - Fork 44.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8de2177
commit 035fb19
Showing
3 changed files
with
46 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from typing import Literal | ||
|
||
from autogpt_libs.supabase_integration_credentials_store.types import ( | ||
APIKeyCredentials, | ||
) | ||
from pydantic import SecretStr | ||
|
||
from backend.data.model import CredentialsField, CredentialsMetaInput | ||
|
||
|
||
JinaCredentials = APIKeyCredentials | ||
JinaCredentialsInput = CredentialsMetaInput[ | ||
Literal["jina"], | ||
Literal["api_key"], | ||
] | ||
|
||
|
||
def JinaCredentialsField() -> JinaCredentialsInput: | ||
""" | ||
Creates a Jina credentials input on a block. | ||
""" | ||
return CredentialsField( | ||
provider="jina", | ||
supported_credential_types={"api_key"} , # noqa | ||
description="The Jina integration can be used with an API Key." | ||
) | ||
|
||
|
||
TEST_CREDENTIALS = APIKeyCredentials( | ||
id="01234567-89ab-cdef-0123-456789abcdef", | ||
provider="jina", | ||
api_key=SecretStr("mock-jina-api-key"), | ||
title="Mock Jina API key", | ||
expires_at=None, | ||
) | ||
TEST_CREDENTIALS_INPUT = { | ||
"provider": TEST_CREDENTIALS.provider, | ||
"id": TEST_CREDENTIALS.id, | ||
"type": TEST_CREDENTIALS.type, | ||
"title": TEST_CREDENTIALS.type, | ||
} |