diff --git a/app/src/components/generative/ToolChoiceSelector.tsx b/app/src/components/generative/ToolChoiceSelector.tsx index b0a89d095c..32a0404fc3 100644 --- a/app/src/components/generative/ToolChoiceSelector.tsx +++ b/app/src/components/generative/ToolChoiceSelector.tsx @@ -35,7 +35,7 @@ type ToolChoicePickerProps = { /** * The current choice including the default {@link ToolChoice} and any user defined tools */ - choice: ToolChoice; + choice: ToolChoice | undefined; /** * Callback for when the tool choice changes */ @@ -52,7 +52,7 @@ export function ToolChoicePicker({ toolNames, }: ToolChoicePickerProps) { const currentKey = - typeof choice === "string" + choice == null || typeof choice === "string" ? choice : addToolNamePrefix(choice.function.name); return ( diff --git a/app/src/pages/playground/PlaygroundChatTemplate.tsx b/app/src/pages/playground/PlaygroundChatTemplate.tsx index 531064f5f5..bea1b63f1d 100644 --- a/app/src/pages/playground/PlaygroundChatTemplate.tsx +++ b/app/src/pages/playground/PlaygroundChatTemplate.tsx @@ -243,7 +243,9 @@ function SortableMessageItem({ } extra={ - + {message.content != null && ( + + )}