added RAG, Multiuser, TG bot

This commit is contained in:
2026-06-14 06:26:16 +00:00
parent c8a9429bed
commit 0c8ab6018a
24 changed files with 1280 additions and 479 deletions
+25
View File
@@ -0,0 +1,25 @@
from app.homelab.anima_prompt import (
build_draw_self_prompt,
build_scene_tags_prompt,
looks_like_booru_tags,
)
def test_build_draw_self_prompt_includes_appearance():
bundle = build_draw_self_prompt("silver_hair, wolf_ears, blue_eyes")
assert "silver_hair" in bundle.positive
assert "wolf_ears" in bundle.positive
assert "looking_at_viewer" in bundle.positive
assert "POV:" not in bundle.positive
assert ". " not in bundle.positive
assert "worst quality" in bundle.negative
def test_build_draw_self_prompt_lora():
bundle = build_draw_self_prompt("1girl", lora_name="rin_lora", lora_weight=0.75)
assert "<lora:rin_lora:0.75>" in bundle.positive
def test_looks_like_booru_tags():
assert looks_like_booru_tags("1girl, smile, indoors")
assert not looks_like_booru_tags("draw a picture of a cat on the moon")
+20
View File
@@ -0,0 +1,20 @@
from datetime import date
from app.fitness.charts import linear_regression, week_start
def test_week_start_monday():
assert week_start(date(2026, 6, 13)) == date(2026, 6, 8)
def test_linear_regression_increasing():
points = [(0.0, 1.0), (1.0, 2.0), (2.0, 3.0)]
fit = linear_regression(points)
assert fit is not None
assert abs(fit["slope"] - 1.0) < 1e-9
assert abs(fit["intercept"] - 1.0) < 1e-9
def test_linear_regression_requires_two_points():
assert linear_regression([(0.0, 5.0)]) is None
assert linear_regression([]) is None