TextPy: Collaborative Agent Workflow through Programming and Prompting
Project description
TextPy ── Collaborative Agent Workflow through Programming and Prompting
🚀 Core Philosophy
P1: Workflow = Programming + Prompting
P2: Programming <-> Prompting
P3: Workflow = Function Signature with Comment
⚡ Revolutionary Features
- Mixed-Execution: Seamlessly integrates with legacy code
- AICompiler: Just write function signatures -- our powerful compiler will automatically generate natural language instructions or code instructions just in time
- Self-Replication: Easier implementation of recursive workflows
🔧 Usage
Installation
Install via pip:
$ pip install textpy-llm
Import in your Python script:
import textpy
Or use our Docker image:
$ docker pull ghcr.io/yezhengmao1/textpy:latest
👾 Quick Start - Amazing Example - Daily arXiv
Example: Automatically fetch daily updates from arXiv, filter papers by topic, translate abstracts into Chinese, store them in a database, and generate a markdown file to display the abstracts.
😊Real-world Use Case: I personally use TextPy to periodically push these generated markdown files to my blog when new papers are available.
Browse the results at: Daily arXiv
Highlight: You only need to define the functions and use them in your workflow. Our powerful AICompiler recognizes their purpose, automatically generating and executing the necessary code or creating prompts for large language model interaction.
see examples/daily_arxiv.py for the complete implementation.
@code
def get_the_rss_xml_file_str(*, url: str) -> str: ...
@code(pypi=[get_the_rss_xml_file_str(url=ARXIV_URL)])
def get_all_item_in_the_rss_file(*, xml_file_str: str) -> list[dict]: ...
@text
def check_topic_is_satisfactory(*, abstrct: str, topic: str) -> bool: ...
@text
def translate_the_en_abstract_to_zh(*, abstract: str) -> str: ...
@code
def check_link_in_db(*, db_path: str, link: str) -> bool: ...
@code
def save_article_to_db(*, db_path: str, item: dict): ...
# These functions only need to be defined...
🤩 Quick Start - Awesome Example - Deep Paper
Example: Download PDFs from arXiv using their IDs, extract text, generate summaries, and recursively process all cited references. The system visualizes the relationships between papers in an interactive HTML file.
Highlight: All functions in the workflow is generated by TextPy's AICompiler, including installation and usage of external Python packages. Your only responsibility is writing function signatures with clear comments, and the workflow!
NOTE: We strongly recommend running this script in a container since the AICompiler manipulates the external environment during compilation.
To run with Docker:
cd ./examples
DEEPSEEK_API=xxx CACHE_DIR="/workspace/.cache" ARXIV_ID=<xxxx.xxxx> ./arxiv_search.sh
See It In Action:
📌 Contributing
Community contributions are more than welcome, whether it be to fix bugs or to add new features at github.
📜 Citation
@misc{ye2025textpy,
author = {Zhengmao Ye, Shuyun Yang, Zelong Huang, Jie Zuo, Mingjie Tang},
title = {TextPy: Collaborative Agent Workflow through Programming and Prompting},
year = {2025},
howpublished = {\url{https://github.com/yezhengmao1/TextPy}}
}
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file textpy_llm-0.1.4.tar.gz.
File metadata
- Download URL: textpy_llm-0.1.4.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a43f0ce73ed2e8af794d280fc3e4eb9e0f4be7270cad61578b63af13164baa69
|
|
| MD5 |
840d7bc3c010487565bde8aa504ecab5
|
|
| BLAKE2b-256 |
584f67d65bd9040593fd06073ee363c1e305d52fb9614eb8df4f14e94ccb8a4c
|
Provenance
The following attestation bundles were made for textpy_llm-0.1.4.tar.gz:
Publisher:
python-publish.yml on yezhengmao1/TextPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
textpy_llm-0.1.4.tar.gz -
Subject digest:
a43f0ce73ed2e8af794d280fc3e4eb9e0f4be7270cad61578b63af13164baa69 - Sigstore transparency entry: 205603183
- Sigstore integration time:
-
Permalink:
yezhengmao1/TextPy@fa65992e60123981a08ca0f8de48344c143ed24f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/yezhengmao1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fa65992e60123981a08ca0f8de48344c143ed24f -
Trigger Event:
push
-
Statement type:
File details
Details for the file textpy_llm-0.1.4-py3-none-any.whl.
File metadata
- Download URL: textpy_llm-0.1.4-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8ab22426d45976cb85b62f88a176df57df59f747e297f2dedeb987a62959cab
|
|
| MD5 |
367ebbaddfd217957dc6c4fc549d3f2a
|
|
| BLAKE2b-256 |
0cfda2470cb1c64adb5cd0429ba75a1d9c044cc324df181171aca08bb2fa9d99
|
Provenance
The following attestation bundles were made for textpy_llm-0.1.4-py3-none-any.whl:
Publisher:
python-publish.yml on yezhengmao1/TextPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
textpy_llm-0.1.4-py3-none-any.whl -
Subject digest:
f8ab22426d45976cb85b62f88a176df57df59f747e297f2dedeb987a62959cab - Sigstore transparency entry: 205603186
- Sigstore integration time:
-
Permalink:
yezhengmao1/TextPy@fa65992e60123981a08ca0f8de48344c143ed24f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/yezhengmao1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fa65992e60123981a08ca0f8de48344c143ed24f -
Trigger Event:
push
-
Statement type: