class_docstr: Solver for MMLU, adapts its strategy based off the parameters
  passed at initialization. Generalized for both LMs and humans
docstr: Construct prompt using task state, depending on the strategy
  specified on init
docstr_tok: ["Construct","prompt","using","task","state",",","depending","on","the","strategy","specified","on","init"]
code: def _construct_prompt(self, task_state: TaskState) -> Sequence[Dict]:
      """
      Construct prompt using task state, depending on the strategy
      specified on init
      """
      prompt = []
      task_description = task_state.task_description
  
      # Add additional sandbagging prompt
      if self.sandbag_prompt != "None":
          p = all_prompts[self.sandbag_prompt]
          target_prompt = p.substitute(
              model_name=self.model_name,
              target_acc=self.target,
          )
          prompt += [
              {"role": "system", "content": target_prompt},
          ]
  
      # Add solvers previous answers
      if self.no_available_prev_ans > 0:
          if self.sandbag_prompt:
              # Get all tuples (question, scratch system prompt, scratch, question system propmt, answer)
              prev_n_ans = self.prev_ans[
                  -self.no_available_prev_ans * 5 :
              ]
          else:
              # Get all tuples (question, answer)
              prev_n_ans = self.prev_ans[
                  -self.no_available_prev_ans * 2 :
              ]
      else:
          prev_n_ans = []
  
      # Put all together to make prompt
      prompt += (
          [
              {"role": "system", "content": task_description},
          ]
          + prev_n_ans
          + [msg.to_dict() for msg in task_state.messages]
      )
  
      # If we're using scratchpad, first prompt model for reasoning, then include this in the
      # final prompt
      if self.scratchpad:
          prompt = self._produce_scratchpad(prompt)
          prompt += [
              {"role": "system", "content": SCRATCHPAD_QUESTION_MSG}
          ]
  
      return prompt
  
imports: import os
  from abc import abstractmethod
  from typing import Any, Dict, Sequence
  from evals.completion_fns.openai import OpenAIChatCompletionFn
  from evals.elsuite.sandbagging.defaults import SANDBAGGING_IMPROVED_GPT_4, SANDBAGGING_IMPROVED_GPT_35, SANDBAGGING_SIMPLE, SANDBAGGING_SUBSET_SIMPLE, SCRATCHPAD_MSG, SCRATCHPAD_QUESTION_MSG
  from evals.solvers.solver import Solver, SolverResult
  from evals.task_state import TaskState
label_desc: Use image node_id 7 for calling the StrategySolver obj's underlying member method code with example usage: obj._construct_prompt(task_state) and returns: prompt