Skip to content

Commit 750a3e5

Browse files
committed
update
1 parent 59ebb4a commit 750a3e5

2 files changed

Lines changed: 36 additions & 30 deletions

File tree

eval_protocol/cli_commands/upload.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -519,35 +519,35 @@ def upload_command(args: argparse.Namespace) -> int:
519519
description = getattr(args, "description", None)
520520
force = bool(getattr(args, "force", False))
521521

522-
# Ensure FIREWORKS_API_KEY is available to the remote by storing it as a Fireworks secret
523-
try:
524-
fw_account_id = get_fireworks_account_id()
525-
fw_api_key_value = get_fireworks_api_key()
526-
if not fw_account_id and fw_api_key_value:
527-
# Attempt to verify and resolve account id from server headers
528-
resolved = verify_api_key_and_get_account_id(api_key=fw_api_key_value, api_base=get_fireworks_api_base())
529-
if resolved:
530-
fw_account_id = resolved
531-
# Propagate to environment so downstream calls use it if needed
532-
os.environ["FIREWORKS_ACCOUNT_ID"] = fw_account_id
533-
print(f"Resolved FIREWORKS_ACCOUNT_ID via API verification: {fw_account_id}")
534-
if fw_account_id and fw_api_key_value:
535-
print("Ensuring FIREWORKS_API_KEY is registered as a secret on Fireworks for rollout...")
536-
if create_or_update_fireworks_secret(
537-
account_id=fw_account_id,
538-
key_name="FIREWORKS_API_KEY",
539-
secret_value=fw_api_key_value,
540-
):
541-
print("✓ FIREWORKS_API_KEY secret created/updated on Fireworks.")
542-
else:
543-
print("Warning: Failed to create/update FIREWORKS_API_KEY secret on Fireworks.")
544-
else:
545-
if not fw_account_id:
546-
print("Warning: FIREWORKS_ACCOUNT_ID not found; cannot register FIREWORKS_API_KEY secret.")
547-
if not fw_api_key_value:
548-
print("Warning: FIREWORKS_API_KEY not found locally; cannot register secret.")
549-
except Exception as e:
550-
print(f"Warning: Skipped Fireworks secret registration due to error: {e}")
522+
# # Ensure FIREWORKS_API_KEY is available to the remote by storing it as a Fireworks secret
523+
# try:
524+
# fw_account_id = get_fireworks_account_id()
525+
# fw_api_key_value = get_fireworks_api_key()
526+
# if not fw_account_id and fw_api_key_value:
527+
# # Attempt to verify and resolve account id from server headers
528+
# resolved = verify_api_key_and_get_account_id(api_key=fw_api_key_value, api_base=get_fireworks_api_base())
529+
# if resolved:
530+
# fw_account_id = resolved
531+
# # Propagate to environment so downstream calls use it if needed
532+
# os.environ["FIREWORKS_ACCOUNT_ID"] = fw_account_id
533+
# print(f"Resolved FIREWORKS_ACCOUNT_ID via API verification: {fw_account_id}")
534+
# if fw_account_id and fw_api_key_value:
535+
# print("Ensuring FIREWORKS_API_KEY is registered as a secret on Fireworks for rollout...")
536+
# if create_or_update_fireworks_secret(
537+
# account_id=fw_account_id,
538+
# key_name="FIREWORKS_API_KEY",
539+
# secret_value=fw_api_key_value,
540+
# ):
541+
# print("✓ FIREWORKS_API_KEY secret created/updated on Fireworks.")
542+
# else:
543+
# print("Warning: Failed to create/update FIREWORKS_API_KEY secret on Fireworks.")
544+
# else:
545+
# if not fw_account_id:
546+
# print("Warning: FIREWORKS_ACCOUNT_ID not found; cannot register FIREWORKS_API_KEY secret.")
547+
# if not fw_api_key_value:
548+
# print("Warning: FIREWORKS_API_KEY not found locally; cannot register secret.")
549+
# except Exception as e:
550+
# print(f"Warning: Skipped Fireworks secret registration due to error: {e}")
551551

552552
exit_code = 0
553553
for i, (qualname, source_file_path) in enumerate(selected_specs):

eval_protocol/evaluation.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,18 +606,21 @@ def create(self, evaluator_id, display_name=None, description=None, force=False)
606606
if "dev.api.fireworks.ai" in self.api_base and account_id == "fireworks":
607607
account_id = "pyroworks-dev"
608608

609-
base_url = f"{self.api_base}/v1/{parent}/evaluators"
609+
base_url = f"{self.api_base}/v1/{parent}/evaluatorsV2"
610610
headers = {
611611
"Authorization": f"Bearer {auth_token}",
612+
"x-api-key": f"{auth_token}",
612613
"Content-Type": "application/json",
613614
"X-Fireworks-Gateway-Secret": "8b8a823c-0b29-41f4-8537-4c9f650a113c",
614615
}
616+
615617
logger.info(f"Creating evaluator '{evaluator_id}' for account '{account_id}'...")
616618

617619
try:
618620
if force:
619621
check_url = f"{base_url}/{evaluator_id}"
620622
try:
623+
logger.info(f"check_url: {check_url}, headers: {headers}")
621624
check_response = requests.get(check_url, headers=headers)
622625
if check_response.status_code == 200:
623626
logger.info(f"Evaluator '{evaluator_id}' already exists, deleting and recreating...")
@@ -632,12 +635,15 @@ def create(self, evaluator_id, display_name=None, description=None, force=False)
632635
)
633636
except Exception as e_del:
634637
logger.warning(f"Error deleting evaluator: {str(e_del)}")
638+
logger.info(f"base_url: {base_url}, payload_data: {payload_data}, headers: {headers}")
635639
response = requests.post(base_url, json=payload_data, headers=headers)
636640
else:
641+
print(f"base_url: {base_url}, payload_data: {payload_data}, headers: {headers}")
637642
response = requests.post(base_url, json=payload_data, headers=headers)
638643
except requests.exceptions.RequestException:
639644
response = requests.post(base_url, json=payload_data, headers=headers)
640645
else:
646+
logger.info(f"check_url: {base_url}, headers: {headers}, payload_data: {payload_data}")
641647
response = requests.post(base_url, json=payload_data, headers=headers)
642648

643649
response.raise_for_status()

0 commit comments

Comments
 (0)