Skip to main content

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

Project description

🦜🦜🦜 textlong

PyPI version

textlong 的目标是基于大语言模型提供结构化的长文本生成能力。

一、安装

你可以使用 pip 安装:

pip install -U textlong

或者使用 poetry 安装:

poetry add textlong@latest

二、结构化长文生成能力

textlong 中提供如下结构化长文档的创作模式:

  • 一键直出:输入写作要求后,由AI直接创作
  • (其他模式正在研发中,请参考路线图

使用示例:

import os
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv(), override=True)

from textlong import WritingTask

# 使用默认的智谱AI推理
t = WritingTask()
t.auto_write("task 给好基友写一封信, 1800字,分4段就行")

之后你可以查看生成的成果:

# 查看创作大纲
t.invoke("outlines")['reply']
# 查看文本
t.invoke("texts")['reply']

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

Uploaded Source

Built Distribution

textlong-0.1.3-py3-none-any.whl (36.0 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