@openclaw/perplexity-plugin 2026.9.2 → 2026.9.4
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/dist/index.js +1 -1
- package/dist/{perplexity-web-search-provider-APW6MQ72.js → perplexity-web-search-provider-qKc3Hnoh.js} +1 -1
- package/dist/{perplexity-web-search-provider.runtime-CYQXm2j8.js → perplexity-web-search-provider.runtime-B9EP0fZ-.js} +30 -51
- package/dist/web-search-contract-api.js +1 -1
- package/dist/web-search-provider.js +1 -1
- package/openclaw.plugin.json +1 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createPerplexityWebSearchProvider } from "./perplexity-web-search-provider-
|
|
1
|
+
import { t as createPerplexityWebSearchProvider } from "./perplexity-web-search-provider-qKc3Hnoh.js";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
3
|
//#region extensions/perplexity/index.ts
|
|
4
4
|
var perplexity_default = definePluginEntry({
|
|
@@ -72,7 +72,7 @@ function resolvePerplexityRuntime(perplexity, auth) {
|
|
|
72
72
|
}
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region extensions/perplexity/src/perplexity-web-search-provider.ts
|
|
75
|
-
const loadPerplexityWebSearchRuntime = createLazyRuntimeModule(() => import("./perplexity-web-search-provider.runtime-
|
|
75
|
+
const loadPerplexityWebSearchRuntime = createLazyRuntimeModule(() => import("./perplexity-web-search-provider.runtime-B9EP0fZ-.js"));
|
|
76
76
|
function createPerplexityParameters(transport) {
|
|
77
77
|
const properties = {
|
|
78
78
|
query: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as resolvePerplexityRuntime, n as isDirectPerplexityBaseUrl, r as resolvePerplexityConfig } from "./perplexity-web-search-provider-
|
|
1
|
+
import { i as resolvePerplexityRuntime, n as isDirectPerplexityBaseUrl, r as resolvePerplexityConfig } from "./perplexity-web-search-provider-qKc3Hnoh.js";
|
|
2
2
|
import { normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
4
4
|
import { DEFAULT_SEARCH_COUNT, MAX_SEARCH_COUNT, buildSearchCacheKey, isoToPerplexityDate, normalizeFreshness, parseWebSearchTimeFilters, readCachedSearchPayload, readConfiguredSecretString, readPositiveIntegerParam, readProviderEnvValue, readStringArrayParam, readStringParam, resolveSearchCacheTtlMs, resolveSearchCount, resolveSearchTimeoutSeconds, resolveSiteName, throwWebSearchApiError, withTrustedWebSearchEndpoint, wrapWebContent, writeCachedSearchPayload } from "openclaw/plugin-sdk/provider-web-search";
|
|
@@ -243,36 +243,37 @@ async function executePerplexitySearch(args, searchConfig, signal) {
|
|
|
243
243
|
if (cached) return cached;
|
|
244
244
|
const start = Date.now();
|
|
245
245
|
const timeoutSeconds = resolveSearchTimeoutSeconds(searchConfig);
|
|
246
|
-
const
|
|
246
|
+
const result = runtime.transport === "chat_completions" ? await runPerplexitySearch({
|
|
247
247
|
query,
|
|
248
|
-
|
|
248
|
+
apiKey: runtime.apiKey,
|
|
249
|
+
baseUrl: runtime.baseUrl,
|
|
249
250
|
model: runtime.model,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
251
|
+
timeoutSeconds,
|
|
252
|
+
signal,
|
|
253
|
+
freshness
|
|
254
|
+
}) : await runPerplexitySearchApi({
|
|
255
|
+
query,
|
|
256
|
+
apiKey: runtime.apiKey,
|
|
257
|
+
count: resolveSearchCount(count, DEFAULT_SEARCH_COUNT),
|
|
258
|
+
timeoutSeconds,
|
|
259
|
+
signal,
|
|
260
|
+
country: country ?? void 0,
|
|
261
|
+
searchDomainFilter: domainFilter,
|
|
262
|
+
searchRecencyFilter: freshness,
|
|
263
|
+
searchLanguageFilter: language ? [language] : void 0,
|
|
264
|
+
searchAfterDate: dateAfter ? isoToPerplexityDate(dateAfter) : void 0,
|
|
265
|
+
searchBeforeDate: dateBefore ? isoToPerplexityDate(dateBefore) : void 0,
|
|
266
|
+
maxTokens: maxTokens ?? void 0,
|
|
267
|
+
maxTokensPerPage: maxTokensPerPage ?? void 0
|
|
268
|
+
});
|
|
269
|
+
const resultFields = Array.isArray(result) ? { results: result } : {
|
|
270
|
+
content: wrapWebContent(result.content, "web_search"),
|
|
271
|
+
citations: result.citations
|
|
272
|
+
};
|
|
273
|
+
const payload = {
|
|
273
274
|
query,
|
|
274
275
|
provider: "perplexity",
|
|
275
|
-
count:
|
|
276
|
+
...Array.isArray(result) ? { count: result.length } : { model: runtime.model },
|
|
276
277
|
tookMs: Date.now() - start,
|
|
277
278
|
externalContent: {
|
|
278
279
|
untrusted: true,
|
|
@@ -280,33 +281,11 @@ async function executePerplexitySearch(args, searchConfig, signal) {
|
|
|
280
281
|
provider: "perplexity",
|
|
281
282
|
wrapped: true
|
|
282
283
|
},
|
|
283
|
-
|
|
284
|
-
query,
|
|
285
|
-
apiKey: runtime.apiKey,
|
|
286
|
-
count: resolveSearchCount(count, DEFAULT_SEARCH_COUNT),
|
|
287
|
-
timeoutSeconds,
|
|
288
|
-
signal,
|
|
289
|
-
country: country ?? void 0,
|
|
290
|
-
searchDomainFilter: domainFilter,
|
|
291
|
-
searchRecencyFilter: freshness,
|
|
292
|
-
searchLanguageFilter: language ? [language] : void 0,
|
|
293
|
-
searchAfterDate: dateAfter ? isoToPerplexityDate(dateAfter) : void 0,
|
|
294
|
-
searchBeforeDate: dateBefore ? isoToPerplexityDate(dateBefore) : void 0,
|
|
295
|
-
maxTokens: maxTokens ?? void 0,
|
|
296
|
-
maxTokensPerPage: maxTokensPerPage ?? void 0
|
|
297
|
-
})
|
|
284
|
+
...resultFields
|
|
298
285
|
};
|
|
299
|
-
if (Array.isArray(payload.results)) {
|
|
300
|
-
payload.count = payload.results.length;
|
|
301
|
-
payload.tookMs = Date.now() - start;
|
|
302
|
-
} else payload.tookMs = Date.now() - start;
|
|
303
286
|
signal?.throwIfAborted();
|
|
304
287
|
writeCachedSearchPayload(cacheKey, payload, cacheTtlMs);
|
|
305
288
|
return payload;
|
|
306
289
|
}
|
|
307
|
-
const testing = {
|
|
308
|
-
resolvePerplexityRequestModel,
|
|
309
|
-
resolvePerplexityApiKey
|
|
310
|
-
};
|
|
311
290
|
//#endregion
|
|
312
|
-
export { executePerplexitySearch
|
|
291
|
+
export { executePerplexitySearch };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as createPerplexityWebSearchProvider } from "./perplexity-web-search-provider-
|
|
1
|
+
import { t as createPerplexityWebSearchProvider } from "./perplexity-web-search-provider-qKc3Hnoh.js";
|
|
2
2
|
import "./web-search-provider.js";
|
|
3
3
|
export { createPerplexityWebSearchProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createPerplexityWebSearchProvider } from "./perplexity-web-search-provider-
|
|
1
|
+
import { t as createPerplexityWebSearchProvider } from "./perplexity-web-search-provider-qKc3Hnoh.js";
|
|
2
2
|
export { createPerplexityWebSearchProvider };
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/perplexity-plugin",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.4",
|
|
4
4
|
"description": "OpenClaw Perplexity plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.8"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.9.
|
|
21
|
+
"pluginApi": ">=2026.9.4"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.9.
|
|
24
|
+
"openclawVersion": "2026.9.4",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"README.md"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"openclaw": ">=2026.9.
|
|
41
|
+
"openclaw": ">=2026.9.4"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"openclaw": {
|