A Python library for building chatbots and conversational applications
Project description
Chainthon
Chainthon is a Python library for building chatbots. It provides a simple interface for building chatbots using natural language processing (NLP) and Large Language Models (LLMs).
uv 使用方式
# 项目构建
uv init chainthon
# cd chainthon
# uv add ruff # 添加依赖包
# uv run ruff check # 检查依赖包
工具管理
uv 执行并安装 Python 包提供的命令行工具, 类似于 pipx, 可以是uvx (uv tool run)在临时环境中运行工具。
uvx pocowsay "hello world" # 运行 pocowsay 工具
使用uv tool install安装工具:
uv tool install ruff # 安装 ruff 工具
使用uv tool run运行工具:
uv tool run ruff check # 运行 ruff check 命令
Python 管理
uv 安装 Python 并允许在版本之间快速切换。 安装多个Python版本:
uv python install 3.10 3.11 3.12
根据需要下载Python版本:
uv venv --python 3.12.0
uv run --python pypy@3.8 -- python
使用当前目录中的特定Python版本:
uv python pin pypy@3.11
pip 接口
将需求编译成与平台无关的需求文件:
uv pip compile docs/requirements.in \
--universal \
--output-file docs/requirements.txt
创建虚拟环境:
uv venv
安装锁定要求:
uv pip sync docs/requirements.txt
安装和管理 Python 本身。
uv python install :安装Python版本。 uv python list :查看可用的Python版本。 uv python find :查找已安装的Python版本。 uv python pin :固定当前项目以使用特定的 Python 版本。 uv python uninstall :卸载Python版本。
脚本
uv run example.py # 运行脚本
uv add --script example.py # 向脚本添加依赖项
uv remove --script example.py # :从脚本中删除依赖项
项目
创建并处理 Python 项目,即使用pyproject.toml 。
uv init :创建一个新的Python项目。
uv add :向项目添加依赖项。
uv remove :从项目中删除依赖项。
uv sync :将项目的依赖项与环境同步。
uv lock :为项目的依赖项创建一个锁定文件。
uv run :在项目环境中运行命令。
uv tree :查看项目的依赖关系树。
uv build :将项目构建到分发档案中。
uv publish :将项目发布到包索引。
工具
运行并安装发布到 Python 包索引的工具,例如ruff或black 。
uvx / uv tool run :在临时环境中运行工具。
uv tool install :在用户范围内安装工具。
uv tool uninstall :卸载工具。
uv tool list :列出已安装的工具。
uv tool update-shell :更新 shell 以包含工具可执行文件。
pip接口
手动管理环境和包 - 旨在用于遗留工作流程或高级命令无法提供足够控制的情况。
uv venv :创建一个新的虚拟环境。
uv pip install :将软件包安装到当前环境中。
uv pip show :显示有关已安装软件包的详细信息。
uv pip freeze :列出已安装的软件包及其版本。
uv pip check :检查当前环境是否有兼容的包。
uv pip list :列出已安装的软件包。
uv pip uninstall :卸载软件包。
uv pip tree :查看环境的依赖关系树。
uv pip compile :将需求编译到锁定文件中。
uv pip sync :将环境与锁定文件同步。
Utility
uv cache clean :删除缓存条目。
uv cache prune :删除过时的缓存条目。
uv cache dir :显示uv缓存目录路径。
uv tool dir : 显示uv工具目录路径。
uv python dir :显示 uv 安装的 Python 版本路径。
uv self update :将uv更新到最新版本。
uv --help
uv init --help
uv version
项目创建
uv 支持管理 Python 项目,这些项目在pyproject.toml文件中定义其依赖项。
uv init hello-world
cd hello-world
或者
mkdir hello-world
cd hello-world
uv init
可以在容器里使用,后续更新。
版本
v0.1.0
- 支持uv init创建项目
- 支持uv add添加依赖项
- 支持uv remove删除依赖项
- 初始版本
v0.1.1
- 添加异步事件嵌套
v0.1.2
- 添加click的命令行界面
- 添加测试用例
代码检查
ruff check .
mypy src/chainthon
Project details
Release history Release notifications | RSS feed
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 chainthon-0.1.2.tar.gz.
File metadata
- Download URL: chainthon-0.1.2.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f67adb5292643c5df46b5d58ebd77b9b007976e9bc0a7e3423014cfb14c87e9f
|
|
| MD5 |
967d4f7194184ab3b713abb4b4ffd15f
|
|
| BLAKE2b-256 |
75d6696d9321654a4af27cee4b2758b200c9536fb22cc55968429d0fe9a2ef53
|
File details
Details for the file chainthon-0.1.2-py3-none-any.whl.
File metadata
- Download URL: chainthon-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbe97162574024ed901eb354866e643ceff7b400c1517537671ad2b80fcdf0ed
|
|
| MD5 |
c6c787f4019136db639a008d66c9b1a6
|
|
| BLAKE2b-256 |
eec916bf3d64e6e5d65633869695f217bf2399d41e613bbd632e7b4d21565978
|