If you already have a dataset of requests and application responses, and you want to log and evaluate these on Galileo without re-generating the responses, you can do so via our worflows.
First, log in to Galileo:
Copy
Ask AI
import promptquality as pqpq.login()
Now you can take your previously generated data and log it to Galileo.
# Your previously generated requests & responsesdata = [ { 'request': 'What\'s the capital of United States?', 'response': 'Washington D.C.', 'context': 'Washington D.C. is the capital of United States' }, { 'request': 'What\'s the capital of France?', 'response': 'Paris', 'context': 'Paris is the capital of France' }]metrics = [pq.Scorers.context_adherence_plus, pq.Scorers.prompt_injection]evaluate_run = EvaluateRun(run_name="my_run", project_name="my_project", scorers=metrics)for row in data: template = "Given the following context answer the question. \n Context: {context} \n Question: {question}" wf = evaluate_run.add_workflow(input=row["request"], output=row["response"]) wf.add_llm( input=template.format(context=row['context'], question=row["request"]), output=row["response"], model=pq.Models.chat_gpt, )
Finally, log your Evaluate run to Galileo:
Copy
Ask AI
evaluate_run.finish()
Once complete, this step will display the link to access the run from your Galileo Console.