|
|
@@ -77,9 +77,15 @@ export class PaperService implements OnModuleInit {
|
|
|
this.genPaper(order)
|
|
|
}
|
|
|
|
|
|
- async genChapters(major: string, title: string, description: string) {
|
|
|
+ async genChapters(id: number, description: string) {
|
|
|
+ const order = await this.findOrderById(id)
|
|
|
const tools = createLLM('gpt-3.5-turbo')
|
|
|
- const chapters = await genChapters(tools, major, title, description)
|
|
|
+ const chapters = await genChapters(tools, order.major, order.title, description)
|
|
|
+
|
|
|
+ order.chapters = chapters
|
|
|
+ order.description = description
|
|
|
+ await this.paperOrderRepository.save(order)
|
|
|
+
|
|
|
return chapters
|
|
|
}
|
|
|
|