webui: +sketch-tool-card-multiple-choice
This is just the frontend part of the multiple-choice tool.
Since the actual tool call isn't implemented yet, the only
way to exercise this code is via the demo page.
Co-Authored-By: sketch <hello@sketch.dev>
diff --git a/webui/src/web-components/demo/sketch-tool-card.demo.html b/webui/src/web-components/demo/sketch-tool-card.demo.html
index f8ba308..ba53164 100644
--- a/webui/src/web-components/demo/sketch-tool-card.demo.html
+++ b/webui/src/web-components/demo/sketch-tool-card.demo.html
@@ -8,6 +8,41 @@
<script>
const toolCalls = [
{
+ name: "multiple-choice",
+ input: JSON.stringify({
+ question: "What is your favorite programming language?",
+ choices: [
+ "JavaScript",
+ "TypeScript",
+ "Python",
+ "Go",
+ "Rust",
+ "Java",
+ "C#",
+ "C++",
+ ],
+ }),
+ result_message: {
+ type: "tool",
+ tool_result: JSON.stringify({
+ selected: "Go",
+ }),
+ },
+ },
+ {
+ name: "multiple-choice",
+ input: JSON.stringify({
+ question: "Which feature would you like to implement next?",
+ choices: [
+ "Dark mode",
+ "User profiles",
+ "Social sharing",
+ "Analytics dashboard",
+ ],
+ }),
+ // No result yet, showing the choices without a selection
+ },
+ {
name: "bash",
input: JSON.stringify({
command:
@@ -238,6 +273,11 @@
case "title":
toolCardEl = document.createElement("sketch-tool-card-title");
break;
+ case "multiple-choice":
+ toolCardEl = document.createElement(
+ "sketch-tool-card-multiple-choice",
+ );
+ break;
}
toolCardEl.toolCall = toolCall;
toolCardEl.open = true;