@ai-sdk/perplexity 5.0.3 → 5.0.5

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,24 @@
1
1
  # @ai-sdk/perplexity
2
2
 
3
+ ## 5.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [8c65988]
8
+ - Updated dependencies [527a163]
9
+ - @ai-sdk/provider@4.0.21
10
+ - @ai-sdk/provider-utils@5.0.53
11
+
12
+ ## 5.0.4
13
+
14
+ ### Patch Changes
15
+
16
+ - dabd5fa: Add Perplexity integration attribution to provider requests.
17
+ - ede5b89: chore: migrate package builds from tsup to tsdown
18
+ - Updated dependencies [ede5b89]
19
+ - @ai-sdk/provider@4.0.20
20
+ - @ai-sdk/provider-utils@5.0.52
21
+
3
22
  ## 5.0.3
4
23
 
5
24
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,170 +1,175 @@
1
- import { ProviderV4, LanguageModelV4, EmbeddingModelV4 } from '@ai-sdk/provider';
2
- import { FetchFunction } from '@ai-sdk/provider-utils';
3
- import { z } from 'zod/v4';
4
-
1
+ import { EmbeddingModelV4, LanguageModelV4, ProviderV4 } from "@ai-sdk/provider";
2
+ import { FetchFunction } from "@ai-sdk/provider-utils";
3
+ import { z } from "zod/v4";
4
+ //#region src/perplexity-embedding-model-options.d.ts
5
5
  type PerplexityEmbeddingModelId = 'pplx-embed-v1-0.6b' | 'pplx-embed-v1-4b' | (string & {});
6
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
- }>>;
7
+ dimensions: z.ZodOptional<z.ZodNumber>;
8
+ encodingFormat: z.ZodOptional<z.ZodEnum<{
9
+ base64_int8: "base64_int8";
10
+ base64_binary: "base64_binary";
11
+ }>>;
12
12
  }, z.core.$strip>;
13
13
  type PerplexityEmbeddingModelOptions = z.infer<typeof perplexityEmbeddingModelOptions>;
14
-
14
+ //#endregion
15
+ //#region src/perplexity-options.d.ts
15
16
  type PerplexityAgentPreset = 'fast' | 'low' | 'medium' | 'high' | 'xhigh';
16
17
  type PerplexityLanguageModelId = PerplexityAgentPreset | 'perplexity/sonar' | (string & {});
17
-
18
+ //#endregion
19
+ //#region src/perplexity-provider.d.ts
18
20
  interface PerplexityProvider extends ProviderV4 {
19
- /**
20
- * Creates a Perplexity Agent API model or preset for text generation.
21
- */
22
- (modelId: PerplexityLanguageModelId): LanguageModelV4;
23
- /**
24
- * Creates a Perplexity Agent API model or preset for text generation.
25
- */
26
- languageModel(modelId: PerplexityLanguageModelId): LanguageModelV4;
27
- /**
28
- * Creates a Perplexity model for text embeddings.
29
- */
30
- embedding(modelId: PerplexityEmbeddingModelId): EmbeddingModelV4;
31
- /**
32
- * Creates a Perplexity model for text embeddings.
33
- */
34
- embeddingModel(modelId: PerplexityEmbeddingModelId): EmbeddingModelV4;
35
- /**
36
- * @deprecated Use `embeddingModel` instead.
37
- */
38
- textEmbeddingModel(modelId: PerplexityEmbeddingModelId): EmbeddingModelV4;
21
+ /**
22
+ * Creates a Perplexity Agent API model or preset for text generation.
23
+ */
24
+ (modelId: PerplexityLanguageModelId): LanguageModelV4;
25
+ /**
26
+ * Creates a Perplexity Agent API model or preset for text generation.
27
+ */
28
+ languageModel(modelId: PerplexityLanguageModelId): LanguageModelV4;
29
+ /**
30
+ * Creates a Perplexity model for text embeddings.
31
+ */
32
+ embedding(modelId: PerplexityEmbeddingModelId): EmbeddingModelV4;
33
+ /**
34
+ * Creates a Perplexity model for text embeddings.
35
+ */
36
+ embeddingModel(modelId: PerplexityEmbeddingModelId): EmbeddingModelV4;
37
+ /**
38
+ * @deprecated Use `embeddingModel` instead.
39
+ */
40
+ textEmbeddingModel(modelId: PerplexityEmbeddingModelId): EmbeddingModelV4;
39
41
  }
40
42
  interface PerplexityProviderSettings {
41
- /**
42
- * Base URL for Perplexity API calls.
43
- */
44
- baseURL?: string;
45
- /**
46
- * API key for authenticating requests.
47
- */
48
- apiKey?: string;
49
- /**
50
- * Custom headers to include in the requests.
51
- */
52
- headers?: Record<string, string>;
53
- /**
54
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
55
- * or to provide a custom fetch implementation for e.g. testing.
56
- */
57
- fetch?: FetchFunction;
43
+ /**
44
+ * Base URL for Perplexity API calls.
45
+ */
46
+ baseURL?: string;
47
+ /**
48
+ * API key for authenticating requests.
49
+ */
50
+ apiKey?: string;
51
+ /**
52
+ * Custom headers to include in the requests.
53
+ */
54
+ headers?: Record<string, string>;
55
+ /**
56
+ * Custom fetch implementation. You can use it as a middleware to intercept requests,
57
+ * or to provide a custom fetch implementation for e.g. testing.
58
+ */
59
+ fetch?: FetchFunction;
58
60
  }
59
- declare function createPerplexity(options?: PerplexityProviderSettings): PerplexityProvider;
60
- declare const perplexity: PerplexityProvider;
61
-
61
+ export declare function createPerplexity(options?: PerplexityProviderSettings): PerplexityProvider;
62
+ export declare const perplexity: PerplexityProvider;
63
+ //#endregion
64
+ //#region src/perplexity-language-model-options.d.ts
62
65
  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
- }>>;
66
+ /** Top-level Agent API instructions. */
67
+ instructions: z.ZodOptional<z.ZodString>;
68
+ /**
69
+ * Native Agent API tools. AI SDK function tools can also be supplied through
70
+ * the top-level `tools` option on `generateText` and `streamText`.
71
+ */
72
+ tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
73
+ type: z.ZodLiteral<"web_search">;
74
+ filters: z.ZodOptional<z.ZodObject<{
75
+ search_domain_filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
76
+ search_recency_filter: z.ZodOptional<z.ZodEnum<{
77
+ hour: "hour";
78
+ day: "day";
79
+ week: "week";
80
+ month: "month";
81
+ year: "year";
82
+ }>>;
83
+ search_after_date_filter: z.ZodOptional<z.ZodString>;
84
+ search_before_date_filter: z.ZodOptional<z.ZodString>;
85
+ last_updated_after_filter: z.ZodOptional<z.ZodString>;
86
+ last_updated_before_filter: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$loose>>;
88
+ max_results: z.ZodOptional<z.ZodNumber>;
89
+ max_tokens: z.ZodOptional<z.ZodNumber>;
90
+ max_tokens_per_page: z.ZodOptional<z.ZodNumber>;
91
+ search_context_size: z.ZodOptional<z.ZodEnum<{
92
+ low: "low";
93
+ medium: "medium";
94
+ high: "high";
95
+ }>>;
96
+ user_location: z.ZodOptional<z.ZodObject<{
97
+ latitude: z.ZodOptional<z.ZodNumber>;
98
+ longitude: z.ZodOptional<z.ZodNumber>;
99
+ country: z.ZodOptional<z.ZodString>;
100
+ city: z.ZodOptional<z.ZodString>;
101
+ region: z.ZodOptional<z.ZodString>;
148
102
  }, 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>]>>>;
103
+ }, z.core.$loose>, z.ZodObject<{
104
+ type: z.ZodLiteral<"fetch_url">;
105
+ max_urls: z.ZodOptional<z.ZodNumber>;
106
+ }, z.core.$loose>, z.ZodObject<{
107
+ type: z.ZodLiteral<"people_search">;
108
+ }, z.core.$loose>, z.ZodObject<{
109
+ type: z.ZodLiteral<"finance_search">;
110
+ }, z.core.$loose>, z.ZodObject<{
111
+ type: z.ZodLiteral<"sandbox">;
112
+ }, z.core.$loose>, z.ZodObject<{
113
+ type: z.ZodLiteral<"mcp">;
114
+ server_label: z.ZodString;
115
+ server_url: z.ZodString;
116
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
+ authorization: z.ZodOptional<z.ZodString>;
118
+ defer_loading: z.ZodOptional<z.ZodBoolean>;
119
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
120
+ }, z.core.$loose>, z.ZodObject<{
121
+ type: z.ZodLiteral<"connector">;
122
+ id: z.ZodString;
123
+ server_label: z.ZodString;
124
+ server_description: z.ZodOptional<z.ZodString>;
125
+ allowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
126
+ }, z.core.$loose>]>>>;
127
+ /** A fallback model list for Agent API routing. */
128
+ models: z.ZodOptional<z.ZodArray<z.ZodString>>;
129
+ /** Maximum number of agentic steps. */
130
+ max_steps: z.ZodOptional<z.ZodNumber>;
131
+ /** Maximum number of native tool calls. */
132
+ max_tool_calls: z.ZodOptional<z.ZodNumber>;
133
+ /** Continue a conversation from an earlier Agent API response. */
134
+ previous_response_id: z.ZodOptional<z.ZodString>;
135
+ /**
136
+ * Whether the response can be retrieved later. Setting this to false does
137
+ * not disable persistence or prevent previous_response_id continuations.
138
+ */
139
+ store: z.ZodOptional<z.ZodBoolean>;
140
+ /** Preferred response language as an ISO 639-1 language code. */
141
+ language_preference: z.ZodOptional<z.ZodString>;
142
+ /** Agent API reasoning configuration. */
143
+ reasoning: z.ZodOptional<z.ZodObject<{
144
+ effort: z.ZodOptional<z.ZodEnum<{
145
+ low: "low";
146
+ medium: "medium";
147
+ high: "high";
148
+ minimal: "minimal";
149
+ xhigh: "xhigh";
150
+ }>>;
151
+ }, z.core.$loose>>;
152
+ /** Agent API skill configuration. */
153
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
154
+ type: z.ZodLiteral<"builtin">;
155
+ name: z.ZodEnum<{
156
+ office: "office";
157
+ "office/docx": "office/docx";
158
+ "office/pdf": "office/pdf";
159
+ "office/pptx": "office/pptx";
160
+ "office/xlsx": "office/xlsx";
161
+ }>;
162
+ }, z.core.$loose>, z.ZodObject<{
163
+ type: z.ZodLiteral<"inline">;
164
+ name: z.ZodString;
165
+ description: z.ZodString;
166
+ instructions: z.ZodString;
167
+ }, z.core.$loose>]>>>;
165
168
  }, z.core.$loose>;
166
169
  type PerplexityLanguageModelOptions = z.infer<typeof perplexityLanguageModelOptions>;
167
-
168
- declare const VERSION: string;
169
-
170
- export { type PerplexityAgentPreset, type PerplexityEmbeddingModelId, type PerplexityEmbeddingModelOptions, type PerplexityLanguageModelId, type PerplexityLanguageModelOptions, type PerplexityProvider, type PerplexityProviderSettings, VERSION, createPerplexity, perplexity };
170
+ //#endregion
171
+ //#region src/version.d.ts
172
+ export declare const VERSION: string;
173
+ //#endregion
174
+ export type { PerplexityAgentPreset, PerplexityEmbeddingModelId, PerplexityEmbeddingModelOptions, PerplexityLanguageModelId, PerplexityLanguageModelOptions, PerplexityProvider, PerplexityProviderSettings };
175
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/perplexity-embedding-model-options.ts","../src/perplexity-options.ts","../src/perplexity-provider.ts","../src/perplexity-language-model-options.ts","../src/version.ts"],"mappings":";;;;KAGY;cAKC,iCAA+B,EAAA;;;;;;GAe1C,EAAA,KAAA;KAEU,kCAAkC,EAAE,aACvC;;;KC1BG;KAOA,4BACR;;;UCWa,2BAA2B;;;;GAIzC,SAAS,4BAA4B;;;;EAKtC,cAAc,SAAS,4BAA4B;;;;EAKnD,UAAU,SAAS,6BAA6B;;;;EAKhD,eAAe,SAAS,6BAA6B;;;;EAKrD,mBAAmB,SAAS,6BAA6B;;UAG1C;;;;EAIf;;;;EAKA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;wBAGM,iBACd,UAAS,6BACR;qBAoDU,YAAU;;;cCjEV,gCAA8B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DzC,EAAA,KAAA;KAEU,iCAAiC,EAAE,aACtC;;;qBCxHI"}