Skip to content

Commit

Permalink
Make sure id is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Jul 29, 2024
1 parent 500a856 commit 8724968
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions shiny/ui/_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ def __init__(
on_error: Literal["auto", "actual", "sanitize", "unhandled"] = "auto",
tokenizer: TokenEncoding | MISSING_TYPE | None = MISSING,
):
if not isinstance(id, str):
raise TypeError("`id` must be a string.")

id = resolve_id(id)
self.id = id
self.user_input_id = ResolvedId(f"{id}_user_input")
self.id = resolve_id(id)
self.user_input_id = ResolvedId(f"{self.id}_user_input")
self._transform_user: TransformUserInputAsync | None = None
self._transform_assistant: TransformAssistantResponseChunkAsync | None = None
if isinstance(tokenizer, MISSING_TYPE):
Expand Down

0 comments on commit 8724968

Please sign in to comment.