convex-weflayr 0.1.0 → 0.1.1
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/README.md +6 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,14 +12,7 @@ adds the header for you and writes each call's usage into tables your app can
|
|
|
12
12
|
query. So your app can act on cost: show a customer their usage, warn at 80% of
|
|
13
13
|
a plan, stop at 100%.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
flowchart LR
|
|
17
|
-
A["Convex action<br/>(your AI feature)"] -->|"1. model call + header<br/>feature, call, customer"| G["Weflayr gateway"]
|
|
18
|
-
G -->|"2. answer + usage"| A
|
|
19
|
-
A -->|"3. track() saves the call"| C[("convex-weflayr tables<br/>calls, daily totals, budgets")]
|
|
20
|
-
C -->|"4. cost per customer,<br/>call, feature, day"| Q["Your queries and UI"]
|
|
21
|
-
C -->|"5. assertWithinBudget()"| A
|
|
22
|
-
```
|
|
15
|
+

|
|
23
16
|
|
|
24
17
|
## What you get
|
|
25
18
|
|
|
@@ -69,23 +62,23 @@ Open the app and paste your key. Then:
|
|
|
69
62
|
An agent run. Four steps share one run id, so the cost of the run is the sum of
|
|
70
63
|
its steps:
|
|
71
64
|
|
|
72
|
-

|
|
65
|
+

|
|
73
66
|
|
|
74
67
|
A budget. After three calls the customer has used $0.000021 of a $0.00002
|
|
75
68
|
budget, and the fourth call is stopped before the model runs:
|
|
76
69
|
|
|
77
|
-

|
|
70
|
+

|
|
78
71
|
|
|
79
72
|
Spend by customer and by call, and every saved call:
|
|
80
73
|
|
|
81
|
-

|
|
74
|
+

|
|
82
75
|
|
|
83
|
-

|
|
76
|
+

|
|
84
77
|
|
|
85
78
|
The same calls in the Weflayr dashboard, grouped by the feature names the
|
|
86
79
|
component sent:
|
|
87
80
|
|
|
88
|
-

|
|
81
|
+

|
|
89
82
|
|
|
90
83
|
About your key: it is saved in your browser's localStorage and sent with each
|
|
91
84
|
call so the call can be made. It is never saved in the database. Each browser
|