@ai-sdk/perplexity 2.1.0-beta.9 → 2.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/CHANGELOG.md CHANGED
@@ -1,94 +1,280 @@
1
1
  # @ai-sdk/perplexity
2
2
 
3
- ## 2.1.0-beta.9
3
+ ## 2.1.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [521c537]
8
- - @ai-sdk/provider-utils@3.1.0-beta.9
7
+ - Updated dependencies [14810cb]
8
+ - @ai-sdk/provider-utils@3.0.40
9
9
 
10
- ## 2.1.0-beta.8
10
+ ## 2.1.0
11
+
12
+ ### Minor Changes
13
+
14
+ - 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.
15
+
16
+ ## 2.0.45
11
17
 
12
18
  ### Patch Changes
13
19
 
14
- - Updated dependencies [e06565c]
15
- - @ai-sdk/provider-utils@3.1.0-beta.8
20
+ - bf29419: chore: enable dead code lint rules
21
+ - Updated dependencies [bf29419]
22
+ - @ai-sdk/provider-utils@3.0.39
16
23
 
17
- ## 2.1.0-beta.7
24
+ ## 2.0.44
18
25
 
19
26
  ### Patch Changes
20
27
 
21
- - Updated dependencies [046aa3b]
22
- - Updated dependencies [e8109d3]
23
- - @ai-sdk/provider@2.1.0-beta.5
24
- - @ai-sdk/provider-utils@3.1.0-beta.7
28
+ - Updated dependencies [594787e]
29
+ - @ai-sdk/provider@2.0.5
30
+ - @ai-sdk/provider-utils@3.0.38
25
31
 
26
- ## 2.1.0-beta.6
32
+ ## 2.0.43
27
33
 
28
34
  ### Patch Changes
29
35
 
30
- - Updated dependencies [0adc679]
31
- - Updated dependencies [2b0caef]
32
- - @ai-sdk/provider-utils@3.1.0-beta.6
33
- - @ai-sdk/provider@2.1.0-beta.4
36
+ - Updated dependencies [c2089a9]
37
+ - Updated dependencies [ab3990f]
38
+ - @ai-sdk/provider@2.0.4
39
+ - @ai-sdk/provider-utils@3.0.37
34
40
 
35
- ## 2.1.0-beta.5
41
+ ## 2.0.42
36
42
 
37
43
  ### Patch Changes
38
44
 
39
- - 8dac895: feat: `LanguageModelV3`
40
- - 10c1322: fix: moved dependency `@ai-sdk/test-server` to devDependencies
41
- - Updated dependencies [8dac895]
42
- - @ai-sdk/provider-utils@3.1.0-beta.5
43
- - @ai-sdk/provider@2.1.0-beta.3
45
+ - Updated dependencies [26165ee]
46
+ - @ai-sdk/provider-utils@3.0.36
44
47
 
45
- ## 2.1.0-beta.4
48
+ ## 2.0.41
46
49
 
47
50
  ### Patch Changes
48
51
 
49
- - 4616b86: chore: update zod peer depenedency version
50
- - Updated dependencies [4616b86]
51
- - @ai-sdk/provider-utils@3.1.0-beta.4
52
+ - Updated dependencies [77d33c0]
53
+ - @ai-sdk/provider-utils@3.0.35
52
54
 
53
- ## 2.1.0-beta.3
55
+ ## 2.0.40
54
56
 
55
57
  ### Patch Changes
56
58
 
57
- - ed329cb: feat: `Provider-V3`
58
- - Updated dependencies [ed329cb]
59
- - Updated dependencies [522f6b8]
60
- - @ai-sdk/provider@2.1.0-beta.2
61
- - @ai-sdk/provider-utils@3.1.0-beta.3
59
+ - Updated dependencies [2fff9f1]
60
+ - Updated dependencies [f364ea0]
61
+ - @ai-sdk/provider-utils@3.0.34
62
62
 
63
- ## 2.1.0-beta.2
63
+ ## 2.0.39
64
64
 
65
65
  ### Patch Changes
66
66
 
67
- - 1cad0ab: feat: add provider version to user-agent header
68
- - Updated dependencies [0c4822d]
69
- - @ai-sdk/provider@2.1.0-beta.1
70
- - @ai-sdk/provider-utils@3.1.0-beta.2
67
+ - Updated dependencies [9e8e087]
68
+ - @ai-sdk/provider-utils@3.0.33
71
69
 
72
- ## 2.1.0-beta.1
70
+ ## 2.0.38
73
71
 
74
72
  ### Patch Changes
75
73
 
76
- - Updated dependencies [953d0f2]
77
- - Updated dependencies [cbb1d35]
78
- - @ai-sdk/test-server@1.0.0-beta.0
79
- - @ai-sdk/provider-utils@3.1.0-beta.1
74
+ - Updated dependencies [0e51b7b]
75
+ - @ai-sdk/provider-utils@3.0.32
80
76
 
81
- ## 2.1.0-beta.0
77
+ ## 2.0.37
82
78
 
83
- ### Minor Changes
79
+ ### Patch Changes
80
+
81
+ - Updated dependencies [7a6bdbc]
82
+ - @ai-sdk/provider-utils@3.0.31
83
+
84
+ ## 2.0.36
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [2fd6076]
89
+ - @ai-sdk/provider-utils@3.0.30
90
+
91
+ ## 2.0.35
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies [c6e1d1a]
96
+ - @ai-sdk/provider-utils@3.0.29
97
+
98
+ ## 2.0.34
99
+
100
+ ### Patch Changes
101
+
102
+ - 509f1c6: Fix Perplexity prompt conversion for file parts with unsupported media types and top-level PDF media types.
103
+
104
+ ## 2.0.33
105
+
106
+ ### Patch Changes
107
+
108
+ - Updated dependencies [b85c4fb]
109
+ - @ai-sdk/provider-utils@3.0.28
110
+
111
+ ## 2.0.32
112
+
113
+ ### Patch Changes
114
+
115
+ - Updated dependencies [9169261]
116
+ - @ai-sdk/provider-utils@3.0.27
117
+
118
+ ## 2.0.31
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [9f67efe]
123
+ - Updated dependencies [eea9166]
124
+ - @ai-sdk/provider-utils@3.0.26
125
+
126
+ ## 2.0.30
127
+
128
+ ### Patch Changes
129
+
130
+ - 783fa6c: chore: ensure consistent import handling and avoid import duplicates or cycles
131
+ - Updated dependencies [783fa6c]
132
+ - @ai-sdk/provider-utils@3.0.25
133
+ - @ai-sdk/provider@2.0.3
134
+
135
+ ## 2.0.29
136
+
137
+ ### Patch Changes
138
+
139
+ - 0a00b9b: trigger release for all packages after provenance setup
140
+ - Updated dependencies [0a00b9b]
141
+ - @ai-sdk/provider@2.0.2
142
+ - @ai-sdk/provider-utils@3.0.24
143
+
144
+ ## 2.0.28
145
+
146
+ ### Patch Changes
147
+
148
+ - 5543cd1: Add AI Gateway hint to provider READMEs
149
+
150
+ ## 2.0.27
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies [a27a978]
155
+ - @ai-sdk/provider-utils@3.0.23
156
+
157
+ ## 2.0.26
158
+
159
+ ### Patch Changes
160
+
161
+ - e70fd60: feat(perplexity): expose provider-reported cost in providerMetadata
162
+
163
+ ## 2.0.25
164
+
165
+ ### Patch Changes
166
+
167
+ - Updated dependencies [6a2f01b]
168
+ - Updated dependencies [17d64e3]
169
+ - @ai-sdk/provider-utils@3.0.22
170
+
171
+ ## 2.0.24
172
+
173
+ ### Patch Changes
174
+
175
+ - Updated dependencies [20565b8]
176
+ - @ai-sdk/provider-utils@3.0.21
177
+
178
+ ## 2.0.23
179
+
180
+ ### Patch Changes
181
+
182
+ - 526fe8d: fix: trigger new release for `@ai-v5` dist-tag
183
+ - Updated dependencies [526fe8d]
184
+ - @ai-sdk/provider@2.0.1
185
+ - @ai-sdk/provider-utils@3.0.20
186
+
187
+ ## 2.0.22
188
+
189
+ ### Patch Changes
190
+
191
+ - Updated dependencies [ef6d784]
192
+ - @ai-sdk/provider-utils@3.0.19
193
+
194
+ ## 2.0.21
195
+
196
+ ### Patch Changes
197
+
198
+ - Updated dependencies [d1dbe5d]
199
+ - @ai-sdk/provider-utils@3.0.18
200
+
201
+ ## 2.0.20
202
+
203
+ ### Patch Changes
204
+
205
+ - 7b99331: feat (provider/perplexity): add reasoning tokens
206
+
207
+ ## 2.0.19
208
+
209
+ ### Patch Changes
210
+
211
+ - Updated dependencies [056c471]
212
+ - @ai-sdk/provider-utils@3.0.17
213
+
214
+ ## 2.0.18
215
+
216
+ ### Patch Changes
217
+
218
+ - ee28981: Add PDF support to Perplexity provider
219
+
220
+ ## 2.0.17
221
+
222
+ ### Patch Changes
223
+
224
+ - 51aa5de: backport: test server
225
+ - Updated dependencies [51aa5de]
226
+ - @ai-sdk/provider-utils@3.0.16
227
+
228
+ ## 2.0.16
229
+
230
+ ### Patch Changes
231
+
232
+ - Updated dependencies [f2da310]
233
+ - @ai-sdk/provider-utils@3.0.15
234
+
235
+ ## 2.0.15
236
+
237
+ ### Patch Changes
238
+
239
+ - Updated dependencies [949718b]
240
+ - @ai-sdk/provider-utils@3.0.14
241
+
242
+ ## 2.0.14
243
+
244
+ ### Patch Changes
245
+
246
+ - Updated dependencies [1e05490]
247
+ - @ai-sdk/provider-utils@3.0.13
248
+
249
+ ## 2.0.13
250
+
251
+ ### Patch Changes
252
+
253
+ - Updated dependencies [17f9872]
254
+ - @ai-sdk/provider-utils@3.0.12
255
+
256
+ ## 2.0.12
257
+
258
+ ### Patch Changes
259
+
260
+ - 6f0644c: chore: use import \* from zod/v4
261
+ - Updated dependencies [6f0644c]
262
+ - Updated dependencies [6f0644c]
263
+ - @ai-sdk/provider-utils@3.0.11
264
+
265
+ ## 2.0.11
266
+
267
+ ### Patch Changes
268
+
269
+ - bc5ed71: chore: update zod peer depenedency version
270
+ - Updated dependencies [bc5ed71]
271
+ - @ai-sdk/provider-utils@3.0.10
84
272
 
85
- - 78928cb: release: start 5.1 beta
273
+ ## 2.0.10
86
274
 
87
275
  ### Patch Changes
88
276
 
89
- - Updated dependencies [78928cb]
90
- - @ai-sdk/provider@2.1.0-beta.0
91
- - @ai-sdk/provider-utils@3.1.0-beta.0
277
+ - 322901b: feat: add provider version to user-agent header
92
278
 
93
279
  ## 2.0.9
94
280
 
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 };