Metadata-Version: 2.4
Name: novelai-openclaw-adaptor
Version: 0.1.0
Summary: NovelAI shim and image CLI for OpenClaw-friendly usage.
Author: Open Source Contributors
License-Expression: MIT
Keywords: novelai,openclaw,openai,shim,cli
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: novelai-sdk
Dynamic: license-file

<h1 align="center">🎨 NovelAI OpenClaw Adaptor</h1>

<p align="center">
  A seamless shim to connect NovelAI's API to OpenClaw using the OpenAI format.
</p>

<p align="center">
  <strong>"Solving the core pain point of integrating NovelAI with OpenClaw by providing a simple, OpenAI-compatible local proxy."</strong>
</p>

<p align="center">
  <img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue" />
  <img alt="Python 3.10+" src="https://img.shields.io/badge/python-3.10%2B-brightgreen" />
</p>

<p align="center">
  <a href="#quick-start">Quick Start</a> ·
  <a href="#how-it-works">How It Works</a> ·
  <a href="./README.zh-CN.md">简体中文</a> ·
  <a href="./README.ja.md">日本語</a>
</p>

## Why NovelAI OpenClaw Adaptor? 🌟

The core pain point for many users is that **NovelAI's API cannot be directly integrated into OpenClaw**, as OpenClaw expects the standard OpenAI API format. 

To solve this, we created a shim (adaptor) that acts as a middleman. It translates OpenAI-formatted requests from OpenClaw into NovelAI-compatible requests, and returns the generated images seamlessly.

Additionally, it supports a simplified generation method: you can just pass your prompt directly to generate images without complex configurations!

<a id="quick-start"></a>

## Quick Start 🚀

📥 **Install:**

```bash
pip install novelai-openclaw-adaptor
```

⚙️ **Initialize config:**

```bash
novelai-config init
```

▶️ **Start the shim:**

```bash
novelai-shim
```

🖼️ **Generate an image:**

```bash
novelai-image --prompt "1girl, solo, masterpiece, best quality"
```

❓ **Help:**

```bash
novelai-config --help
novelai-shim --help
novelai-image --help
```

<a id="how-it-works"></a>

## How It Works ✨

1. **Local Proxy:** The adaptor runs locally and provides an OpenAI-compatible endpoint (e.g., `http://localhost:xxxx/v1`).
2. **Format Translation:** When OpenClaw sends an OpenAI-style request, the adaptor translates it into NovelAI's specific parameters.
3. **Simple Prompting:** You can simply pass the prompt string to generate images.
4. **Configuration:** In OpenClaw, set the `base_url` to your local adaptor address, for example `http://127.0.0.1:11434/v1`, and configure the model name as required.

## License 📄

This project is released under the `MIT` license.
