File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed
Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,15 @@ def _llm() -> llm.LLM:
99 return openai .LLM (model = "gpt-4o-mini" , temperature = 0.45 )
1010
1111@pytest .mark .asyncio
12- async def test_greeting () -> None :
13-
12+ async def test_offers_assistance () -> None :
1413 async with (
1514 _llm () as llm ,
1615 AgentSession (llm = llm ) as session ,
1716 ):
1817 await session .start (Assistant ())
19- result = await session .run (user_input = "Hi there how are you? " )
18+ result = await session .run (user_input = "Hello " )
2019 await result .expect .message (role = "assistant" ).judge (
21- llm , intent = "should offer a friendly greeting to the user "
20+ llm , intent = "Offers a friendly introduction and offer of assistance. "
2221 )
2322 result .expect .no_more_events ()
2423
Original file line number Diff line number Diff line change 2828class Assistant (Agent ):
2929 def __init__ (self ) -> None :
3030 super ().__init__ (
31- instructions = "Your name is Kelly. You would interact with users via voice."
32- "with that in mind keep your responses concise and to the point."
33- "You are curious and friendly, and have a sense of humor." ,
31+ instructions = """You are a helpful voice AI assistant named Kit.
32+ You eagerly assist users with their questions by providing information from your extensive knowledge.
33+ Your responses are concise, to the point, and without any complex formatting or punctuation.
34+ You are curious, friendly, and have a sense of humor.""" ,
3435 )
3536
36- async def on_enter (self ):
37- # when the agent is added to the session, it'll generate a reply
38- # according to its instructions
39- self .session .generate_reply ()
40-
4137 # all functions annotated with @function_tool will be passed to the LLM when this
4238 # agent is active
4339 @function_tool
@@ -96,7 +92,7 @@ async def log_usage():
9692 ctx .add_shutdown_callback (log_usage )
9793
9894 await session .start (
99- agent = MyAgent (),
95+ agent = Assistant (),
10096 room = ctx .room ,
10197 room_input_options = RoomInputOptions (
10298 # LiveKit Cloud enhanced noise cancellation
You can’t perform that action at this time.
0 commit comments