mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-07 18:06:52 +08:00
16 lines
495 B
Python
16 lines
495 B
Python
from services.auth.firecrawl import FirecrawlAuth
|
|
from services.auth.jina import JinaAuth
|
|
|
|
|
|
class ApiKeyAuthFactory:
|
|
def __init__(self, provider: str, credentials: dict):
|
|
if provider == "firecrawl":
|
|
self.auth = FirecrawlAuth(credentials)
|
|
elif provider == "jinareader":
|
|
self.auth = JinaAuth(credentials)
|
|
else:
|
|
raise ValueError("Invalid provider")
|
|
|
|
def validate_credentials(self):
|
|
return self.auth.validate_credentials()
|