Skip to content

Commit 73356a9

Browse files
authoredApr 30, 2024
Rename AI core functions & types (remove experimental) (#1353)
1 parent d2bc2aa commit 73356a9

File tree

89 files changed

+333
-316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+333
-316
lines changed
 

‎.changeset/tiny-carpets-breathe.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'ai': minor
3+
---
4+
5+
Move AI Core functions out of experimental (streamText, generateText, streamObject, generateObject).

‎docs/pages/docs/ai-core/generate-object.mdx

+7-8
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ title: generateObject API
44

55
import { Callout } from 'nextra-theme-docs';
66

7-
# experimental_generateObject
7+
# generateObject
88

99
Generate a typed, structured object for a given prompt and [Zod](https://zod.dev/) schema using a language model.
1010

1111
You can use `generateObject` to force the language model to return structured data, e.g. for information extraction,
1212
synthetic data generation, or classification tasks.
1313

1414
```ts
15-
import { experimental_generateObject } from 'ai';
15+
import { generateObject } from 'ai';
1616

17-
const { object } = await experimental_generateObject({
17+
const { object } = await generateObject({
1818
model,
1919
schema: z.object({
2020
recipe: z.object({
@@ -33,14 +33,13 @@ const { object } = await experimental_generateObject({
3333
```
3434

3535
<Callout type="info">
36-
`experimental_generateObject` does not stream the output. If you want to
37-
stream the output, use
38-
[`experimental_streamObject`](/docs/ai-core/stream-object).
36+
`generateObject` does not stream the output. If you want to stream the output,
37+
use [`streamObject`](/docs/ai-core/stream-object).
3938
</Callout>
4039

4140
## Parameters
4241

43-
The parameters are passed into `experimental_streamText` as a single options object.
42+
The parameters are passed into `streamText` as a single options object.
4443

4544
- **model** - The language model to use.
4645
- **schema** - A [Zod](https://zod.dev/) schema that describes the expected output structure.
@@ -82,7 +81,7 @@ The parameters are passed into `experimental_streamText` as a single options obj
8281
### Basic call
8382

8483
```ts
85-
const { object } = await experimental_generateObject({
84+
const { object } = await generateObject({
8685
model,
8786
schema: z.object({
8887
recipe: z.object({

0 commit comments

Comments
 (0)