Skip to content

Commit

Permalink
Fix typo: converstation -> conversation (#1202)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrustein authored Dec 10, 2024
1 parent 2d39b2b commit 6b7f21b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions livekit-agents/livekit/agents/multimodal/multimodal_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def _input_speech_transcription_completed(
user_msg = ChatMessage.create(
text=ev.transcript, role="user", id=ev.item_id
)
self._session._update_converstation_item_content(
self._session._update_conversation_item_content(
ev.item_id, user_msg.content
)

Expand Down Expand Up @@ -330,7 +330,7 @@ def _on_playout_stopped(interrupted: bool) -> None:
role="assistant",
id=self._playing_handle.item_id,
)
self._session._update_converstation_item_content(
self._session._update_conversation_item_content(
self._playing_handle.item_id, msg.content
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def __init__(
self._main_task(), name="openai-realtime-session"
)
# manage conversation items internally
self._remote_converstation_items = remote_items._RemoteConversationItems()
self._remote_conversation_items = remote_items._RemoteConversationItems()

# wait for the item to be created or deleted
self._item_created_futs: dict[str, asyncio.Future[bool]] = {}
Expand Down Expand Up @@ -844,15 +844,15 @@ def session_update(
)

def chat_ctx_copy(self) -> llm.ChatContext:
return self._remote_converstation_items.to_chat_context()
return self._remote_conversation_items.to_chat_context()

async def set_chat_ctx(self, new_ctx: llm.ChatContext) -> None:
"""Sync the chat context with the agent's chat context.
Compute the minimum number of insertions and deletions to transform the old
chat context messages to the new chat context messages.
"""
original_ctx = self._remote_converstation_items.to_chat_context()
original_ctx = self._remote_conversation_items.to_chat_context()

changes = utils._compute_changes(
original_ctx.messages, new_ctx.messages, key_fnc=lambda x: x.id
Expand Down Expand Up @@ -912,10 +912,10 @@ def _recover_from_text_response(self, item_id: str | None = None) -> None:
self.conversation.item.create(self._create_empty_user_audio_message(1.0))
self.response.create()

def _update_converstation_item_content(
def _update_conversation_item_content(
self, item_id: str, content: llm.ChatContent | list[llm.ChatContent] | None
) -> None:
item = self._remote_converstation_items.get(item_id)
item = self._remote_conversation_items.get(item_id)
if item is None:
logger.warning(
"conversation item not found, skipping update",
Expand Down Expand Up @@ -1185,7 +1185,7 @@ def _handle_conversation_item_created(
return

# Insert into conversation items
self._remote_converstation_items.insert_after(previous_item_id, message)
self._remote_conversation_items.insert_after(previous_item_id, message)
if item_id in self._item_created_futs:
self._item_created_futs[item_id].set_result(True)
del self._item_created_futs[item_id]
Expand All @@ -1196,7 +1196,7 @@ def _handle_conversation_item_deleted(
):
# Delete from conversation items
item_id = item_deleted["item_id"]
self._remote_converstation_items.delete(item_id)
self._remote_conversation_items.delete(item_id)
if item_id in self._item_deleted_futs:
self._item_deleted_futs[item_id].set_result(True)
del self._item_deleted_futs[item_id]
Expand Down Expand Up @@ -1362,7 +1362,7 @@ def _handle_response_output_item_done(
item["arguments"],
)

msg = self._remote_converstation_items.get(output.item_id)
msg = self._remote_conversation_items.get(output.item_id)
if msg is not None:
# update the content of the message
assert msg.tool_call_id == item["call_id"]
Expand Down Expand Up @@ -1491,7 +1491,7 @@ async def _run_fnc_task(self, fnc_call_info: llm.FunctionCallInfo, item_id: str)
await create_fut

# update the message with the tool call result
msg = self._remote_converstation_items.get(tool_call.id)
msg = self._remote_conversation_items.get(tool_call.id)
if msg is not None:
assert msg.tool_call_id == tool_call.tool_call_id
assert msg.role == "tool"
Expand Down

0 comments on commit 6b7f21b

Please sign in to comment.