Metadata-Version: 2.4
Name: textpy_llm
Version: 0.1.1
Summary: Agentic Ability in One Line
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: litellm==1.66.0

<p align="center">
  <picture>
    <img alt="TextPy" src="docs/TextPy.png" width=55%>
  </picture>
</p>

<p align="center">
| <a href="https://github.com/yezhengmao1/TextPy"><b>Documentation</b></a> | <a href="https://github.com/yezhengmao1/TextPy"><b>Blog</b></a> | <a href="https://github.com/yezhengmao1/TextPy"><b>Paper</b></a> |
</p>

# TextPy ── Agentic Ability in One Line


### 🚀 Core Philosophy
**Code as Natural Language Manifestation**  

```
Programming <-> Prompting
```


### ⚡ Revolutionary Features
- **Hybrid Execution**: Seamlessly blend LLM-generated code with legacy systems
- **Semantic Transpiler**: Just write function signatures, and our powerful `AIComipler` will auto-generate natural language instructions (`TextFunc`) or code generation instructions (`CodeFunc`) for your workflow
- **Self-Replication**: Extend the framework using our `@text` and `@code` decorators for easier support of recursive workflows


### 🛠️ Quick Start

```python
# examples/write_poem.py
from textpy import code, text

# the text/code will auto-generated by AICompiler(Just in Time)
@text
def generate_poem(*, theme: str, style: str) -> str: ...

@code
# text should in center of the SVG, use a white background, add visually striking elements
def create_svg_from_text_with_svgwrite(*, text: str) -> str: ...

@code
def save_svg_to_file(*, svg: str, path: str): ...

# execute this code
poem = generate_poem(theme="Quantum Physics and Romance", style="haiku")
svg = create_svg_from_text_with_svgwrite(text=poem)
save_svg_to_file(svg=svg, path="poem.svg")
```

```bash
pip install textpy-llm
# NOTE: set your api key, api url, and model like @code(api_key="", base_url="", model="")
# or using env, ref: litellm
python examples/write_poem.py
```

---

### 🗯️ Awesome Example
```bash
# this example will summary the paper
# and aswsome! to recursively read all references and summarize them, then generate a relationship diagram in HTML format
cd ./examples
DEEPSEEK_API=xxx ARXIV_ID=<xxxx.xxxx> ./arxiv_search.sh
```

### 📌 Join the Revolution
```bash
git clone https://github.com/yezhengmao1/TextPy
```

