mirror of
https://github.com/primedigitaltech/market-assistant.git
synced 2026-07-24 01:01:40 +08:00
test(pipeline): print live LLM JSON to stderr in keyword/scenario tests
Made-with: Cursor
This commit is contained in:
parent
e708480382
commit
f19d112e73
@ -1,7 +1,9 @@
|
|||||||
"""llm_keyword_suggest:分块/解析烟测;有 API 配置时直连大模型做联调。"""
|
"""llm_keyword_suggest:分块/解析烟测;有 API 配置时直连大模型做联调。"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@ -125,6 +127,12 @@ class SuggestFocusKeywordsLiveLLMTests(SimpleTestCase):
|
|||||||
self.assertGreaterEqual(len(p), 2)
|
self.assertGreaterEqual(len(p), 2)
|
||||||
self.assertLessEqual(len(p), 24)
|
self.assertLessEqual(len(p), 24)
|
||||||
self.assertNotIn("甜度", kws)
|
self.assertNotIn("甜度", kws)
|
||||||
|
sys.stderr.write(
|
||||||
|
"\n=== [Live LLM] suggest_focus_keywords_from_all_comments ===\n"
|
||||||
|
+ json.dumps(out, ensure_ascii=False, indent=2)
|
||||||
|
+ "\n"
|
||||||
|
)
|
||||||
|
sys.stderr.flush()
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipUnless(
|
@unittest.skipUnless(
|
||||||
@ -153,3 +161,9 @@ class SuggestScenarioGroupsLiveLLMTests(SimpleTestCase):
|
|||||||
for g in groups:
|
for g in groups:
|
||||||
tr = g.get("triggers") or []
|
tr = g.get("triggers") or []
|
||||||
self.assertGreaterEqual(len(tr), 1)
|
self.assertGreaterEqual(len(tr), 1)
|
||||||
|
sys.stderr.write(
|
||||||
|
"\n=== [Live LLM] suggest_scenario_groups_llm ===\n"
|
||||||
|
+ json.dumps(out, ensure_ascii=False, indent=2)
|
||||||
|
+ "\n"
|
||||||
|
)
|
||||||
|
sys.stderr.flush()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user