Spaces:
Build error
Build error
mdkrasnow commited on
Commit ·
2cc9bcc
1
Parent(s): fac18f2
Begin change
Browse files
data_labelling/archer/database/supabase.py
CHANGED
|
@@ -29,13 +29,13 @@ class SupabaseDatabase:
|
|
| 29 |
- archer_evaluations: Stores evaluations (AI and human) of generated outputs.
|
| 30 |
"""
|
| 31 |
|
| 32 |
-
def __init__(self,
|
| 33 |
"""
|
| 34 |
Initialize the SupabaseDatabase instance using Supabase URL and API key.
|
| 35 |
"""
|
| 36 |
-
self.
|
| 37 |
-
self.
|
| 38 |
-
self.client: Client = create_client(self.
|
| 39 |
self.user_id = "default_user"
|
| 40 |
|
| 41 |
def store_generated_content(self, input_data: str, content: str, prompt_id: str, round_num: int) -> Optional[str]:
|
|
|
|
| 29 |
- archer_evaluations: Stores evaluations (AI and human) of generated outputs.
|
| 30 |
"""
|
| 31 |
|
| 32 |
+
def __init__(self, api_url: Optional[str] = None, api_key: Optional[str] = None):
|
| 33 |
"""
|
| 34 |
Initialize the SupabaseDatabase instance using Supabase URL and API key.
|
| 35 |
"""
|
| 36 |
+
self.api_url = api_url or os.getenv("SUPABASE_API_URL")
|
| 37 |
+
self.api_key = api_key or os.getenv("SUPABASE_API_KEY")
|
| 38 |
+
self.client: Client = create_client(self.api_url, self.api_key)
|
| 39 |
self.user_id = "default_user"
|
| 40 |
|
| 41 |
def store_generated_content(self, input_data: str, content: str, prompt_id: str, round_num: int) -> Optional[str]:
|