Allow multiplechoice tool to end the model turn

Add EndsTurn field to llm.Tool to indicate if a tool should force the end of a turn.
Set the multiplechoice tool to end the turn by setting EndsTurn=true.
Update OnResponse to check for tools that should end the turn.

Transcript of the chat for this change:
https://sketch.dev/messages/1f4n-17a3-hmfx-71gg

Note that I did ask it to investigate an alternative approach, but decided
this one (explicit EndsTurn field on Tool) was a better trade-off than
the alternative (altering the Tool.Run signature).

Co-Authored-By: sketch <hello@sketch.dev>
diff --git a/loop/agent.go b/loop/agent.go
index 0c1f2ff..f5f40ed 100644
--- a/loop/agent.go
+++ b/loop/agent.go
@@ -602,6 +602,22 @@
 	endOfTurn := false
 	if resp.StopReason != llm.StopReasonToolUse && convo.Parent == nil {
 		endOfTurn = true
+	} else if resp.StopReason == llm.StopReasonToolUse {
+		// Check if any of the tool calls are for tools that should end the turn
+		for _, part := range resp.Content {
+			if part.Type == llm.ContentTypeToolUse {
+				// Find the tool by name
+				for _, tool := range convo.Tools {
+					if tool.Name == part.ToolName && tool.EndsTurn {
+						endOfTurn = true
+						break
+					}
+				}
+				if endOfTurn {
+					break
+				}
+			}
+		}
 	}
 	m := AgentMessage{
 		Type:      AgentMessageType,
@@ -849,6 +865,7 @@
 	ret := &llm.Tool{
 		Name:        "multiplechoice",
 		Description: "Present the user with an quick way to answer to your question using one of a short list of possible answers you would expect from the user.",
+		EndsTurn:    true,
 		InputSchema: json.RawMessage(`{
   "type": "object",
   "description": "The question and a list of answers you would expect the user to choose from.",