forked from XSpoonAi/spoon-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.py
More file actions
23 lines (19 loc) · 737 Bytes
/
base.py
File metadata and controls
23 lines (19 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Base module for Autonomys Auto Drive tools"""
import os
from .provider import AutoDriveProvider
def get_provider() -> AutoDriveProvider:
"""
Get Auto Drive provider instance.
Validates that the API key is configured before initialization.
"""
api_key = os.environ.get('AUTONOMYS_AUTO_DRIVE_API_KEY', 'apikey')
auth_provider = os.environ.get('AUTONOMYS_AUTO_DRIVE_AUTH_PROVIDER', 'apikey')
if not api_key:
raise RuntimeError(
"AUTONOMYS_AUTO_DRIVE_API_KEY is not set in environment variables. "
"Please configure it to use Autonomys Auto Drive tools."
)
return AutoDriveProvider(
api_key=api_key,
auth_provider=auth_provider
)