@openclaw/perplexity-plugin 2026.8.1-beta.2 → 2026.8.1-beta.3
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-BZTwy6bO.js → perplexity-web-search-provider-CSYSs8kt.js} +1 -1
- package/dist/{perplexity-web-search-provider.runtime-CMXrHVHO.js → perplexity-web-search-provider.runtime-CDJXALXh.js} +7 -9
- package/dist/web-search-provider.js +1 -1
- 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-CSYSs8kt.js";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
3
|
//#region extensions/perplexity/index.ts
|
|
4
4
|
var perplexity_default = definePluginEntry({
|
|
@@ -3,7 +3,7 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
|
3
3
|
import { mergeScopedSearchConfig, resolveProviderWebSearchPluginConfig } from "openclaw/plugin-sdk/provider-web-search-config-contract";
|
|
4
4
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/perplexity/src/perplexity-web-search-provider.ts
|
|
6
|
-
const loadPerplexityWebSearchRuntime = createLazyRuntimeModule(() => import("./perplexity-web-search-provider.runtime-
|
|
6
|
+
const loadPerplexityWebSearchRuntime = createLazyRuntimeModule(() => import("./perplexity-web-search-provider.runtime-CDJXALXh.js"));
|
|
7
7
|
function createPerplexityParameters(transport) {
|
|
8
8
|
const properties = {
|
|
9
9
|
query: {
|
|
@@ -54,9 +54,6 @@ function buildPerplexityRequestHeaders(apiKey, acceptJson = false) {
|
|
|
54
54
|
"X-Title": "OpenClaw Web Search"
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
async function readPerplexityJsonResponse(response, label) {
|
|
58
|
-
return await readProviderJsonResponse(response, label);
|
|
59
|
-
}
|
|
60
57
|
function resolvePerplexityTransport(perplexity) {
|
|
61
58
|
const auth = resolvePerplexityApiKey(perplexity);
|
|
62
59
|
const baseUrl = resolvePerplexityBaseUrl(perplexity, auth.source, auth.apiKey);
|
|
@@ -104,7 +101,7 @@ async function runPerplexitySearchApi(params) {
|
|
|
104
101
|
}
|
|
105
102
|
}, async (res) => {
|
|
106
103
|
if (!res.ok) return await throwWebSearchApiError(res, "Perplexity Search");
|
|
107
|
-
return ((await
|
|
104
|
+
return ((await readProviderJsonResponse(res, "Perplexity Search")).results ?? []).map((entry) => ({
|
|
108
105
|
title: entry.title ? wrapWebContent(entry.title, "web_search") : "",
|
|
109
106
|
url: entry.url ?? "",
|
|
110
107
|
description: entry.snippet ? wrapWebContent(entry.snippet, "web_search") : "",
|
|
@@ -134,9 +131,11 @@ async function runPerplexitySearch(params) {
|
|
|
134
131
|
}
|
|
135
132
|
}, async (res) => {
|
|
136
133
|
if (!res.ok) return await throwWebSearchApiError(res, "Perplexity");
|
|
137
|
-
const data = await
|
|
134
|
+
const data = await readProviderJsonResponse(res, "Perplexity");
|
|
135
|
+
const content = data.choices?.[0]?.message?.content;
|
|
136
|
+
if (typeof content !== "string" || !content.trim()) throw new Error("Perplexity search returned no final answer. Retry the query or choose another search provider.");
|
|
138
137
|
return {
|
|
139
|
-
content
|
|
138
|
+
content,
|
|
140
139
|
citations: extractPerplexityCitations(data)
|
|
141
140
|
};
|
|
142
141
|
});
|
|
@@ -245,7 +244,7 @@ async function executePerplexitySearch(args, searchConfig, signal) {
|
|
|
245
244
|
runtime.baseUrl,
|
|
246
245
|
runtime.model,
|
|
247
246
|
query,
|
|
248
|
-
resolveSearchCount(count, DEFAULT_SEARCH_COUNT),
|
|
247
|
+
structured ? resolveSearchCount(count, DEFAULT_SEARCH_COUNT) : void 0,
|
|
249
248
|
country,
|
|
250
249
|
language,
|
|
251
250
|
freshness,
|
|
@@ -326,8 +325,7 @@ const testing = {
|
|
|
326
325
|
resolvePerplexityModel,
|
|
327
326
|
resolvePerplexityTransport,
|
|
328
327
|
resolvePerplexityRequestModel,
|
|
329
|
-
resolvePerplexityApiKey
|
|
330
|
-
readPerplexityJsonResponse
|
|
328
|
+
resolvePerplexityApiKey
|
|
331
329
|
};
|
|
332
330
|
//#endregion
|
|
333
331
|
export { executePerplexitySearch, testing };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createPerplexityWebSearchProvider } from "./perplexity-web-search-provider-
|
|
1
|
+
import { t as createPerplexityWebSearchProvider } from "./perplexity-web-search-provider-CSYSs8kt.js";
|
|
2
2
|
export { createPerplexityWebSearchProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/perplexity-plugin",
|
|
3
|
-
"version": "2026.8.1-beta.
|
|
3
|
+
"version": "2026.8.1-beta.3",
|
|
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.8.1-beta.
|
|
21
|
+
"pluginApi": ">=2026.8.1-beta.3"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.8.1-beta.
|
|
24
|
+
"openclawVersion": "2026.8.1-beta.3",
|
|
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.8.1-beta.
|
|
41
|
+
"openclaw": ">=2026.8.1-beta.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"openclaw": {
|