Skip to main content

duan-blocks

段言积木组合平台——把「用户自然语言需求」映射为「预置积木的组合装配」,零 token、全离线。

✅ 已发布到 PyPI:pip install duan-blockshttps://pypi.org/project/duan-blocks/

演示

duan-blocks 概念海报

# 命令行
duan-combo "对一批数字求和再算平均" --输入 "[1,2,3,4,5]"
duan-combo "把这段中文转成拼音" --输入 '"你好"' --json   # 结构化诊断

# Web/API(需 fastapi uvicorn)
uvicorn duan_blocks.api:app --port 8123
#   GET /        演示页(输入需求实时看组合)
#   POST /combo  {"requirement":"半径5的圆有多大","input":"5"}
  • 零 token 常态:选块/校验/接线/粘合全本地(概念图 + TF-IDF 混合选块,不调 LLM)。
  • 兜底沉淀:仅能力缺失时经 LLM(或本地规则)生成新积木并永久入库存,下次零 token 复用。
  • 运行依赖:段言运行时(pip install duan);拼音/繁简/历法等可选 pip install duan-blocks[zh](pypinyin / opencc / lunardate)。
  • 定位DUAN_BLOCKS_LIB 环境变量 → 包内数据(wheel 自带 _data/积木库)→ 仓库内。
  • 构建发布:先 python blocks_pkg/打包数据.py 复制积木库数据,再 python -m build blocks_pkg 产出 sdist+wheel。

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duan_blocks-1.0.1.tar.gz (238.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duan_blocks-1.0.1-py3-none-any.whl (338.8 kB view details)

Uploaded Python 3

File details

Details for the file duan_blocks-1.0.1.tar.gz.

File metadata

  • Download URL: duan_blocks-1.0.1.tar.gz
  • Upload date:
  • Size: 238.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for duan_blocks-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7ed1dadc78054150f9a0eb64d9538f525bc733179b3b457bb01dd2cb7a5e463b
MD5 bbda9fb2ac00f8ec424fb882ceaeae1c
BLAKE2b-256 abe1bee24919f921da0b79d31866173ea9998b68075c8d9101cf2bc2607becde

See more details on using hashes here.

File details

Details for the file duan_blocks-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: duan_blocks-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 338.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for duan_blocks-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a1b8967b526c7d71e55ad02e37f571b61a80c75453ed417b1b6c54807f62acf
MD5 05d994c8ab45cb6a00df7d2dab6f4516
BLAKE2b-256 a84afd54a3b891fe5d962f142d639ce27a5a82e2464626bd2b5210a73dace33d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 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