File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,18 +10,23 @@ def perform(answer_id)
1010 end
1111 return if quota_limit_reached?
1212
13- result = AutoEvaluation ::TopicTagger . call ( answer . question_used )
13+ if Rails . configuration . answer_strategy == "non_llm_answer"
14+ # Temporary strategy for SREs to load test without incurring LLM costs
15+ sleep 10
16+ else
17+ result = AutoEvaluation ::TopicTagger . call ( answer . question_used )
1418
15- topics = answer . build_topics (
16- status : result . status ,
17- primary_topic : result . primary_topic ,
18- secondary_topic : result . secondary_topic ,
19- error_message : result . error_message ,
20- )
21- topics . assign_metrics ( "topic_tagger" , result . metrics )
22- topics . assign_llm_response ( "topic_tagger" , result . llm_response )
19+ topics = answer . build_topics (
20+ status : result . status ,
21+ primary_topic : result . primary_topic ,
22+ secondary_topic : result . secondary_topic ,
23+ error_message : result . error_message ,
24+ )
25+ topics . assign_metrics ( "topic_tagger" , result . metrics )
26+ topics . assign_llm_response ( "topic_tagger" , result . llm_response )
2327
24- topics . save!
28+ topics . save!
29+ end
2530 end
2631 end
2732end
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ class Application < Rails::Application
8585
8686 config . bigquery_dataset_id = ENV [ "BIGQUERY_DATASET" ]
8787
88- config . answer_strategy = ENV . fetch ( "ANSWER_STRATEGY" , "claude_structured_answer" )
88+ config . answer_strategy = "non_llm_answer"
8989
9090 config . question_topics = GovukChatPrivate . config
9191 . llm_prompts
Original file line number Diff line number Diff line change @@ -45,6 +45,14 @@ def compose_answer
4545 Pipeline ::StructuredAnswerComposer ,
4646 Pipeline ::AnswerGuardrails ,
4747 ] )
48+ when "non_llm_answer"
49+ # Temporary strategy for SREs to load test without incurring LLM costs
50+ sleep 20
51+ context = Pipeline ::Context . new ( question )
52+ context . abort_pipeline (
53+ message : Answer ::CannedResponses ::LLM_CANNOT_ANSWER_MESSAGE ,
54+ status : "answered" ,
55+ )
4856 else
4957 raise "Answer strategy #{ answer_strategy } not configured"
5058 end
You can’t perform that action at this time.
0 commit comments