hello, i implemented my own realtime model. it wor...
# agents
f
hello, i implemented my own realtime model. it works fine when using audio input(however i see the agent states switch to speaking and never back to listening, but using audio could continue get the answer). i want to add text input now, i do something in update_chat_ctx, then the model won't reply ( i can see upstream did reply). so i'm wondering maybe i missed emitting some ending event?
Copy code
async def update_chat_ctx(self, chat_ctx: llm.ChatContext) -> None:
    # Volcengine Realtime Dialogue uses dialog_id for context continuity
    # For now, we'll just log the update
    async with self._update_chat_ctx_lock:
      if not chat_ctx.items:
        return
      last_item = chat_ctx.items[-1]
      if not isinstance(last_item, llm.ChatMessage):
        return
      if last_item.role != 'user':
        return

      parts = [i for i in last_item.content if isinstance(i, str)]
      content = '\n'.join(parts)
      # NOTICE: without this, pure audio works
      # self.send_text_query(content)
    logger.info('adding user message: %s', content)