Skip to main content

A framework designed to produce long-texts with GPT or other large language models.

Project description

🦜🦜🦜 textlong

PyPI version

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)

二、长文本创作:根据提纲扩写

创作提纲:

from textlong import Writing
from langchain_zhipu import ChatZhipuAI

w = Writing(llm=ChatZhipuAI())
w.outline("请帮我创作500字的修仙小说,大女主设定,请给出主角的具体名字")

根据提纲扩写:

w.save_as_ref()
w.detail()
print(w.markdown)

Project details


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.4.tar.gz (41.7 kB view hashes)

Uploaded Source

Built Distribution

textlong-0.2.4-py3-none-any.whl (56.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page