A framework designed to produce long-texts with GPT or other large language models.
Project description
🦜🦜🦜 textlong
textlong 的目标是基于大语言模型提供结构化的长文本生成能力。
一、安装
安装textlong:
你可以使用 pip 安装:
pip install -U textlong
或者使用 poetry 安装:
poetry add textlong@latest
加载环境变量:
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv(), override=True)
二、创作长文当
Outline
创作提纲:
from textlong.md import Outline
from langchain_zhipu import ChatZhipuAI
ol = Outline(llm=ChatZhipuAI())
ol.write("请帮我创作500字的修仙小说,大女主设定,请给出主角的具体名字")
Detail
依据提纲扩写:
from textlong.md import Detail
detail = Detail(source=ol)
detail.write()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
textlong-0.2.2.tar.gz
(40.9 kB
view hashes)
Built Distribution
textlong-0.2.2-py3-none-any.whl
(52.9 kB
view hashes)