Skip to content

Commit f9344de

Browse files
committed
fixing example
1 parent 98864fc commit f9344de

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

.github/workflows/rollout.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ jobs:
3434

3535
- name: Install dependencies
3636
run: |
37-
python -m pip install --upgrade pip
38-
pip install -e .
37+
pip install openai
3938
4039
- name: Run rollout script
4140
env:
4241
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
4342
run: |
44-
python tests/github_actions/rollout_worker.py \
43+
python rollout_worker.py \
4544
--completion-params '${{ inputs.completion_params }}' \
4645
--metadata '${{ inputs.metadata }}' \
47-
--model-base-url "${{ inputs.model_base_url }}"
46+
--model-base-url "${{ inputs.model_base_url }}" \
47+
--api-key "${{ secrets.FIREWORKS_API_KEY }}"

tests/github_actions/quickstart.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,15 @@ async def test_github_actions_quickstart(row: EvaluationRow) -> EvaluationRow:
5151
- fetch traces from Fireworks tracing proxy (uses default FireworksTracingAdapter)
5252
- FAIL if no traces found or rollout_id missing
5353
"""
54-
assert row.messages[0].content == "What is the capital of France?", "Row should have correct message content"
54+
# This dataset is built into github_actions/rollout_worker.py
55+
if row.messages[0].content == "What is the capital of France?":
56+
assert row.input_metadata.row_id == "0"
57+
elif row.messages[0].content == "What is the capital of Germany?":
58+
assert row.input_metadata.row_id == "1"
59+
elif row.messages[0].content == "What is the capital of Italy?":
60+
assert row.input_metadata.row_id == "2"
61+
else:
62+
assert False, "Row should have correct message content"
5563
assert len(row.messages) > 1, "Row should have a response. If this fails, we fell back to the original row."
56-
assert row.execution_metadata.rollout_id, "Row should have a rollout_id from the GitHub Actions rollout"
5764

5865
return row

tests/github_actions/rollout_worker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def main():
2020
parser.add_argument("--completion-params", required=True, help="JSON completion params (includes model)")
2121
parser.add_argument("--metadata", required=True, help="JSON serialized metadata object")
2222
parser.add_argument("--model-base-url", required=True, help="Base URL for the model API")
23+
parser.add_argument("--api-key", required=True, help="API key for the model API")
2324

2425
args = parser.parse_args()
2526

@@ -44,6 +45,8 @@ def main():
4445
rollout_id = metadata["rollout_id"]
4546
row_id = metadata["row_id"]
4647

48+
api_key = args.api_key
49+
4750
print(f"🚀 Starting rollout {rollout_id}")
4851
print(f" Model: {model}")
4952
print(f" Row ID: {row_id}")
@@ -63,7 +66,7 @@ def main():
6366
# Build completion kwargs from completion_params
6467
completion_kwargs = {"messages": messages, **completion_params}
6568

66-
client = OpenAI(base_url=args.model_base_url, api_key=os.environ.get("FIREWORKS_API_KEY"))
69+
client = OpenAI(base_url=args.model_base_url, api_key=api_key)
6770

6871
print("📡 Calling OpenAI completion...")
6972
print(f" Completion kwargs: {completion_kwargs}")

0 commit comments

Comments
 (0)