@ai-sdk/perplexity 3.1.7 → 3.1.8

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,5 +1,14 @@
1
1
  # @ai-sdk/perplexity
2
2
 
3
+ ## 3.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - af9a8e5: Defer validation schema construction until first use to reduce provider import time.
8
+ - Updated dependencies [1183cc4]
9
+ - Updated dependencies [d726591]
10
+ - @ai-sdk/provider-utils@4.0.62
11
+
3
12
  ## 3.1.7
4
13
 
5
14
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,16 +1,13 @@
1
1
  import { ProviderV3, LanguageModelV3, EmbeddingModelV3 } from '@ai-sdk/provider';
2
- import { FetchFunction } from '@ai-sdk/provider-utils';
3
- import { z } from 'zod/v4';
2
+ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
+ import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
5
5
  type PerplexityEmbeddingModelId = 'pplx-embed-v1-0.6b' | 'pplx-embed-v1-4b' | (string & {});
6
- declare const perplexityEmbeddingModelOptions: z.ZodObject<{
7
- dimensions: z.ZodOptional<z.ZodNumber>;
8
- encodingFormat: z.ZodOptional<z.ZodEnum<{
9
- base64_int8: "base64_int8";
10
- base64_binary: "base64_binary";
11
- }>>;
12
- }, z.core.$strip>;
13
- type PerplexityEmbeddingModelOptions = z.infer<typeof perplexityEmbeddingModelOptions>;
6
+ declare const perplexityEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
7
+ dimensions?: number | undefined;
8
+ encodingFormat?: "base64_int8" | "base64_binary" | undefined;
9
+ }>;
10
+ type PerplexityEmbeddingModelOptions = InferSchema<typeof perplexityEmbeddingModelOptions>;
14
11
 
15
12
  type PerplexityAgentPreset = 'fast' | 'low' | 'medium' | 'high' | 'xhigh';
16
13
  type PerplexityLanguageModelId = PerplexityAgentPreset | 'perplexity/sonar' | (string & {});
@@ -59,111 +56,86 @@ interface PerplexityProviderSettings {
59
56
  declare function createPerplexity(options?: PerplexityProviderSettings): PerplexityProvider;
60
57
  declare const perplexity: PerplexityProvider;
61
58
 
62
- declare const perplexityLanguageModelOptions: z.ZodObject<{
63
- /** Top-level Agent API instructions. */
64
- instructions: z.ZodOptional<z.ZodString>;
65
- /**
66
- * Native Agent API tools. AI SDK function tools can also be supplied through
67
- * the top-level `tools` option on `generateText` and `streamText`.
68
- */
69
- tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
70
- type: z.ZodLiteral<"web_search">;
71
- filters: z.ZodOptional<z.ZodObject<{
72
- search_domain_filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
- search_recency_filter: z.ZodOptional<z.ZodEnum<{
74
- hour: "hour";
75
- day: "day";
76
- week: "week";
77
- month: "month";
78
- year: "year";
79
- }>>;
80
- search_after_date_filter: z.ZodOptional<z.ZodString>;
81
- search_before_date_filter: z.ZodOptional<z.ZodString>;
82
- last_updated_after_filter: z.ZodOptional<z.ZodString>;
83
- last_updated_before_filter: z.ZodOptional<z.ZodString>;
84
- }, z.core.$loose>>;
85
- max_results: z.ZodOptional<z.ZodNumber>;
86
- max_tokens: z.ZodOptional<z.ZodNumber>;
87
- max_tokens_per_page: z.ZodOptional<z.ZodNumber>;
88
- search_context_size: z.ZodOptional<z.ZodEnum<{
89
- low: "low";
90
- medium: "medium";
91
- high: "high";
92
- }>>;
93
- user_location: z.ZodOptional<z.ZodObject<{
94
- latitude: z.ZodOptional<z.ZodNumber>;
95
- longitude: z.ZodOptional<z.ZodNumber>;
96
- country: z.ZodOptional<z.ZodString>;
97
- city: z.ZodOptional<z.ZodString>;
98
- region: z.ZodOptional<z.ZodString>;
99
- }, z.core.$loose>>;
100
- }, z.core.$loose>, z.ZodObject<{
101
- type: z.ZodLiteral<"fetch_url">;
102
- max_urls: z.ZodOptional<z.ZodNumber>;
103
- }, z.core.$loose>, z.ZodObject<{
104
- type: z.ZodLiteral<"people_search">;
105
- }, z.core.$loose>, z.ZodObject<{
106
- type: z.ZodLiteral<"finance_search">;
107
- }, z.core.$loose>, z.ZodObject<{
108
- type: z.ZodLiteral<"sandbox">;
109
- }, z.core.$loose>, z.ZodObject<{
110
- type: z.ZodLiteral<"mcp">;
111
- server_label: z.ZodString;
112
- server_url: z.ZodString;
113
- allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
- authorization: z.ZodOptional<z.ZodString>;
115
- defer_loading: z.ZodOptional<z.ZodBoolean>;
116
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
117
- }, z.core.$loose>, z.ZodObject<{
118
- type: z.ZodLiteral<"connector">;
119
- id: z.ZodString;
120
- server_label: z.ZodString;
121
- server_description: z.ZodOptional<z.ZodString>;
122
- allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
- }, z.core.$loose>]>>>;
124
- /** A fallback model list for Agent API routing. */
125
- models: z.ZodOptional<z.ZodArray<z.ZodString>>;
126
- /** Maximum number of agentic steps. */
127
- max_steps: z.ZodOptional<z.ZodNumber>;
128
- /** Maximum number of native tool calls. */
129
- max_tool_calls: z.ZodOptional<z.ZodNumber>;
130
- /** Continue a conversation from an earlier Agent API response. */
131
- previous_response_id: z.ZodOptional<z.ZodString>;
132
- /**
133
- * Whether the response can be retrieved later. Setting this to false does
134
- * not disable persistence or prevent previous_response_id continuations.
135
- */
136
- store: z.ZodOptional<z.ZodBoolean>;
137
- /** Preferred response language as an ISO 639-1 language code. */
138
- language_preference: z.ZodOptional<z.ZodString>;
139
- /** Agent API reasoning configuration. */
140
- reasoning: z.ZodOptional<z.ZodObject<{
141
- effort: z.ZodOptional<z.ZodEnum<{
142
- low: "low";
143
- medium: "medium";
144
- high: "high";
145
- minimal: "minimal";
146
- xhigh: "xhigh";
147
- }>>;
148
- }, z.core.$loose>>;
149
- /** Agent API skill configuration. */
150
- skills: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
151
- type: z.ZodLiteral<"builtin">;
152
- name: z.ZodEnum<{
153
- office: "office";
154
- "office/docx": "office/docx";
155
- "office/pdf": "office/pdf";
156
- "office/pptx": "office/pptx";
157
- "office/xlsx": "office/xlsx";
158
- }>;
159
- }, z.core.$loose>, z.ZodObject<{
160
- type: z.ZodLiteral<"inline">;
161
- name: z.ZodString;
162
- description: z.ZodString;
163
- instructions: z.ZodString;
164
- }, z.core.$loose>]>>>;
165
- }, z.core.$loose>;
166
- type PerplexityLanguageModelOptions = z.infer<typeof perplexityLanguageModelOptions>;
59
+ declare const perplexityLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
60
+ [x: string]: unknown;
61
+ instructions?: string | undefined;
62
+ tools?: ({
63
+ [x: string]: unknown;
64
+ type: "web_search";
65
+ filters?: {
66
+ [x: string]: unknown;
67
+ search_domain_filter?: string[] | undefined;
68
+ search_recency_filter?: "hour" | "day" | "week" | "month" | "year" | undefined;
69
+ search_after_date_filter?: string | undefined;
70
+ search_before_date_filter?: string | undefined;
71
+ last_updated_after_filter?: string | undefined;
72
+ last_updated_before_filter?: string | undefined;
73
+ } | undefined;
74
+ max_results?: number | undefined;
75
+ max_tokens?: number | undefined;
76
+ max_tokens_per_page?: number | undefined;
77
+ search_context_size?: "low" | "medium" | "high" | undefined;
78
+ user_location?: {
79
+ [x: string]: unknown;
80
+ latitude?: number | undefined;
81
+ longitude?: number | undefined;
82
+ country?: string | undefined;
83
+ city?: string | undefined;
84
+ region?: string | undefined;
85
+ } | undefined;
86
+ } | {
87
+ [x: string]: unknown;
88
+ type: "fetch_url";
89
+ max_urls?: number | undefined;
90
+ } | {
91
+ [x: string]: unknown;
92
+ type: "people_search";
93
+ } | {
94
+ [x: string]: unknown;
95
+ type: "finance_search";
96
+ } | {
97
+ [x: string]: unknown;
98
+ type: "sandbox";
99
+ } | {
100
+ [x: string]: unknown;
101
+ type: "mcp";
102
+ server_label: string;
103
+ server_url: string;
104
+ allowed_tools?: string[] | undefined;
105
+ authorization?: string | undefined;
106
+ defer_loading?: boolean | undefined;
107
+ headers?: Record<string, string> | undefined;
108
+ } | {
109
+ [x: string]: unknown;
110
+ type: "connector";
111
+ id: string;
112
+ server_label: string;
113
+ server_description?: string | undefined;
114
+ allowed_tools?: string[] | undefined;
115
+ })[] | undefined;
116
+ models?: string[] | undefined;
117
+ max_steps?: number | undefined;
118
+ max_tool_calls?: number | undefined;
119
+ previous_response_id?: string | undefined;
120
+ store?: boolean | undefined;
121
+ language_preference?: string | undefined;
122
+ reasoning?: {
123
+ [x: string]: unknown;
124
+ effort?: "low" | "medium" | "high" | "minimal" | "xhigh" | undefined;
125
+ } | undefined;
126
+ skills?: ({
127
+ [x: string]: unknown;
128
+ type: "builtin";
129
+ name: "office" | "office/docx" | "office/pdf" | "office/pptx" | "office/xlsx";
130
+ } | {
131
+ [x: string]: unknown;
132
+ type: "inline";
133
+ name: string;
134
+ description: string;
135
+ instructions: string;
136
+ })[] | undefined;
137
+ }>;
138
+ type PerplexityLanguageModelOptions = InferSchema<typeof perplexityLanguageModelOptions>;
167
139
 
168
140
  declare const VERSION: string;
169
141
 
package/dist/index.d.ts CHANGED
@@ -1,16 +1,13 @@
1
1
  import { ProviderV3, LanguageModelV3, EmbeddingModelV3 } from '@ai-sdk/provider';
2
- import { FetchFunction } from '@ai-sdk/provider-utils';
3
- import { z } from 'zod/v4';
2
+ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
+ import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
5
5
  type PerplexityEmbeddingModelId = 'pplx-embed-v1-0.6b' | 'pplx-embed-v1-4b' | (string & {});
6
- declare const perplexityEmbeddingModelOptions: z.ZodObject<{
7
- dimensions: z.ZodOptional<z.ZodNumber>;
8
- encodingFormat: z.ZodOptional<z.ZodEnum<{
9
- base64_int8: "base64_int8";
10
- base64_binary: "base64_binary";
11
- }>>;
12
- }, z.core.$strip>;
13
- type PerplexityEmbeddingModelOptions = z.infer<typeof perplexityEmbeddingModelOptions>;
6
+ declare const perplexityEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
7
+ dimensions?: number | undefined;
8
+ encodingFormat?: "base64_int8" | "base64_binary" | undefined;
9
+ }>;
10
+ type PerplexityEmbeddingModelOptions = InferSchema<typeof perplexityEmbeddingModelOptions>;
14
11
 
15
12
  type PerplexityAgentPreset = 'fast' | 'low' | 'medium' | 'high' | 'xhigh';
16
13
  type PerplexityLanguageModelId = PerplexityAgentPreset | 'perplexity/sonar' | (string & {});
@@ -59,111 +56,86 @@ interface PerplexityProviderSettings {
59
56
  declare function createPerplexity(options?: PerplexityProviderSettings): PerplexityProvider;
60
57
  declare const perplexity: PerplexityProvider;
61
58
 
62
- declare const perplexityLanguageModelOptions: z.ZodObject<{
63
- /** Top-level Agent API instructions. */
64
- instructions: z.ZodOptional<z.ZodString>;
65
- /**
66
- * Native Agent API tools. AI SDK function tools can also be supplied through
67
- * the top-level `tools` option on `generateText` and `streamText`.
68
- */
69
- tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
70
- type: z.ZodLiteral<"web_search">;
71
- filters: z.ZodOptional<z.ZodObject<{
72
- search_domain_filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
- search_recency_filter: z.ZodOptional<z.ZodEnum<{
74
- hour: "hour";
75
- day: "day";
76
- week: "week";
77
- month: "month";
78
- year: "year";
79
- }>>;
80
- search_after_date_filter: z.ZodOptional<z.ZodString>;
81
- search_before_date_filter: z.ZodOptional<z.ZodString>;
82
- last_updated_after_filter: z.ZodOptional<z.ZodString>;
83
- last_updated_before_filter: z.ZodOptional<z.ZodString>;
84
- }, z.core.$loose>>;
85
- max_results: z.ZodOptional<z.ZodNumber>;
86
- max_tokens: z.ZodOptional<z.ZodNumber>;
87
- max_tokens_per_page: z.ZodOptional<z.ZodNumber>;
88
- search_context_size: z.ZodOptional<z.ZodEnum<{
89
- low: "low";
90
- medium: "medium";
91
- high: "high";
92
- }>>;
93
- user_location: z.ZodOptional<z.ZodObject<{
94
- latitude: z.ZodOptional<z.ZodNumber>;
95
- longitude: z.ZodOptional<z.ZodNumber>;
96
- country: z.ZodOptional<z.ZodString>;
97
- city: z.ZodOptional<z.ZodString>;
98
- region: z.ZodOptional<z.ZodString>;
99
- }, z.core.$loose>>;
100
- }, z.core.$loose>, z.ZodObject<{
101
- type: z.ZodLiteral<"fetch_url">;
102
- max_urls: z.ZodOptional<z.ZodNumber>;
103
- }, z.core.$loose>, z.ZodObject<{
104
- type: z.ZodLiteral<"people_search">;
105
- }, z.core.$loose>, z.ZodObject<{
106
- type: z.ZodLiteral<"finance_search">;
107
- }, z.core.$loose>, z.ZodObject<{
108
- type: z.ZodLiteral<"sandbox">;
109
- }, z.core.$loose>, z.ZodObject<{
110
- type: z.ZodLiteral<"mcp">;
111
- server_label: z.ZodString;
112
- server_url: z.ZodString;
113
- allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
- authorization: z.ZodOptional<z.ZodString>;
115
- defer_loading: z.ZodOptional<z.ZodBoolean>;
116
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
117
- }, z.core.$loose>, z.ZodObject<{
118
- type: z.ZodLiteral<"connector">;
119
- id: z.ZodString;
120
- server_label: z.ZodString;
121
- server_description: z.ZodOptional<z.ZodString>;
122
- allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
- }, z.core.$loose>]>>>;
124
- /** A fallback model list for Agent API routing. */
125
- models: z.ZodOptional<z.ZodArray<z.ZodString>>;
126
- /** Maximum number of agentic steps. */
127
- max_steps: z.ZodOptional<z.ZodNumber>;
128
- /** Maximum number of native tool calls. */
129
- max_tool_calls: z.ZodOptional<z.ZodNumber>;
130
- /** Continue a conversation from an earlier Agent API response. */
131
- previous_response_id: z.ZodOptional<z.ZodString>;
132
- /**
133
- * Whether the response can be retrieved later. Setting this to false does
134
- * not disable persistence or prevent previous_response_id continuations.
135
- */
136
- store: z.ZodOptional<z.ZodBoolean>;
137
- /** Preferred response language as an ISO 639-1 language code. */
138
- language_preference: z.ZodOptional<z.ZodString>;
139
- /** Agent API reasoning configuration. */
140
- reasoning: z.ZodOptional<z.ZodObject<{
141
- effort: z.ZodOptional<z.ZodEnum<{
142
- low: "low";
143
- medium: "medium";
144
- high: "high";
145
- minimal: "minimal";
146
- xhigh: "xhigh";
147
- }>>;
148
- }, z.core.$loose>>;
149
- /** Agent API skill configuration. */
150
- skills: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
151
- type: z.ZodLiteral<"builtin">;
152
- name: z.ZodEnum<{
153
- office: "office";
154
- "office/docx": "office/docx";
155
- "office/pdf": "office/pdf";
156
- "office/pptx": "office/pptx";
157
- "office/xlsx": "office/xlsx";
158
- }>;
159
- }, z.core.$loose>, z.ZodObject<{
160
- type: z.ZodLiteral<"inline">;
161
- name: z.ZodString;
162
- description: z.ZodString;
163
- instructions: z.ZodString;
164
- }, z.core.$loose>]>>>;
165
- }, z.core.$loose>;
166
- type PerplexityLanguageModelOptions = z.infer<typeof perplexityLanguageModelOptions>;
59
+ declare const perplexityLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
60
+ [x: string]: unknown;
61
+ instructions?: string | undefined;
62
+ tools?: ({
63
+ [x: string]: unknown;
64
+ type: "web_search";
65
+ filters?: {
66
+ [x: string]: unknown;
67
+ search_domain_filter?: string[] | undefined;
68
+ search_recency_filter?: "hour" | "day" | "week" | "month" | "year" | undefined;
69
+ search_after_date_filter?: string | undefined;
70
+ search_before_date_filter?: string | undefined;
71
+ last_updated_after_filter?: string | undefined;
72
+ last_updated_before_filter?: string | undefined;
73
+ } | undefined;
74
+ max_results?: number | undefined;
75
+ max_tokens?: number | undefined;
76
+ max_tokens_per_page?: number | undefined;
77
+ search_context_size?: "low" | "medium" | "high" | undefined;
78
+ user_location?: {
79
+ [x: string]: unknown;
80
+ latitude?: number | undefined;
81
+ longitude?: number | undefined;
82
+ country?: string | undefined;
83
+ city?: string | undefined;
84
+ region?: string | undefined;
85
+ } | undefined;
86
+ } | {
87
+ [x: string]: unknown;
88
+ type: "fetch_url";
89
+ max_urls?: number | undefined;
90
+ } | {
91
+ [x: string]: unknown;
92
+ type: "people_search";
93
+ } | {
94
+ [x: string]: unknown;
95
+ type: "finance_search";
96
+ } | {
97
+ [x: string]: unknown;
98
+ type: "sandbox";
99
+ } | {
100
+ [x: string]: unknown;
101
+ type: "mcp";
102
+ server_label: string;
103
+ server_url: string;
104
+ allowed_tools?: string[] | undefined;
105
+ authorization?: string | undefined;
106
+ defer_loading?: boolean | undefined;
107
+ headers?: Record<string, string> | undefined;
108
+ } | {
109
+ [x: string]: unknown;
110
+ type: "connector";
111
+ id: string;
112
+ server_label: string;
113
+ server_description?: string | undefined;
114
+ allowed_tools?: string[] | undefined;
115
+ })[] | undefined;
116
+ models?: string[] | undefined;
117
+ max_steps?: number | undefined;
118
+ max_tool_calls?: number | undefined;
119
+ previous_response_id?: string | undefined;
120
+ store?: boolean | undefined;
121
+ language_preference?: string | undefined;
122
+ reasoning?: {
123
+ [x: string]: unknown;
124
+ effort?: "low" | "medium" | "high" | "minimal" | "xhigh" | undefined;
125
+ } | undefined;
126
+ skills?: ({
127
+ [x: string]: unknown;
128
+ type: "builtin";
129
+ name: "office" | "office/docx" | "office/pdf" | "office/pptx" | "office/xlsx";
130
+ } | {
131
+ [x: string]: unknown;
132
+ type: "inline";
133
+ name: string;
134
+ description: string;
135
+ instructions: string;
136
+ })[] | undefined;
137
+ }>;
138
+ type PerplexityLanguageModelOptions = InferSchema<typeof perplexityLanguageModelOptions>;
167
139
 
168
140
  declare const VERSION: string;
169
141