Skip to content

Commit

Permalink
default eval to true, add app insights queries (#158)
Browse files Browse the repository at this point in the history
* default eval to true, add app insights queries

* update queries
  • Loading branch information
cassiebreviu authored Sep 3, 2024
1 parent aec8730 commit e7ca6da
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/api/evaluate/evaluate_queries.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
dependencies
| where name == "run_evaluators"
| project timestamp, results = parse_json(tostring(customDimensions["output"]))
| evaluate bag_unpack(results)
| summarize avg_groundedness=avg(gpt_groundedness), avg_coherence=avg(gpt_coherence), avg_fluency=avg(gpt_fluency), avg_relevance=avg(gpt_relevance) by bin(timestamp, 2h)
| render timechart


dependencies
| where name == "run_evaluators"
| project timestamp, results = parse_json(tostring(customDimensions["output"]))
| evaluate bag_unpack(results)
| summarize avg_groundedness=avg(gpt_groundedness), avg_coherence=avg(gpt_coherence), avg_fluency=avg(gpt_fluency), avg_relevance=avg(gpt_relevance)
| render barchart


dependencies
| extend
total_tokens = toint(customDimensions["inputs.data.usage.total_tokens"]),
prompt_tokens = toint(customDimensions["inputs.data.usage.prompt_tokens"]),
completion_tokens = toint(customDimensions["inputs.data.usage.completion_tokens"])
| summarize sum(total_tokens), sum(prompt_tokens), sum(completion_tokens) by bin(timestamp, 5m)
| render timechart
3 changes: 2 additions & 1 deletion src/api/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def send_writer(full_result):
return json.dumps(("writer", full_result))

@trace
def create(research_context, product_context, assignment_context, evaluate=False):
def create(research_context, product_context, assignment_context, evaluate=True):

feedback = "No Feedback"

Expand Down Expand Up @@ -136,6 +136,7 @@ def create(research_context, product_context, assignment_context, evaluate=False
yield send_writer(full_result)

if evaluate:
print("Evaluating article...")
evaluate_article_in_background(
research_context=research_context,
product_context=product_context,
Expand Down

0 comments on commit e7ca6da

Please sign in to comment.