Skip to content

Commit 18f89c2

Browse files
committed
add cookbooks
1 parent 008139a commit 18f89c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

parea/cookbook/evals_and_experiments/deployed_prompt_and_dataset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
def eval_fun(log: Log) -> EvaluationResult:
1717
# access the output and target from the log
1818
# output, target = log.output, log.target
19-
response_text: str = call_openai(
19+
response: str = call_openai(
2020
model="gpt-4o",
21-
messages=[{"role": "system", "content": "Use JSON. provide a score and reason."}], # CHANGE THIS
21+
messages=[{"role": "system", "content": "Use JSON. provide a score and reason."}], # <- CHANGE THIS
2222
response_format={"type": "json_object"},
2323
temperature=0.0,
2424
)
25-
response = json.loads(response_text)
26-
return EvaluationResult(name="YOUR_EVAL_NAME", score=response["score"], reason=response["reason"])
25+
response_dict = json.loads(response)
26+
return EvaluationResult(name="YOUR_EVAL_NAME", score=response_dict["score"], reason=response_dict["reason"])
2727

2828

2929
@trace(eval_funcs=[eval_fun])

0 commit comments

Comments
 (0)