Skip to content

Commit 08c734b

Browse files
authored
feat: Generate problem support for title variable (#2310)
1 parent a16968d commit 08c734b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/dataset/task/generate.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def generate_problem_by_paragraph(paragraph, llm_model, prompt):
2929
try:
3030
ListenerManagement.update_status(QuerySet(Paragraph).filter(id=paragraph.id), TaskType.GENERATE_PROBLEM,
3131
State.STARTED)
32-
res = llm_model.invoke([HumanMessage(content=prompt.replace('{data}', paragraph.content))])
32+
res = llm_model.invoke(
33+
[HumanMessage(content=prompt.replace('{data}', paragraph.content).replace('{title}', paragraph.title))])
3334
if (res.content is None) or (len(res.content) == 0):
3435
return
3536
problems = res.content.split('\n')

0 commit comments

Comments
 (0)