New summary (#283)

* handover final summary to Zephyr deployment

* fix display error

* push new summary feature

* fix failing test case

* Added markdown support for final summary

* update UI render issue

* retain sentence tokenizer call

---------

Co-authored-by: Koper <andreas@monadical.com>
This commit is contained in:
projects-g
2023-10-13 22:53:29 +05:30
committed by GitHub
parent 38cd0385b4
commit 1d92d43fe0
13 changed files with 933 additions and 23 deletions

View File

@@ -93,3 +93,12 @@ def ensure_casing():
with patch("reflector.llm.base.LLM.ensure_casing") as mock_casing:
mock_casing.return_value = "LLM TITLE"
yield
@pytest.fixture
def sentence_tokenize():
with patch(
"reflector.processors.TranscriptFinalLongSummaryProcessor" ".sentence_tokenize"
) as mock_sent_tokenize:
mock_sent_tokenize.return_value = ["LLM LONG SUMMARY"]
yield

View File

@@ -9,6 +9,7 @@ async def test_basic_process(
dummy_llm,
dummy_processors,
ensure_casing,
sentence_tokenize,
):
# goal is to start the server, and send rtc audio to it
# validate the events received

View File

@@ -60,6 +60,7 @@ async def test_transcript_rtc_and_websocket(
dummy_processors,
ensure_casing,
appserver,
sentence_tokenize,
):
# goal: start the server, exchange RTC, receive websocket events
# because of that, we need to start the server in a thread
@@ -156,7 +157,7 @@ async def test_transcript_rtc_and_websocket(
assert "FINAL_LONG_SUMMARY" in eventnames
ev = events[eventnames.index("FINAL_LONG_SUMMARY")]
assert ev["data"]["long_summary"] == "LLM LONG SUMMARY"
assert ev["data"]["long_summary"] == "* LLM LONG SUMMARY \n"
assert "FINAL_SHORT_SUMMARY" in eventnames
ev = events[eventnames.index("FINAL_SHORT_SUMMARY")]
@@ -193,6 +194,7 @@ async def test_transcript_rtc_and_websocket_and_fr(
dummy_processors,
ensure_casing,
appserver,
sentence_tokenize,
):
# goal: start the server, exchange RTC, receive websocket events
# because of that, we need to start the server in a thread
@@ -292,7 +294,7 @@ async def test_transcript_rtc_and_websocket_and_fr(
assert "FINAL_LONG_SUMMARY" in eventnames
ev = events[eventnames.index("FINAL_LONG_SUMMARY")]
assert ev["data"]["long_summary"] == "LLM LONG SUMMARY"
assert ev["data"]["long_summary"] == "* LLM LONG SUMMARY \n"
assert "FINAL_SHORT_SUMMARY" in eventnames
ev = events[eventnames.index("FINAL_SHORT_SUMMARY")]