Skip to content

Commit e6e4737

Browse files
authored
feat(blocks/jina): Add default credentials for Jina (#8603)
add jina defaults
1 parent f981a74 commit e6e4737

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

autogpt_platform/autogpt_libs/autogpt_libs/supabase_integration_credentials_store/store.py

+11
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@
7272
title="Use Credits for D-ID",
7373
expires_at=None,
7474
)
75+
jina_credentials = APIKeyCredentials(
76+
id="7f26de70-ba0d-494e-ba76-238e65e7b45f",
77+
provider="jina",
78+
api_key=SecretStr(settings.secrets.jina_api_key),
79+
title="Use Credits for Jina",
80+
expires_at=None,
81+
)
82+
7583

7684
DEFAULT_CREDENTIALS = [
7785
revid_credentials,
@@ -81,6 +89,7 @@
8189
anthropic_credentials,
8290
groq_credentials,
8391
did_credentials,
92+
jina_credentials,
8493
]
8594

8695

@@ -124,6 +133,8 @@ def get_all_creds(self, user_id: str) -> list[Credentials]:
124133
all_credentials.append(anthropic_credentials)
125134
if settings.secrets.did_api_key:
126135
all_credentials.append(did_credentials)
136+
if settings.secrets.jina_api_key:
137+
all_credentials.append(jina_credentials)
127138
return all_credentials
128139

129140
def get_creds_by_id(self, user_id: str, credentials_id: str) -> Credentials | None:

autogpt_platform/backend/backend/data/credit.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
did_credentials,
1010
groq_credentials,
1111
ideogram_credentials,
12+
jina_credentials,
1213
openai_credentials,
1314
replicate_credentials,
1415
revid_credentials,
@@ -144,7 +145,18 @@ def __init__(
144145
},
145146
)
146147
],
147-
SearchTheWebBlock: [BlockCost(cost_amount=1)],
148+
SearchTheWebBlock: [
149+
BlockCost(
150+
cost_amount=1,
151+
cost_filter={
152+
"credentials": {
153+
"id": jina_credentials.id,
154+
"provider": jina_credentials.provider,
155+
"type": jina_credentials.type,
156+
}
157+
},
158+
)
159+
],
148160
ExtractWebsiteContentBlock: [
149161
BlockCost(cost_amount=1, cost_filter={"raw_content": False})
150162
],

autogpt_platform/backend/backend/util/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ class Secrets(UpdateTrackingModel["Secrets"], BaseSettings):
266266
replicate_api_key: str = Field(default="", description="Replicate API Key")
267267
unreal_speech_api_key: str = Field(default="", description="Unreal Speech API Key")
268268
ideogram_api_key: str = Field(default="", description="Ideogram API Key")
269+
jina_api_key: str = Field(default="", description="Jina API Key")
269270

270271
# Add more secret fields as needed
271272

0 commit comments

Comments
 (0)