1111from eval_protocol .fireworks_api_client import FireworksAPIClient
1212from eval_protocol .models import EvaluationRow
1313from eval_protocol .pytest .store_experiment_link import store_experiment_link
14- import requests
1514
1615
1716def handle_persist_flow (all_results : list [list [EvaluationRow ]], test_func_name : str ):
@@ -128,8 +127,7 @@ def get_auth_value(key: str) -> str | None:
128127 )
129128 continue
130129
131- client = FireworksAPIClient (api_key = fireworks_api_key ,
132- api_base = "https://api.fireworks.ai" )
130+ client = FireworksAPIClient (api_key = fireworks_api_key , api_base = "https://api.fireworks.ai" )
133131
134132 # Make dataset first
135133
@@ -143,7 +141,9 @@ def get_auth_value(key: str) -> str | None:
143141 "datasetId" : dataset_name ,
144142 }
145143
146- dataset_response = requests .post (dataset_url , json = dataset_payload , headers = headers ) # pyright: ignore[reportUnknownArgumentType]
144+ dataset_response = client .post (
145+ f"v1/accounts/{ fireworks_account_id } /datasets" , json = dataset_payload
146+ ) # pyright: ignore[reportUnknownArgumentType]
147147
148148 # Skip if dataset creation failed
149149 if dataset_response .status_code not in [200 , 201 ]:
@@ -160,8 +160,9 @@ def get_auth_value(key: str) -> str | None:
160160 # Upload the JSONL file content
161161 with open (exp_file , "rb" ) as f :
162162 files = {"file" : f }
163- upload_response = client .post (f"v1/accounts/{ fireworks_account_id } /datasets/{ dataset_id } :upload" ,
164- files = files )
163+ upload_response = client .post (
164+ f"v1/accounts/{ fireworks_account_id } /datasets/{ dataset_id } :upload" , files = files
165+ )
165166
166167 # Skip if upload failed
167168 if upload_response .status_code not in [200 , 201 ]:
@@ -173,7 +174,6 @@ def get_auth_value(key: str) -> str | None:
173174 continue
174175
175176 # Create evaluation job (optional - don't skip experiment if this fails)
176- eval_job_url = f"https://api.fireworks.ai/v1/accounts/{ fireworks_account_id } /evaluationJobs"
177177 # Truncate job ID to fit 63 character limit
178178 job_id_base = f"{ dataset_name } -job"
179179 if len (job_id_base ) > 63 :
@@ -191,8 +191,9 @@ def get_auth_value(key: str) -> str | None:
191191 },
192192 }
193193
194- eval_response = client .post (f"v1/accounts/{ fireworks_account_id } /evaluationJobs" ,
195- json = eval_job_payload )
194+ eval_response = client .post (
195+ f"v1/accounts/{ fireworks_account_id } /evaluationJobs" , json = eval_job_payload
196+ )
196197
197198 if eval_response .status_code in [200 , 201 ]:
198199 eval_job_data = eval_response .json () # pyright: ignore[reportAny]
0 commit comments