mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: Generate problem support for title variable (#2310)
This commit is contained in:
parent
a16968d6e5
commit
08c734b242
|
|
@ -29,7 +29,8 @@ def generate_problem_by_paragraph(paragraph, llm_model, prompt):
|
|||
try:
|
||||
ListenerManagement.update_status(QuerySet(Paragraph).filter(id=paragraph.id), TaskType.GENERATE_PROBLEM,
|
||||
State.STARTED)
|
||||
res = llm_model.invoke([HumanMessage(content=prompt.replace('{data}', paragraph.content))])
|
||||
res = llm_model.invoke(
|
||||
[HumanMessage(content=prompt.replace('{data}', paragraph.content).replace('{title}', paragraph.title))])
|
||||
if (res.content is None) or (len(res.content) == 0):
|
||||
return
|
||||
problems = res.content.split('\n')
|
||||
|
|
|
|||
Loading…
Reference in New Issue