@runpod/ai-sdk-provider 0.5.0 → 0.5.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +35 -21
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @runpod/ai-sdk-provider
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 1d60f42: docs: llms don't support object generation
8
+
3
9
  ## 0.5.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -86,8 +86,6 @@ const { text } = await generateText({
86
86
  - `finishReason` - Why generation stopped ('stop', 'length', etc.)
87
87
  - `usage` - Token usage information (prompt, completion, total tokens)
88
88
 
89
- Runpod language models can also be used in the `streamText` function (see [AI SDK Core](/docs/ai-sdk-core)).
90
-
91
89
  ### Streaming
92
90
 
93
91
  ```ts
@@ -108,10 +106,10 @@ for await (const delta of textStream) {
108
106
 
109
107
  ### Model Capabilities
110
108
 
111
- | Model ID | Description | Streaming | Object Generation | Tool Usage |
112
- | -------------------------------------- | ------------------------------------------------------------------- | --------- | ----------------- | ---------- |
113
- | `deep-cogito/deep-cogito-v2-llama-70b` | 70B parameter general-purpose LLM with advanced reasoning | ✅ | | ✅ |
114
- | `qwen/qwen3-32b-awq` | 32B parameter multilingual model with strong reasoning capabilities | ✅ | | ✅ |
109
+ | Model ID | Description | Streaming | Object Generation | Tool Usage | Reasoning Notes |
110
+ | -------------------------------------- | ------------------------------------------------------------------- | --------- | ----------------- | ---------- | ------------------------------------------------------------ |
111
+ | `deep-cogito/deep-cogito-v2-llama-70b` | 70B parameter general-purpose LLM with advanced reasoning | ✅ | | ✅ | Emits `<think>…</think>` inline; no separate reasoning parts |
112
+ | `qwen/qwen3-32b-awq` | 32B parameter multilingual model with strong reasoning capabilities | ✅ | | ✅ | Standard reasoning events |
115
113
 
116
114
  ### Chat Conversations
117
115
 
@@ -153,29 +151,45 @@ const { text, toolCalls } = await generateText({
153
151
  - `toolCalls` - Array of tool calls made by the model
154
152
  - `toolResults` - Results from executed tools
155
153
 
156
- ### Structured Output
154
+ ### Structured output
155
+
156
+ Using `generateObject` to enforce structured ouput is not supported by two models that are part of this provider.
157
+
158
+ You can still return structured data by instructing the model to return JSON and validating it yourself.
157
159
 
158
160
  ```ts
159
- import { generateObject } from 'ai';
161
+ import { runpod } from '@runpod/ai-sdk-provider';
162
+ import { generateText } from 'ai';
160
163
  import { z } from 'zod';
161
164
 
162
- const { object } = await generateObject({
165
+ const RecipeSchema = z.object({
166
+ name: z.string(),
167
+ ingredients: z.array(z.string()),
168
+ steps: z.array(z.string()),
169
+ });
170
+
171
+ const { text } = await generateText({
163
172
  model: runpod('qwen/qwen3-32b-awq'),
164
- schema: z.object({
165
- recipe: z.object({
166
- name: z.string(),
167
- ingredients: z.array(z.string()),
168
- steps: z.array(z.string()),
169
- }),
170
- }),
171
- prompt: 'Generate a recipe for chocolate chip cookies.',
173
+ messages: [
174
+ {
175
+ role: 'system',
176
+ content:
177
+ 'return ONLY valid JSON matching { name: string; ingredients: string[]; steps: string[] }',
178
+ },
179
+ { role: 'user', content: 'generate a lasagna recipe.' },
180
+ ],
181
+ temperature: 0,
172
182
  });
173
- ```
174
183
 
175
- **Returns:**
184
+ const parsed = JSON.parse(text);
185
+ const result = RecipeSchema.safeParse(parsed);
186
+
187
+ if (!result.success) {
188
+ // handle invalid JSON shape
189
+ }
176
190
 
177
- - `object` - Parsed object matching your schema
178
- - `usage` - Token usage information
191
+ console.log(result.success ? result.data : parsed);
192
+ ```
179
193
 
180
194
  ## Image Models
181
195
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runpod/ai-sdk-provider",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",