MCPcopy Create free account
hub / github.com/ethanniser/NextFaster / generateBatchFile

Function generateBatchFile

scripts/generate.ts:209–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

207`;
208
209const 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected