Skip to content

本项目用于调用LLM进行小说写作 This project is used to write novels with LLM

License

Notifications You must be signed in to change notification settings

Willian7004/LLM-novel-writer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM-novel-writer

本项目用于调用LLM进行小说写作 This project is used to write novels with LLM 本项目用于调用LLM快速创作小说,并采用了参考前后文段等措施确保内容衔接。开始时考虑用longwriter模型一次完成一章内容,但由于目前的longwriter模型无法确保格式一致,就仍然推荐使用逻辑和写作能力更好的模型。本人使用Deepseek v2.5对本程序进行辅助编写和测试。对话过程位于与模块同名的txt文件,提示词上相比本人之前的项目进行了一些调整,采用可复用的注意事项部分对步骤部分的提示词进行精简并确保严谨性。 api.py 用于调用LLM并包含提示词内容,需要填入自己用的模型的api域名和api key。api_en.py 则包含英文提示词 以下模块文件名为中文的用于调用api.py的函数,文件名为英文的用于调用api_en.py中的对应函数,需要按顺序运行。在release中的文件只包含对应语言的版本。 总体设定、章节概要、标题.py 用于根据输入的概要确定小说的总体设定、每个章节的概要和小说标题,运行后输入概要并空一格输入章节数。程序依次生成上述三项内容,每项内容生成后可以输入y继续或输入修改意见进行修改。实际测试时有时候章节概要会出现重复,直接修改可能作用不大,需要重新运行。 章节提纲、标题.py 用于生成各章的提纲和标题,使用多线程提高生成速度。目前版本的这一项功能有bug,导致开头两章和最后两章的内容重复,但检查不出具体问题。 各章正文.py 用于生成各章节的正文,只根据提纲和当前章节前面的内容生成以使用多线程提高生成速度。 合成.py 用于合成前面几个模块生成的内容,保存到当前目录以标题命名的txt文件。

This project was used to call on LLM to quickly create a novel, and measures such as referencing the preceding and following paragraphs were used to ensure that the content was coherent. At the beginning, we considered using the longwriter model to complete one chapter at a time, but since the current longwriter model does not ensure consistent formatting, we still recommend the use of models with better logic and writing skills. I used Deepseek v2.5 to assist in the writing and testing of this procedure. The dialogue process is located in a txt file with the same name as the module, and the prompts have been adjusted compared to my previous project, using reusable notes to streamline the prompts in the step-by-step section and to ensure rigour. api.py is used to call LLM and contains prompt words, you need to fill in the api domain name and api key of your own model. api_en.py contains English prompt words The following modules are used to call the functions in api.py if the file name is in Chinese, and to call the corresponding functions in api_en.py if the file name is in English, and you need to run them sequentially. The files in release contain only the version of the corresponding language. General setting, chapter summary, title.py is used to determine the general setting of the novel, the summary of each chapter, and the title of the novel based on the input summary, after running, input the summary and enter the number of chapters in a blank space. The programme generates the above three items in turn, and after each item is generated, you can input y to continue or input modifications to modify it. The actual test sometimes chapter outline will be duplicated, direct modification may not be very useful, you need to re-run. Chapter outline, title.py is used to generate the outline and title of each chapter, using multi-threaded to improve the generation speed. The current version of this function has a bug, resulting in the beginning two chapters and the last two chapters of the content of the duplication, but check the specific problem. Chapter body.py is used to generate the body of each chapter, based only on the outline and the content in front of the current chapter to use multi-threading to improve the speed of generation. Compose.py is used to synthesise the content generated by the previous modules and save it to a txt file named with the title in the current directory.

About

本项目用于调用LLM进行小说写作 This project is used to write novels with LLM

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages