GordonChan365 commited on
Commit
197a8d4
·
verified ·
1 Parent(s): 31f97cf

Update kitt.py

Browse files
Files changed (1) hide show
  1. kitt.py +3 -3
kitt.py CHANGED
@@ -12,7 +12,7 @@ from livekit.agents.llm import (
12
  ChatMessage,
13
  ChatRole,
14
  )
15
- from livekit.agents.voice_assistant import AssistantContext, VoiceAssistant
16
  from livekit.plugins import deepgram, openai, silero
17
 
18
  dotenv.load_dotenv()
@@ -35,7 +35,7 @@ class AssistantFnc(agents.llm.FunctionContext):
35
  agents.llm.TypeInfo(desc="The user message that triggered this function"),
36
  ],
37
  ):
38
- ctx = AssistantContext.get_current()
39
  ctx.store_metadata("user_msg", user_msg)
40
 
41
 
@@ -133,7 +133,7 @@ async def entrypoint(ctx: JobContext):
133
  await assistant.say(stream, allow_interruptions=True)
134
 
135
  @assistant.on("function_calls_finished")
136
- def _function_calls_done(ctx: AssistantContext):
137
  user_msg = ctx.get_metadata("user_msg")
138
  if not user_msg:
139
  return
 
12
  ChatMessage,
13
  ChatRole,
14
  )
15
+ from livekit.agents.voice_assistant import AssistantCallContext, VoiceAssistant
16
  from livekit.plugins import deepgram, openai, silero
17
 
18
  dotenv.load_dotenv()
 
35
  agents.llm.TypeInfo(desc="The user message that triggered this function"),
36
  ],
37
  ):
38
+ ctx = AssistantCallContext.get_current()
39
  ctx.store_metadata("user_msg", user_msg)
40
 
41
 
 
133
  await assistant.say(stream, allow_interruptions=True)
134
 
135
  @assistant.on("function_calls_finished")
136
+ def _function_calls_done(ctx: AssistantCallContext):
137
  user_msg = ctx.get_metadata("user_msg")
138
  if not user_msg:
139
  return