@ai-sdk/perplexity 2.1.0-beta.8 → 2.1.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/CHANGELOG.md CHANGED
@@ -1,87 +1,273 @@
1
1
  # @ai-sdk/perplexity
2
2
 
3
- ## 2.1.0-beta.8
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9e05839: BREAKING: Migrate language generation from the Sonar Chat Completions API (supported by Perplexity only until September 27, 2026) to the Agent API. Replace Sonar model IDs and provider options with Agent API presets, models, and tools. The new API changes request and response metadata, raw stream events, usage and cost data, and does not support Sonar PDF input or image and video results. Reasoning effort is configured through `providerOptions.perplexity.reasoning`. Agent API stream events with `null` fields are accepted.
8
+
9
+ ## 2.0.45
4
10
 
5
11
  ### Patch Changes
6
12
 
7
- - Updated dependencies [e06565c]
8
- - @ai-sdk/provider-utils@3.1.0-beta.8
13
+ - bf29419: chore: enable dead code lint rules
14
+ - Updated dependencies [bf29419]
15
+ - @ai-sdk/provider-utils@3.0.39
9
16
 
10
- ## 2.1.0-beta.7
17
+ ## 2.0.44
11
18
 
12
19
  ### Patch Changes
13
20
 
14
- - Updated dependencies [046aa3b]
15
- - Updated dependencies [e8109d3]
16
- - @ai-sdk/provider@2.1.0-beta.5
17
- - @ai-sdk/provider-utils@3.1.0-beta.7
21
+ - Updated dependencies [594787e]
22
+ - @ai-sdk/provider@2.0.5
23
+ - @ai-sdk/provider-utils@3.0.38
18
24
 
19
- ## 2.1.0-beta.6
25
+ ## 2.0.43
20
26
 
21
27
  ### Patch Changes
22
28
 
23
- - Updated dependencies [0adc679]
24
- - Updated dependencies [2b0caef]
25
- - @ai-sdk/provider-utils@3.1.0-beta.6
26
- - @ai-sdk/provider@2.1.0-beta.4
29
+ - Updated dependencies [c2089a9]
30
+ - Updated dependencies [ab3990f]
31
+ - @ai-sdk/provider@2.0.4
32
+ - @ai-sdk/provider-utils@3.0.37
27
33
 
28
- ## 2.1.0-beta.5
34
+ ## 2.0.42
29
35
 
30
36
  ### Patch Changes
31
37
 
32
- - 8dac895: feat: `LanguageModelV3`
33
- - 10c1322: fix: moved dependency `@ai-sdk/test-server` to devDependencies
34
- - Updated dependencies [8dac895]
35
- - @ai-sdk/provider-utils@3.1.0-beta.5
36
- - @ai-sdk/provider@2.1.0-beta.3
38
+ - Updated dependencies [26165ee]
39
+ - @ai-sdk/provider-utils@3.0.36
37
40
 
38
- ## 2.1.0-beta.4
41
+ ## 2.0.41
39
42
 
40
43
  ### Patch Changes
41
44
 
42
- - 4616b86: chore: update zod peer depenedency version
43
- - Updated dependencies [4616b86]
44
- - @ai-sdk/provider-utils@3.1.0-beta.4
45
+ - Updated dependencies [77d33c0]
46
+ - @ai-sdk/provider-utils@3.0.35
45
47
 
46
- ## 2.1.0-beta.3
48
+ ## 2.0.40
47
49
 
48
50
  ### Patch Changes
49
51
 
50
- - ed329cb: feat: `Provider-V3`
51
- - Updated dependencies [ed329cb]
52
- - Updated dependencies [522f6b8]
53
- - @ai-sdk/provider@2.1.0-beta.2
54
- - @ai-sdk/provider-utils@3.1.0-beta.3
52
+ - Updated dependencies [2fff9f1]
53
+ - Updated dependencies [f364ea0]
54
+ - @ai-sdk/provider-utils@3.0.34
55
55
 
56
- ## 2.1.0-beta.2
56
+ ## 2.0.39
57
57
 
58
58
  ### Patch Changes
59
59
 
60
- - 1cad0ab: feat: add provider version to user-agent header
61
- - Updated dependencies [0c4822d]
62
- - @ai-sdk/provider@2.1.0-beta.1
63
- - @ai-sdk/provider-utils@3.1.0-beta.2
60
+ - Updated dependencies [9e8e087]
61
+ - @ai-sdk/provider-utils@3.0.33
64
62
 
65
- ## 2.1.0-beta.1
63
+ ## 2.0.38
66
64
 
67
65
  ### Patch Changes
68
66
 
69
- - Updated dependencies [953d0f2]
70
- - Updated dependencies [cbb1d35]
71
- - @ai-sdk/test-server@1.0.0-beta.0
72
- - @ai-sdk/provider-utils@3.1.0-beta.1
67
+ - Updated dependencies [0e51b7b]
68
+ - @ai-sdk/provider-utils@3.0.32
73
69
 
74
- ## 2.1.0-beta.0
70
+ ## 2.0.37
75
71
 
76
- ### Minor Changes
72
+ ### Patch Changes
73
+
74
+ - Updated dependencies [7a6bdbc]
75
+ - @ai-sdk/provider-utils@3.0.31
76
+
77
+ ## 2.0.36
78
+
79
+ ### Patch Changes
80
+
81
+ - Updated dependencies [2fd6076]
82
+ - @ai-sdk/provider-utils@3.0.30
83
+
84
+ ## 2.0.35
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [c6e1d1a]
89
+ - @ai-sdk/provider-utils@3.0.29
90
+
91
+ ## 2.0.34
92
+
93
+ ### Patch Changes
94
+
95
+ - 509f1c6: Fix Perplexity prompt conversion for file parts with unsupported media types and top-level PDF media types.
96
+
97
+ ## 2.0.33
98
+
99
+ ### Patch Changes
100
+
101
+ - Updated dependencies [b85c4fb]
102
+ - @ai-sdk/provider-utils@3.0.28
103
+
104
+ ## 2.0.32
105
+
106
+ ### Patch Changes
107
+
108
+ - Updated dependencies [9169261]
109
+ - @ai-sdk/provider-utils@3.0.27
110
+
111
+ ## 2.0.31
112
+
113
+ ### Patch Changes
114
+
115
+ - Updated dependencies [9f67efe]
116
+ - Updated dependencies [eea9166]
117
+ - @ai-sdk/provider-utils@3.0.26
118
+
119
+ ## 2.0.30
120
+
121
+ ### Patch Changes
122
+
123
+ - 783fa6c: chore: ensure consistent import handling and avoid import duplicates or cycles
124
+ - Updated dependencies [783fa6c]
125
+ - @ai-sdk/provider-utils@3.0.25
126
+ - @ai-sdk/provider@2.0.3
127
+
128
+ ## 2.0.29
129
+
130
+ ### Patch Changes
131
+
132
+ - 0a00b9b: trigger release for all packages after provenance setup
133
+ - Updated dependencies [0a00b9b]
134
+ - @ai-sdk/provider@2.0.2
135
+ - @ai-sdk/provider-utils@3.0.24
136
+
137
+ ## 2.0.28
138
+
139
+ ### Patch Changes
140
+
141
+ - 5543cd1: Add AI Gateway hint to provider READMEs
142
+
143
+ ## 2.0.27
144
+
145
+ ### Patch Changes
146
+
147
+ - Updated dependencies [a27a978]
148
+ - @ai-sdk/provider-utils@3.0.23
149
+
150
+ ## 2.0.26
151
+
152
+ ### Patch Changes
153
+
154
+ - e70fd60: feat(perplexity): expose provider-reported cost in providerMetadata
155
+
156
+ ## 2.0.25
157
+
158
+ ### Patch Changes
159
+
160
+ - Updated dependencies [6a2f01b]
161
+ - Updated dependencies [17d64e3]
162
+ - @ai-sdk/provider-utils@3.0.22
163
+
164
+ ## 2.0.24
165
+
166
+ ### Patch Changes
167
+
168
+ - Updated dependencies [20565b8]
169
+ - @ai-sdk/provider-utils@3.0.21
170
+
171
+ ## 2.0.23
172
+
173
+ ### Patch Changes
174
+
175
+ - 526fe8d: fix: trigger new release for `@ai-v5` dist-tag
176
+ - Updated dependencies [526fe8d]
177
+ - @ai-sdk/provider@2.0.1
178
+ - @ai-sdk/provider-utils@3.0.20
179
+
180
+ ## 2.0.22
181
+
182
+ ### Patch Changes
183
+
184
+ - Updated dependencies [ef6d784]
185
+ - @ai-sdk/provider-utils@3.0.19
186
+
187
+ ## 2.0.21
188
+
189
+ ### Patch Changes
190
+
191
+ - Updated dependencies [d1dbe5d]
192
+ - @ai-sdk/provider-utils@3.0.18
193
+
194
+ ## 2.0.20
195
+
196
+ ### Patch Changes
197
+
198
+ - 7b99331: feat (provider/perplexity): add reasoning tokens
199
+
200
+ ## 2.0.19
201
+
202
+ ### Patch Changes
203
+
204
+ - Updated dependencies [056c471]
205
+ - @ai-sdk/provider-utils@3.0.17
206
+
207
+ ## 2.0.18
208
+
209
+ ### Patch Changes
210
+
211
+ - ee28981: Add PDF support to Perplexity provider
212
+
213
+ ## 2.0.17
214
+
215
+ ### Patch Changes
216
+
217
+ - 51aa5de: backport: test server
218
+ - Updated dependencies [51aa5de]
219
+ - @ai-sdk/provider-utils@3.0.16
220
+
221
+ ## 2.0.16
222
+
223
+ ### Patch Changes
224
+
225
+ - Updated dependencies [f2da310]
226
+ - @ai-sdk/provider-utils@3.0.15
227
+
228
+ ## 2.0.15
229
+
230
+ ### Patch Changes
231
+
232
+ - Updated dependencies [949718b]
233
+ - @ai-sdk/provider-utils@3.0.14
234
+
235
+ ## 2.0.14
236
+
237
+ ### Patch Changes
238
+
239
+ - Updated dependencies [1e05490]
240
+ - @ai-sdk/provider-utils@3.0.13
241
+
242
+ ## 2.0.13
243
+
244
+ ### Patch Changes
245
+
246
+ - Updated dependencies [17f9872]
247
+ - @ai-sdk/provider-utils@3.0.12
248
+
249
+ ## 2.0.12
250
+
251
+ ### Patch Changes
252
+
253
+ - 6f0644c: chore: use import \* from zod/v4
254
+ - Updated dependencies [6f0644c]
255
+ - Updated dependencies [6f0644c]
256
+ - @ai-sdk/provider-utils@3.0.11
257
+
258
+ ## 2.0.11
259
+
260
+ ### Patch Changes
261
+
262
+ - bc5ed71: chore: update zod peer depenedency version
263
+ - Updated dependencies [bc5ed71]
264
+ - @ai-sdk/provider-utils@3.0.10
77
265
 
78
- - 78928cb: release: start 5.1 beta
266
+ ## 2.0.10
79
267
 
80
268
  ### Patch Changes
81
269
 
82
- - Updated dependencies [78928cb]
83
- - @ai-sdk/provider@2.1.0-beta.0
84
- - @ai-sdk/provider-utils@3.1.0-beta.0
270
+ - 322901b: feat: add provider version to user-agent header
85
271
 
86
272
  ## 2.0.9
87
273
 
package/README.md CHANGED
@@ -1,18 +1,17 @@
1
1
  # AI SDK - Perplexity Provider
2
2
 
3
3
  The **[Perplexity provider](https://ai-sdk.dev/providers/ai-sdk-providers/perplexity)** for the [AI SDK](https://ai-sdk.dev/docs)
4
- contains language model support for Perplexity's Sonar API - a powerful answer engine with real-time web search capabilities.
4
+ contains language model support for Perplexity's Agent API, including web search, citations, function tools, and structured output.
5
5
 
6
6
  ## Features
7
7
 
8
8
  - Real-time web search grounding for accurate, up-to-date responses
9
- - Support for advanced queries and follow-up questions
10
- - Multiple tiers available:
11
- - **Sonar Pro**: Enhanced capabilities for complex tasks with 2x more citations
12
- - **Sonar**: Lightweight offering optimized for speed and cost
13
- - Industry-leading answer quality
14
- - Data privacy - no training on customer data
15
- - Self-serve API access with scalable pricing
9
+ - Agent API presets from `fast` through `xhigh`
10
+ - Direct access to supported third-party models through Perplexity
11
+ - Native tools for web search, URL fetching, code execution, finance, MCP, and connectors
12
+ - AI SDK function tools, structured output, reasoning streams, and multi-turn tool calls
13
+
14
+ > **Deploying to Vercel?** With Vercel's AI Gateway you can access Perplexity (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
16
15
 
17
16
  ## Setup
18
17
 
@@ -37,11 +36,23 @@ import { perplexity } from '@ai-sdk/perplexity';
37
36
  import { generateText } from 'ai';
38
37
 
39
38
  const { text } = await generateText({
40
- model: perplexity('sonar-pro'),
39
+ model: perplexity('low'),
41
40
  prompt: 'What are the latest developments in quantum computing?',
42
41
  });
43
42
  ```
44
43
 
44
+ Version 2.1.0 is a breaking migration from Sonar Chat Completions to the Agent
45
+ API. Legacy Sonar model IDs and provider options are not mapped. Review the
46
+ [migration notes](https://ai-sdk.dev/providers/ai-sdk-providers/perplexity#migrating-from-v4-sonar-to-v5-agent-api)
47
+ before upgrading an existing application (the notes refer to the Sonar-based
48
+ releases as v4 and the Agent API releases as v5; for AI SDK 5 these are
49
+ 2.0.45 and earlier, and 2.1.0 and later).
50
+
51
+ Perplexity supports Sonar Chat Completions only until September 27, 2026.
52
+ Remaining on version 2.0.45 or earlier will not preserve language generation
53
+ after that date.
54
+ Migrate unsupported Sonar features using the alternatives in the migration notes.
55
+
45
56
  ## Documentation
46
57
 
47
58
  Please check out the **[Perplexity provider documentation](https://ai-sdk.dev/providers/ai-sdk-providers/perplexity)** for more information.
package/dist/index.d.mts CHANGED
@@ -1,21 +1,23 @@
1
- import { ProviderV3, LanguageModelV3 } from '@ai-sdk/provider';
1
+ import { ProviderV2, LanguageModelV2 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
+ import { z } from 'zod/v4';
3
4
 
4
- type PerplexityLanguageModelId = 'sonar-deep-research' | 'sonar-reasoning-pro' | 'sonar-reasoning' | 'sonar-pro' | 'sonar' | (string & {});
5
+ type PerplexityAgentPreset = 'fast' | 'low' | 'medium' | 'high' | 'xhigh';
6
+ type PerplexityLanguageModelId = PerplexityAgentPreset | 'perplexity/sonar' | (string & {});
5
7
 
6
- interface PerplexityProvider extends ProviderV3 {
8
+ interface PerplexityProvider extends ProviderV2 {
7
9
  /**
8
- Creates an Perplexity chat model for text generation.
10
+ Creates a Perplexity Agent API model or preset for text generation.
9
11
  */
10
- (modelId: PerplexityLanguageModelId): LanguageModelV3;
12
+ (modelId: PerplexityLanguageModelId): LanguageModelV2;
11
13
  /**
12
- Creates an Perplexity language model for text generation.
14
+ Creates a Perplexity Agent API model or preset for text generation.
13
15
  */
14
- languageModel(modelId: PerplexityLanguageModelId): LanguageModelV3;
16
+ languageModel(modelId: PerplexityLanguageModelId): LanguageModelV2;
15
17
  }
16
18
  interface PerplexityProviderSettings {
17
19
  /**
18
- Base URL for the perplexity API calls.
20
+ Base URL for Perplexity API calls.
19
21
  */
20
22
  baseURL?: string;
21
23
  /**
@@ -35,6 +37,112 @@ interface PerplexityProviderSettings {
35
37
  declare function createPerplexity(options?: PerplexityProviderSettings): PerplexityProvider;
36
38
  declare const perplexity: PerplexityProvider;
37
39
 
40
+ declare const perplexityLanguageModelOptions: z.ZodObject<{
41
+ /** Top-level Agent API instructions. */
42
+ instructions: z.ZodOptional<z.ZodString>;
43
+ /**
44
+ * Native Agent API tools. AI SDK function tools can also be supplied through
45
+ * the top-level `tools` option on `generateText` and `streamText`.
46
+ */
47
+ tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
+ type: z.ZodLiteral<"web_search">;
49
+ filters: z.ZodOptional<z.ZodObject<{
50
+ search_domain_filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
51
+ search_recency_filter: z.ZodOptional<z.ZodEnum<{
52
+ hour: "hour";
53
+ day: "day";
54
+ week: "week";
55
+ month: "month";
56
+ year: "year";
57
+ }>>;
58
+ search_after_date_filter: z.ZodOptional<z.ZodString>;
59
+ search_before_date_filter: z.ZodOptional<z.ZodString>;
60
+ last_updated_after_filter: z.ZodOptional<z.ZodString>;
61
+ last_updated_before_filter: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$loose>>;
63
+ max_results: z.ZodOptional<z.ZodNumber>;
64
+ max_tokens: z.ZodOptional<z.ZodNumber>;
65
+ max_tokens_per_page: z.ZodOptional<z.ZodNumber>;
66
+ search_context_size: z.ZodOptional<z.ZodEnum<{
67
+ low: "low";
68
+ medium: "medium";
69
+ high: "high";
70
+ }>>;
71
+ user_location: z.ZodOptional<z.ZodObject<{
72
+ latitude: z.ZodOptional<z.ZodNumber>;
73
+ longitude: z.ZodOptional<z.ZodNumber>;
74
+ country: z.ZodOptional<z.ZodString>;
75
+ city: z.ZodOptional<z.ZodString>;
76
+ region: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$loose>>;
78
+ }, z.core.$loose>, z.ZodObject<{
79
+ type: z.ZodLiteral<"fetch_url">;
80
+ max_urls: z.ZodOptional<z.ZodNumber>;
81
+ }, z.core.$loose>, z.ZodObject<{
82
+ type: z.ZodLiteral<"people_search">;
83
+ }, z.core.$loose>, z.ZodObject<{
84
+ type: z.ZodLiteral<"finance_search">;
85
+ }, z.core.$loose>, z.ZodObject<{
86
+ type: z.ZodLiteral<"sandbox">;
87
+ }, z.core.$loose>, z.ZodObject<{
88
+ type: z.ZodLiteral<"mcp">;
89
+ server_label: z.ZodString;
90
+ server_url: z.ZodString;
91
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
92
+ authorization: z.ZodOptional<z.ZodString>;
93
+ defer_loading: z.ZodOptional<z.ZodBoolean>;
94
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
95
+ }, z.core.$loose>, z.ZodObject<{
96
+ type: z.ZodLiteral<"connector">;
97
+ id: z.ZodString;
98
+ server_label: z.ZodString;
99
+ server_description: z.ZodOptional<z.ZodString>;
100
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
101
+ }, z.core.$loose>]>>>;
102
+ /** A fallback model list for Agent API routing. */
103
+ models: z.ZodOptional<z.ZodArray<z.ZodString>>;
104
+ /** Maximum number of agentic steps. */
105
+ max_steps: z.ZodOptional<z.ZodNumber>;
106
+ /** Maximum number of native tool calls. */
107
+ max_tool_calls: z.ZodOptional<z.ZodNumber>;
108
+ /** Continue a conversation from an earlier Agent API response. */
109
+ previous_response_id: z.ZodOptional<z.ZodString>;
110
+ /**
111
+ * Whether the response can be retrieved later. Setting this to false does
112
+ * not disable persistence or prevent previous_response_id continuations.
113
+ */
114
+ store: z.ZodOptional<z.ZodBoolean>;
115
+ /** Preferred response language as an ISO 639-1 language code. */
116
+ language_preference: z.ZodOptional<z.ZodString>;
117
+ /** Agent API reasoning configuration. */
118
+ reasoning: z.ZodOptional<z.ZodObject<{
119
+ effort: z.ZodOptional<z.ZodEnum<{
120
+ low: "low";
121
+ medium: "medium";
122
+ high: "high";
123
+ minimal: "minimal";
124
+ xhigh: "xhigh";
125
+ }>>;
126
+ }, z.core.$loose>>;
127
+ /** Agent API skill configuration. */
128
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
129
+ type: z.ZodLiteral<"builtin">;
130
+ name: z.ZodEnum<{
131
+ office: "office";
132
+ "office/docx": "office/docx";
133
+ "office/pdf": "office/pdf";
134
+ "office/pptx": "office/pptx";
135
+ "office/xlsx": "office/xlsx";
136
+ }>;
137
+ }, z.core.$loose>, z.ZodObject<{
138
+ type: z.ZodLiteral<"inline">;
139
+ name: z.ZodString;
140
+ description: z.ZodString;
141
+ instructions: z.ZodString;
142
+ }, z.core.$loose>]>>>;
143
+ }, z.core.$loose>;
144
+ type PerplexityLanguageModelOptions = z.infer<typeof perplexityLanguageModelOptions>;
145
+
38
146
  declare const VERSION: string;
39
147
 
40
- export { type PerplexityProvider, type PerplexityProviderSettings, VERSION, createPerplexity, perplexity };
148
+ export { type PerplexityAgentPreset, type PerplexityLanguageModelId, type PerplexityLanguageModelOptions, type PerplexityProvider, type PerplexityProviderSettings, VERSION, createPerplexity, perplexity };
package/dist/index.d.ts CHANGED
@@ -1,21 +1,23 @@
1
- import { ProviderV3, LanguageModelV3 } from '@ai-sdk/provider';
1
+ import { ProviderV2, LanguageModelV2 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
+ import { z } from 'zod/v4';
3
4
 
4
- type PerplexityLanguageModelId = 'sonar-deep-research' | 'sonar-reasoning-pro' | 'sonar-reasoning' | 'sonar-pro' | 'sonar' | (string & {});
5
+ type PerplexityAgentPreset = 'fast' | 'low' | 'medium' | 'high' | 'xhigh';
6
+ type PerplexityLanguageModelId = PerplexityAgentPreset | 'perplexity/sonar' | (string & {});
5
7
 
6
- interface PerplexityProvider extends ProviderV3 {
8
+ interface PerplexityProvider extends ProviderV2 {
7
9
  /**
8
- Creates an Perplexity chat model for text generation.
10
+ Creates a Perplexity Agent API model or preset for text generation.
9
11
  */
10
- (modelId: PerplexityLanguageModelId): LanguageModelV3;
12
+ (modelId: PerplexityLanguageModelId): LanguageModelV2;
11
13
  /**
12
- Creates an Perplexity language model for text generation.
14
+ Creates a Perplexity Agent API model or preset for text generation.
13
15
  */
14
- languageModel(modelId: PerplexityLanguageModelId): LanguageModelV3;
16
+ languageModel(modelId: PerplexityLanguageModelId): LanguageModelV2;
15
17
  }
16
18
  interface PerplexityProviderSettings {
17
19
  /**
18
- Base URL for the perplexity API calls.
20
+ Base URL for Perplexity API calls.
19
21
  */
20
22
  baseURL?: string;
21
23
  /**
@@ -35,6 +37,112 @@ interface PerplexityProviderSettings {
35
37
  declare function createPerplexity(options?: PerplexityProviderSettings): PerplexityProvider;
36
38
  declare const perplexity: PerplexityProvider;
37
39
 
40
+ declare const perplexityLanguageModelOptions: z.ZodObject<{
41
+ /** Top-level Agent API instructions. */
42
+ instructions: z.ZodOptional<z.ZodString>;
43
+ /**
44
+ * Native Agent API tools. AI SDK function tools can also be supplied through
45
+ * the top-level `tools` option on `generateText` and `streamText`.
46
+ */
47
+ tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
+ type: z.ZodLiteral<"web_search">;
49
+ filters: z.ZodOptional<z.ZodObject<{
50
+ search_domain_filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
51
+ search_recency_filter: z.ZodOptional<z.ZodEnum<{
52
+ hour: "hour";
53
+ day: "day";
54
+ week: "week";
55
+ month: "month";
56
+ year: "year";
57
+ }>>;
58
+ search_after_date_filter: z.ZodOptional<z.ZodString>;
59
+ search_before_date_filter: z.ZodOptional<z.ZodString>;
60
+ last_updated_after_filter: z.ZodOptional<z.ZodString>;
61
+ last_updated_before_filter: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$loose>>;
63
+ max_results: z.ZodOptional<z.ZodNumber>;
64
+ max_tokens: z.ZodOptional<z.ZodNumber>;
65
+ max_tokens_per_page: z.ZodOptional<z.ZodNumber>;
66
+ search_context_size: z.ZodOptional<z.ZodEnum<{
67
+ low: "low";
68
+ medium: "medium";
69
+ high: "high";
70
+ }>>;
71
+ user_location: z.ZodOptional<z.ZodObject<{
72
+ latitude: z.ZodOptional<z.ZodNumber>;
73
+ longitude: z.ZodOptional<z.ZodNumber>;
74
+ country: z.ZodOptional<z.ZodString>;
75
+ city: z.ZodOptional<z.ZodString>;
76
+ region: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$loose>>;
78
+ }, z.core.$loose>, z.ZodObject<{
79
+ type: z.ZodLiteral<"fetch_url">;
80
+ max_urls: z.ZodOptional<z.ZodNumber>;
81
+ }, z.core.$loose>, z.ZodObject<{
82
+ type: z.ZodLiteral<"people_search">;
83
+ }, z.core.$loose>, z.ZodObject<{
84
+ type: z.ZodLiteral<"finance_search">;
85
+ }, z.core.$loose>, z.ZodObject<{
86
+ type: z.ZodLiteral<"sandbox">;
87
+ }, z.core.$loose>, z.ZodObject<{
88
+ type: z.ZodLiteral<"mcp">;
89
+ server_label: z.ZodString;
90
+ server_url: z.ZodString;
91
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
92
+ authorization: z.ZodOptional<z.ZodString>;
93
+ defer_loading: z.ZodOptional<z.ZodBoolean>;
94
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
95
+ }, z.core.$loose>, z.ZodObject<{
96
+ type: z.ZodLiteral<"connector">;
97
+ id: z.ZodString;
98
+ server_label: z.ZodString;
99
+ server_description: z.ZodOptional<z.ZodString>;
100
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
101
+ }, z.core.$loose>]>>>;
102
+ /** A fallback model list for Agent API routing. */
103
+ models: z.ZodOptional<z.ZodArray<z.ZodString>>;
104
+ /** Maximum number of agentic steps. */
105
+ max_steps: z.ZodOptional<z.ZodNumber>;
106
+ /** Maximum number of native tool calls. */
107
+ max_tool_calls: z.ZodOptional<z.ZodNumber>;
108
+ /** Continue a conversation from an earlier Agent API response. */
109
+ previous_response_id: z.ZodOptional<z.ZodString>;
110
+ /**
111
+ * Whether the response can be retrieved later. Setting this to false does
112
+ * not disable persistence or prevent previous_response_id continuations.
113
+ */
114
+ store: z.ZodOptional<z.ZodBoolean>;
115
+ /** Preferred response language as an ISO 639-1 language code. */
116
+ language_preference: z.ZodOptional<z.ZodString>;
117
+ /** Agent API reasoning configuration. */
118
+ reasoning: z.ZodOptional<z.ZodObject<{
119
+ effort: z.ZodOptional<z.ZodEnum<{
120
+ low: "low";
121
+ medium: "medium";
122
+ high: "high";
123
+ minimal: "minimal";
124
+ xhigh: "xhigh";
125
+ }>>;
126
+ }, z.core.$loose>>;
127
+ /** Agent API skill configuration. */
128
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
129
+ type: z.ZodLiteral<"builtin">;
130
+ name: z.ZodEnum<{
131
+ office: "office";
132
+ "office/docx": "office/docx";
133
+ "office/pdf": "office/pdf";
134
+ "office/pptx": "office/pptx";
135
+ "office/xlsx": "office/xlsx";
136
+ }>;
137
+ }, z.core.$loose>, z.ZodObject<{
138
+ type: z.ZodLiteral<"inline">;
139
+ name: z.ZodString;
140
+ description: z.ZodString;
141
+ instructions: z.ZodString;
142
+ }, z.core.$loose>]>>>;
143
+ }, z.core.$loose>;
144
+ type PerplexityLanguageModelOptions = z.infer<typeof perplexityLanguageModelOptions>;
145
+
38
146
  declare const VERSION: string;
39
147
 
40
- export { type PerplexityProvider, type PerplexityProviderSettings, VERSION, createPerplexity, perplexity };
148
+ export { type PerplexityAgentPreset, type PerplexityLanguageModelId, type PerplexityLanguageModelOptions, type PerplexityProvider, type PerplexityProviderSettings, VERSION, createPerplexity, perplexity };