feat: add conversational RollCalc assistant

This commit is contained in:
2026-08-29 22:37:56 +02:00
parent 3b44048250
commit fa3000b325
25 changed files with 6820 additions and 48 deletions
+27
View File
@@ -0,0 +1,27 @@
import os
import unittest
from ollama_nlu import OllamaNLUClient
@unittest.skipUnless(
os.getenv("ROLLCALC_RUN_OLLAMA_SMOKE") == "1",
"set ROLLCALC_RUN_OLLAMA_SMOKE=1 to use the local Ollama model",
)
class RealOllamaSmokeTests(unittest.TestCase):
def test_representative_german_request(self):
response = OllamaNLUClient().interpret(
"Welchen Durchmesser hat Bentofix NSP 4900, "
"Artikelnummer 180205 bei 65 m Länge?"
)
interpretation = response.interpretation
self.assertEqual(interpretation.intent, "new_calculation")
self.assertEqual(interpretation.article_number, "180205")
self.assertEqual(interpretation.article_name_hint, "Bentofix NSP 4900")
self.assertEqual(interpretation.roll_length_m, 65.0)
self.assertIsNone(interpretation.width_m)
if __name__ == "__main__":
unittest.main()