gencow 0.1.63 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/gencow.mjs +5 -4
- package/package.json +1 -1
package/bin/gencow.mjs
CHANGED
|
@@ -552,12 +552,13 @@ function generateReadmeMd(config, apiObj) {
|
|
|
552
552
|
md += `### 백엔드에서 AI 호출\n\n`;
|
|
553
553
|
md += `\`\`\`typescript\n`;
|
|
554
554
|
md += `// gencow/ai.ts\n`;
|
|
555
|
-
md += `import { mutation } from "@gencow/core";\n\n`;
|
|
556
|
-
md += `export const chat = mutation({\n`;
|
|
557
|
-
md += `
|
|
555
|
+
md += `import { mutation, v } from "@gencow/core";\n\n`;
|
|
556
|
+
md += `export const chat = mutation("ai.chat", {\n`;
|
|
557
|
+
md += ` args: { message: v.string() },\n`;
|
|
558
|
+
md += ` handler: async (ctx, args) => {\n`;
|
|
558
559
|
md += ` const result = await ctx.ai.chat({\n`;
|
|
559
560
|
md += ` model: "gpt-4o-mini", // 또는 "gpt-4o"\n`;
|
|
560
|
-
md += ` messages: [{ role: "user", content: message }],\n`;
|
|
561
|
+
md += ` messages: [{ role: "user", content: args.message }],\n`;
|
|
561
562
|
md += ` });\n`;
|
|
562
563
|
md += ` return result.text;\n`;
|
|
563
564
|
md += ` },\n`;
|