langtest.transform.utils.TargetLLM#
- class TargetLLM(client, model='gpt-4o-mini')#
Bases:
object
- __init__(client, model='gpt-4o-mini')#
Methods
__init__
(client[, model])build_reasoning_prompt
(problem_text)Constructs the initial prompt with chain-of-thought reasoning instructions.
process_user_text
(problem_text)Given the clinical problem text provided by the user, this method sequentially queries the LLM to generate the chain-of-thought (reasoning), confidence scores for each option, and the final answer.
send_message
(prompt)Adds the prompt as a user message, sends it to the LLM, and stores the assistant's reply.
- static build_reasoning_prompt(problem_text: str) str #
Constructs the initial prompt with chain-of-thought reasoning instructions.
- process_user_text(problem_text: str) dict #
Given the clinical problem text provided by the user, this method sequentially queries the LLM to generate the chain-of-thought (reasoning), confidence scores for each option, and the final answer. Returns a dictionary with keys: ‘reasoning’, ‘confidence_scores’, and ‘final_answer’.
- send_message(prompt: str) str #
Adds the prompt as a user message, sends it to the LLM, and stores the assistant’s reply. Returns the assistant’s response.