feat: beaver first commit

This commit is contained in:
0Xiao0
2026-06-02 14:07:56 +08:00
parent 34cf1b9736
commit 0a50f25dfa
4 changed files with 41 additions and 22 deletions

View File

@ -3,7 +3,10 @@ import json
import aiohttp
from aiohttp import web
from custom.beaver_llm import BeaverLLM, latest_user_text
try:
from custom.beaver_llm import BeaverLLM, latest_user_text
except ModuleNotFoundError:
from beaver_llm import BeaverLLM, latest_user_text
from livekit.agents import ChatContext
@ -83,16 +86,13 @@ async def test_beaver_llm_sends_latest_user_text_and_returns_reply(
await runner.cleanup()
assert collected.text == "beaver reply"
assert received == [
{
"type": "connect",
"peer_id": "livekit-room",
"device_name": "livekit-custom-agent",
"capabilities": ["text"],
},
{
"type": "message",
"message_id": "livekit-room-000001",
"text": "hello beaver",
},
]
assert received[0] == {
"type": "connect",
"peer_id": "livekit-room",
"device_name": "livekit-custom-agent",
"capabilities": ["text"],
}
assert received[1]["type"] == "message"
assert received[1]["message_id"].startswith("livekit-room-")
assert received[1]["message_id"].endswith("-000001")
assert received[1]["text"] == "hello beaver"