diff src/lib/ai/claude/Ai_chat.luan @ 69:f5e72f2d1025

add stt_prompt
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 23 Aug 2025 07:07:59 -0600
parents 16e5c14eb800
children
line wrap: on
line diff
--- a/src/lib/ai/claude/Ai_chat.luan	Sat Aug 23 04:32:17 2025 -0600
+++ b/src/lib/ai/claude/Ai_chat.luan	Sat Aug 23 07:07:59 2025 -0600
@@ -105,7 +105,7 @@
 	}
 	get_tts_instructions = {
 		tool = {
-			description = "Get the text-to-speech instructions of a chat/thread on this website.  These instruction are passed to OpenAI.  If there are no instructions, the empty string is returned."
+			description = "Get the text-to-speech instructions of a chat/thread on this website.  These instructions are passed to OpenAI.  If there are no instructions, the empty string is returned."
 			input_schema = {
 				type = "object"
 				properties = {
@@ -122,6 +122,25 @@
 			return chat.tts_instructions or error()
 		end
 	}
+	get_stt_prompt = {
+		tool = {
+			description = "Get the speech-to-text prompt of a chat/thread on this website.  This prompt is passed to OpenAI.  If there is no prompt, the empty string is returned."
+			input_schema = {
+				type = "object"
+				properties = {
+					chat_id = {
+						description = "The ID of the chat"
+						type = "integer"
+					}
+				}
+			}
+		}
+		fn = function(input)
+			local chat_id = input.chat_id or error()
+			local chat = get_chat(chat_id)
+			return chat.stt_prompt or error()
+		end
+	}
 }
 local tools = {nil}
 for name, f in pairs(functions) do