@lunora/ai 1.0.0-alpha.93 → 1.0.0-alpha.95

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.
Files changed (2) hide show
  1. package/README.md +7 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -65,8 +65,14 @@ When a function uses AI, codegen wires a typed **`ctx.ai`** onto the action cont
65
65
  import { action, v } from "@/lunora/_generated/server";
66
66
  import { generateText } from "@lunora/ai";
67
67
 
68
- export const summarize = action.input({ text: v.string() }).action(async ({ args: { text }, ctx }) => {
68
+ export const summarize = action.input({ text: v.string().max(20_000) }).action(async ({ args: { text }, ctx }) => {
69
69
  const { text: summary } = await generateText({
70
+ // Both ends of the token bill are bounded: the input by `.max()` above,
71
+ // the completion here. An `action` is public RPC and inference is
72
+ // metered, so an unbounded completion is a denial-of-wallet vector — a
73
+ // short prompt can ask for an arbitrarily long answer, and output
74
+ // tokens are the expensive half.
75
+ maxOutputTokens: 300,
70
76
  model: ctx.ai.model("@cf/meta/llama-3.3-70b-instruct-fp8-fast"),
71
77
  prompt: `Summarize:\n\n${text}`,
72
78
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/ai",
3
- "version": "1.0.0-alpha.93",
3
+ "version": "1.0.0-alpha.95",
4
4
  "description": "Workers AI helper for Lunora: provider-agnostic AI SDK access from functions, Workers AI by default",
5
5
  "keywords": [
6
6
  "ai",
@@ -53,7 +53,7 @@
53
53
  "access": "public"
54
54
  },
55
55
  "dependencies": {
56
- "@lunora/errors": "1.0.0-alpha.39",
56
+ "@lunora/errors": "1.0.0-alpha.40",
57
57
  "ai": "7.0.93",
58
58
  "workers-ai-provider": "4.0.0"
59
59
  },