Mercurial Hosting > lang
comparison 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 | 44bec62c49e2 |
comparison
equal
deleted
inserted
replaced
68:a366d27db8f1 | 69:f5e72f2d1025 |
---|---|
103 return chat.ai_thread or error() | 103 return chat.ai_thread or error() |
104 end | 104 end |
105 } | 105 } |
106 get_tts_instructions = { | 106 get_tts_instructions = { |
107 tool = { | 107 tool = { |
108 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." | 108 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." |
109 input_schema = { | 109 input_schema = { |
110 type = "object" | 110 type = "object" |
111 properties = { | 111 properties = { |
112 chat_id = { | 112 chat_id = { |
113 description = "The ID of the chat" | 113 description = "The ID of the chat" |
118 } | 118 } |
119 fn = function(input) | 119 fn = function(input) |
120 local chat_id = input.chat_id or error() | 120 local chat_id = input.chat_id or error() |
121 local chat = get_chat(chat_id) | 121 local chat = get_chat(chat_id) |
122 return chat.tts_instructions or error() | 122 return chat.tts_instructions or error() |
123 end | |
124 } | |
125 get_stt_prompt = { | |
126 tool = { | |
127 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." | |
128 input_schema = { | |
129 type = "object" | |
130 properties = { | |
131 chat_id = { | |
132 description = "The ID of the chat" | |
133 type = "integer" | |
134 } | |
135 } | |
136 } | |
137 } | |
138 fn = function(input) | |
139 local chat_id = input.chat_id or error() | |
140 local chat = get_chat(chat_id) | |
141 return chat.stt_prompt or error() | |
123 end | 142 end |
124 } | 143 } |
125 } | 144 } |
126 local tools = {nil} | 145 local tools = {nil} |
127 for name, f in pairs(functions) do | 146 for name, f in pairs(functions) do |