Merge remote-tracking branch 'origin/main'
Docs / docs (push) Successful in 28s
Playwright Tests / test-playwright (1, 2) (push) Successful in 4m6s
Playwright Tests / test-playwright (2, 2) (push) Successful in 2m36s
pre-commit / pre-commit (push) Successful in 3m33s
Test Backend / test-backend (3.12) (push) Failing after 6m15s
Test Backend / test-backend (3.14) (push) Failing after 5m56s
Compose Smoke Test / test-compose (push) Successful in 36s
Playwright Tests / merge-reports (push) Successful in 1m20s
Docs / docs (push) Successful in 28s
Playwright Tests / test-playwright (1, 2) (push) Successful in 4m6s
Playwright Tests / test-playwright (2, 2) (push) Successful in 2m36s
pre-commit / pre-commit (push) Successful in 3m33s
Test Backend / test-backend (3.12) (push) Failing after 6m15s
Test Backend / test-backend (3.14) (push) Failing after 5m56s
Compose Smoke Test / test-compose (push) Successful in 36s
Playwright Tests / merge-reports (push) Successful in 1m20s
This commit is contained in:
@@ -11,7 +11,7 @@ import pytest
|
||||
from fluksio.ai import client
|
||||
from fluksio.ai import config as ai_config
|
||||
from fluksio.flow.messages import DType, MessageSpec
|
||||
from fluksio.flow.nodes.assistant import UNAVAILABLE, AssistantNode, cut
|
||||
from fluksio.flow.nodes.assistant import IGNORED, UNAVAILABLE, AssistantNode, cut
|
||||
from fluksio.flow.pipeline import Pipeline
|
||||
|
||||
PROVIDER = ai_config.AIConfig(api_base="http://llm:11434/v1", api_key="k", model="m")
|
||||
@@ -140,6 +140,22 @@ def test_no_provider_or_one_that_does_not_answer_is_said(
|
||||
assert node._health == "degraded"
|
||||
|
||||
|
||||
def test_overheard_talk_gets_no_answer(monkeypatch: pytest.MonkeyPatch):
|
||||
said: list[dict[str, Any]] = []
|
||||
|
||||
async def completion(**kwargs: Any) -> AsyncIterator[str | dict[str, Any]]:
|
||||
yield IGNORED
|
||||
yield {"role": "assistant", "content": IGNORED}
|
||||
|
||||
monkeypatch.setattr(ai_config, "load", lambda: PROVIDER)
|
||||
monkeypatch.setattr(client, "stream_completion", completion)
|
||||
monkeypatch.setattr(AssistantNode, "emit", lambda self, values: said.append(values))
|
||||
|
||||
_ask(_node(), "I don't know what to get, Francis.")
|
||||
|
||||
assert said == []
|
||||
|
||||
|
||||
def test_a_target_with_values_takes_only_those_and_is_confirmed_in_words(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
):
|
||||
|
||||
@@ -52,8 +52,8 @@ def test_units_and_clock_times_are_said_as_words():
|
||||
def test_an_utterance_is_one_session_committed_when_listening_ends(monkeypatch):
|
||||
heard: list[bytes] = []
|
||||
|
||||
async def session(api_base, audio, *, rate, idle_s):
|
||||
assert (api_base, rate) == (f"{URL}/v1", 16000)
|
||||
async def session(api_base, audio, *, rate, idle_s, prompt):
|
||||
assert (api_base, rate, prompt) == (f"{URL}/v1", 16000, "Driveway.")
|
||||
while (chunk := await audio.get()) is not None:
|
||||
heard.append(chunk)
|
||||
yield False, "turn on"
|
||||
@@ -79,6 +79,7 @@ def test_an_utterance_is_one_session_committed_when_listening_ends(monkeypatch):
|
||||
MessageSpec(name="partial", dtype=DType.STR),
|
||||
MessageSpec(name="text", dtype=DType.STR),
|
||||
],
|
||||
params={"prompt": "Driveway."},
|
||||
)
|
||||
node.assign_flow("voice", "stt")
|
||||
pipeline = Pipeline([node])
|
||||
|
||||
Reference in New Issue
Block a user