@netlify/agent-runner-cli 1.177.0 → 1.179.0-cancel-fields.0
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/dist/bin-local.js +218 -218
- package/dist/bin.js +296 -296
- package/dist/index.js +245 -245
- package/dist/skills/netlify-ai-gateway/SKILL.md +48 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: netlify-ai-gateway
|
|
3
|
-
description: Use Netlify AI Gateway for AI inference in Netlify Functions and server-side code. Use when adding AI/LLM features with OpenAI, Anthropic,
|
|
3
|
+
description: Use Netlify AI Gateway for AI inference in Netlify Functions and server-side code. Use when adding AI/LLM features with OpenAI, Anthropic, Google Gemini, or Typesafe without managing API keys. Must be read before selecting or changing any AI model. Contains the list of supported models.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Netlify AI Gateway
|
|
@@ -34,6 +34,7 @@ AI Gateway requires a **credit-based plan** (Free, Personal, or Pro). It is not
|
|
|
34
34
|
| **Anthropic** | `ANTHROPIC_API_KEY`, `ANTHROPIC_BASE_URL` |
|
|
35
35
|
| **OpenAI** | `OPENAI_API_KEY`, `OPENAI_BASE_URL` |
|
|
36
36
|
| **Google Gemini** | `GEMINI_API_KEY`, `GOOGLE_GEMINI_BASE_URL` |
|
|
37
|
+
| **Typesafe** | `TYPESAFE_API_KEY`, `TYPESAFE_BASE_URL` |
|
|
37
38
|
| **Gateway (always set)** | `NETLIFY_AI_GATEWAY_KEY`, `NETLIFY_AI_GATEWAY_BASE_URL` |
|
|
38
39
|
|
|
39
40
|
## Quick Start
|
|
@@ -113,6 +114,45 @@ const response = await ai.models.generateContent({
|
|
|
113
114
|
console.log(response.text)
|
|
114
115
|
```
|
|
115
116
|
|
|
117
|
+
### Typesafe
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npm install @typesafe-ai/sdk
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Typesafe's System One models answer typed questions about content instead of generating text. Pass a `state` — a string
|
|
124
|
+
or structured data — plus a map of named questions, and each answer comes back as a typed value with its probability
|
|
125
|
+
distribution and a confidence number. Requires Node.js 20 or newer.
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
import { choice, TypeSafeClient } from '@typesafe-ai/sdk'
|
|
129
|
+
|
|
130
|
+
const typesafe = new TypeSafeClient()
|
|
131
|
+
|
|
132
|
+
const { answers } = await typesafe.systemOne({
|
|
133
|
+
model: 'jev-latest',
|
|
134
|
+
state: 'I was charged twice. Please fix this ASAP.',
|
|
135
|
+
questions: {
|
|
136
|
+
category: choice('What is this ticket about?', {
|
|
137
|
+
billing: 'Payments, invoicing, refunds',
|
|
138
|
+
technical: 'Bugs, outages, integrations',
|
|
139
|
+
other: null,
|
|
140
|
+
}),
|
|
141
|
+
},
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
console.log(answers.category.choice, answers.category.confidence)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Two other question helpers are available: `noul()` asks a yes/no question and returns the probability of yes as
|
|
148
|
+
`answers.<name>.noul`, and `score()` rates the state against an ordered rubric of at least two levels and returns
|
|
149
|
+
`answers.<name>.score`. Batch every question a request needs into one `systemOne` call — one call with many questions
|
|
150
|
+
is far cheaper and faster than one call per question.
|
|
151
|
+
|
|
152
|
+
`model` may be omitted, in which case the SDK sends `jev-latest`. `jev-latest` and `jev-preview` are aliases that move
|
|
153
|
+
when a new release ships; pin a versioned ID such as `jev-1.13.0` when confidence thresholds are tuned against a
|
|
154
|
+
specific version.
|
|
155
|
+
|
|
116
156
|
## Streaming
|
|
117
157
|
|
|
118
158
|
### Anthropic Streaming
|
|
@@ -175,6 +215,10 @@ for await (const chunk of stream) {
|
|
|
175
215
|
}
|
|
176
216
|
```
|
|
177
217
|
|
|
218
|
+
### Typesafe Streaming
|
|
219
|
+
|
|
220
|
+
Not supported. `systemOne` resolves once with the complete set of answers; the Typesafe SDK has no streaming API.
|
|
221
|
+
|
|
178
222
|
## Image Generation
|
|
179
223
|
|
|
180
224
|
Use a Gemini image model, also known as "Nano Banana": pick a `gemini` model with `image` in its name from the Available Models list. No provider API key is needed — construct the client from the AI Gateway variables, which are always set. The gateway serves the Gemini REST API directly at its base URL, with no provider path prefix. Generated images come back as inline data parts:
|
|
@@ -424,4 +468,7 @@ npm install openai
|
|
|
424
468
|
|
|
425
469
|
# Google Gemini
|
|
426
470
|
npm install @google/genai
|
|
471
|
+
|
|
472
|
+
# Typesafe
|
|
473
|
+
npm install @typesafe-ai/sdk
|
|
427
474
|
```
|
package/package.json
CHANGED