Skip to content

Commit 3e1529c

Browse files
authored
Merge pull request #84 from dblock/try-it
Added a Try It section to README.
2 parents f295299 + 7ca831c commit 3e1529c

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,42 @@ steps:
7676
- Summarize the changes made to {{File.basename(file)}}.
7777
```
7878

79+
## Try it
80+
81+
If you don’t have one already, get an OpenAI key from [here](https://platform.openai.com/settings/organization/api-keys). You will need an account with a credit card, make sure that a basic completion works.
82+
83+
```bash
84+
export OPENAI_API_KEY=sk-proj-....
85+
86+
curl -H "Content-Type: application/json" \
87+
-H "Authorization: Bearer $API_TOKEN" \
88+
-d '{"model":"gpt-4.1-mini","messages":[{"role":"user","content":"What is 1+1?"}]}' \
89+
https://api.openai.com/v1/chat/completions
90+
```
91+
92+
The [test grading workflow](examples/grading/workflow.md) in this repository is a senior software engineer and testing expert that evaluates the quality of a test based on guidelines.
93+
94+
Try the workflow.
95+
96+
```bash
97+
./exe/roast execute examples/grading/workflow.yml test/roast/resources_test.rb
98+
99+
🔥🔥🔥 Everyone loves a good roast 🔥🔥🔥
100+
...
101+
```
102+
103+
This will output a test grade.
104+
105+
```
106+
========== TEST GRADE REPORT ==========
107+
Test file: test/roast/resources_test.rb
108+
109+
FINAL GRADE:
110+
Score: 80/100
111+
Letter Grade: B
112+
```
113+
Note that you may also need `shadowenv` and `rg`, on MacOS run `brew install shadowenv` and `brew install rg`.
114+
79115
## How to use Roast
80116
81117
1. Create a workflow YAML file defining your steps and tools

examples/grading/workflow.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Test Grading
2-
model: anthropic:claude-opus-4
2+
api_token: $(echo $OPENAI_API_KEY)
3+
# model: anthropic:claude-opus-4
4+
model: gpt-4.1-mini
35

46
tools:
57
- Roast::Tools::Grep
@@ -23,16 +25,16 @@ steps:
2325

2426
# set non-default attributes for steps below
2527
analyze_coverage:
26-
model: gpt-4.1-mini
28+
# model: gpt-4.1-mini
2729
auto_loop: false
2830
json: true
2931

3032
generate_grades:
31-
model: o3
33+
# model: o3
3234
json: true
3335

3436
generate_recommendations:
35-
model: o3
37+
# model: o3
3638
auto_loop: false
3739
json: true
3840
params:

0 commit comments

Comments
 (0)