-
feat: set and get prompts for metrics (#1259)
发布于
2024-09-10 13:27:10 +00:00 from ragas.experimental.metrics._faithfulness import FaithfulnessExperimental, LongFormAnswerPrompt faithfulness = FaithfulnessExperimental() faithfulness.get_prompts() #{'long_form_answer_prompt': <ragas.experimental.metrics._faithfulness.LongFormAnswerPrompt at 0x7fd7baa8efb0>, #'nli_statement_prompt': <ragas.experimental.metrics._faithfulness.NLIStatementPrompt at 0x7fd7baa8f010>} long_form_prompt = LongFormAnswerPrompt() long_form_prompt.instruction = "my new instruction" prompts = {"long_form_answer_prompt":long_form_prompt} faithfulness.set_prompts(**prompts)
Co-authored-by: Jithin James jamesjithin97@gmail.com
下载附件