()
| 207 | `; |
| 208 | |
| 209 | const generateBatchFile = async () => { |
| 210 | const arr = await db.select().from(subcategories); |
| 211 | |
| 212 | arr.forEach((subcat) => { |
| 213 | const custom_id = subcat.slug; |
| 214 | const method = "POST"; |
| 215 | const url = "/v1/chat/completions"; |
| 216 | const body = { |
| 217 | model: "gpt-4o-mini", |
| 218 | messages: [ |
| 219 | { role: "system", content: productSystemMessage }, |
| 220 | { role: "user", content: `Category name: ${subcat.name}` }, |
| 221 | ], |
| 222 | }; |
| 223 | |
| 224 | const line = `{"custom_id": "${custom_id}", "method": "${method}", "url": "${url}", "body": ${JSON.stringify(body)}}`; |
| 225 | |
| 226 | fs.appendFile("scripts/req.jsonl", line + "\n", (err: any) => { |
| 227 | if (err) { |
| 228 | console.error(err); |
| 229 | return; |
| 230 | } |
| 231 | }); |
| 232 | }); |
| 233 | }; |
| 234 | |
| 235 | // generateBatchFile(); |
| 236 |
nothing calls this directly
no outgoing calls
no test coverage detected