Contracts (the shared language): - percept / state / context / utterance / render / audio / capabilities - Capability model instead of vendor schemas (see below) Providers (capability-based abstraction): - LLM + Embedding: OpenAI-compatible shape IS the standard, adopted directly - ASR: internal contract is an event stream (partial -> final), because /v1/audio/transcriptions has no partial and dialogue needs it for endpointing. OpenAI adapter degrades to supports_partial=False. - TTS: internal contract carries tags/emotion/style, because /v1/audio/speech has no paralinguistics and [laughter]/[breath] are the core of feeling alive. Unsupported providers are stripped AND reported via Degradation -- silent degradation is forbidden. - Avatar: no de-facto standard, custom RenderCmd protocol driven by State. Core: - mood: dynamical system, slow variables, negativity bias (grudge), numbing after prolonged negativity - bazi: four pillars -> numeric vector; 'ming' is data, not prose - projection: phi, system event -> in-world statement; uncovered events are counted as projection gaps Storage: - SQLite schema, three memory layers, dyad ledger - accessibility floor 0.03 (not 0): forgettable but still there Config split: - models.yaml is the ONLY place model versions live - character.yaml holds world rules / emotion params, no version numbers 58 tests pass; ruff clean.
52 lines
1.2 KiB
TOML
52 lines
1.2 KiB
TOML
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "cybergril"
|
|
version = "0.1.0"
|
|
description = "A cyber companion with its own world — persistent state, three-layer memory, and a negotiable ontology."
|
|
readme = "README.md"
|
|
requires-python = ">=3.11"
|
|
license = { text = "UNLICENSED" }
|
|
|
|
# 依赖刻意保持极小。
|
|
# 所有模型能力都通过 HTTP 接口接入,不在项目里捆绑推理框架。
|
|
dependencies = [
|
|
"httpx>=0.27",
|
|
"pyyaml>=6.0",
|
|
"pydantic>=2.7",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8.0",
|
|
"pytest-asyncio>=0.23",
|
|
"ruff>=0.4",
|
|
"mypy>=1.10",
|
|
]
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/cybergril"]
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
testpaths = ["tests"]
|
|
pythonpath = ["src"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py311"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "UP", "B", "SIM"]
|
|
# UP042: 坚持用 (str, Enum) 而不是 StrEnum —— 前者的 JSON 序列化行为更可预期,
|
|
# 而且 str() 不会改变语义(避免把日志里的枚举名悄悄变成值)。
|
|
ignore = ["E501", "UP042"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.11"
|
|
warn_unused_ignores = true
|
|
warn_redundant_casts = true
|
|
disallow_untyped_defs = true
|