Skip to main content

aigc2md

PyPI-aigc2md

convert AIGC to hugo markdown, current only support OpenWebUI API 将 AIGC 生产的内容转化为 hugo markdown 格式,当前仅支持调用 OpenWebUI API

How to Use by Github Actions

    - name: convert AIGC to hugo markdown
      uses: x-actions/aigc2md@v1
      env:
        OPEN_WEBUI_JWT: "<JWT>"
        LOG_LEVEL: "DEBUG"

use as cli

$ pip install aigc2md

$ aigc2md --help
usage: aigc2md [--version] [--debug] <subcommand> ...

Command-line interface for convert AIGC to hugo markdown.

Positional arguments:
  <subcommand>
    chats          chats actions.
    render         render actions.
    users          list users.
    bash-completion
                   Prints all of the commands and options to stdout so that the aigc2md.bash_completion script
                   doesn't have to hard code them.
    help           Display help about this program or one of its subcommands.

Options:
  --version        show program's version number and exit
  --debug          Print debugging output.

See "aigc2md help COMMAND" for help on a specific command.

$ aigc2md users
+--------------------------------------+--------+---------------------+---------+------------------------------------------------+------------+----------------+
|                  ID                  |  name  |        email        |   role  |                     system                     | created_at | last_active_at |
+--------------------------------------+--------+---------------------+---------+------------------------------------------------+------------+----------------+
| a856afee-389e-4fc2-9431-dbac432912a1 | 谢先斌 |   me@xiexianbin.cn  |  admin  | 使用中文回答,除代码和专用名词外尽量不使用英文 | 2024-08-11 09:35:00 |   2024-08-11 09:35:00   |
+--------------------------------------+--------+---------------------+---------+------------------------------------------------+------------+----------------+

$ aigc2md chats
+--------------------------------------+---------------------------------+---------------------+---------------------+
|                  ID                  |              title              |      updated_at     |      created_at     |
+--------------------------------------+---------------------------------+---------------------+---------------------+
| ef0bdafc-045c-41eb-aba5-c841e31c2fd8 |          😊 简单问候语          | 2024-09-16 17:20:27 | 2024-09-16 17:20:19 |
+--------------------------------------+---------------------------------+---------------------+---------------------+

$ aigc2md render --id cab178a2-ba80-4008-a72d-1eb41c21e6c4
Lama3.1介绍一下 render to /Users/xiexianbin/workspace/code/github.com/x-actions/aigc2md-python/output/Lama3.1介绍一下.md ...

Dev and Test

  • local run
# create venv
python3 -m venv .venv
source .venv/bin/activate

# install
pip3 install -r requirements.txt

# set env
export OPEN_WEBUI_JWT="<JWT>"

# dev
export PYTHONPATH=$PYTHONPATH:$(pwd)
python3 aigc2md/shell.py --help
python3 aigc2md/shell.py help xxx
  • tests
python3 -m unittest aigc2md.tests.unit.test_http.HTTPTestCase.test_http_get

Metadata

Release files for aigc2md 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aigc2md 0.2.1
File Size Uploaded
aigc2md-0.2.1.tar.gz 20.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aigc2md 0.2.1
File Interpreter ABI Platform
aigc2md-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 46.8 kB

Release files / aigc2md-0.2.1.tar.gz

Download URL aigc2md-0.2.1.tar.gz
Size 20.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fb7f7603c21e25f1b34cc6b716b247ce48ad577fdc75d0eaa0ab7d7f855b1106
BLAKE2b-256 checksum
How to use checksums
d298b9d0d9e35c98916ed475148afcde569cd68e648d04006c0603f79e8db701
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / aigc2md-0.2.1-py3-none-any.whl

Download URL aigc2md-0.2.1-py3-none-any.whl
Size 25.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07b8f2fc2f9f6c898b85316977ff152693c130a0ce7bebe12fb57aa67d33b1c9
BLAKE2b-256 checksum
How to use checksums
404855b7230a5587cf19ae74ce2684a389e2a1f7d8b1a22dffcc707245088f61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page