| 205 | } |
| 206 | |
| 207 | private static JsonObject userTextItem(String text) { |
| 208 | JsonObject part = new JsonObject(); |
| 209 | part.addProperty(FIELD_TYPE, "input_text"); |
| 210 | part.addProperty("text", text); |
| 211 | JsonArray content = new JsonArray(); |
| 212 | content.add(part); |
| 213 | JsonObject item = new JsonObject(); |
| 214 | item.addProperty(FIELD_TYPE, "message"); |
| 215 | item.addProperty("role", "user"); |
| 216 | item.add(FIELD_CONTENT, content); |
| 217 | return item; |
| 218 | } |
| 219 | |
| 220 | private static boolean hasWavHeader(Path pcm) throws Exception { |
| 221 | byte[] magic = new byte[4]; |