lightnode-sdk 0.10.0 → 0.10.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/dist/inference.d.ts +4 -0
- package/dist/inference.js +3 -0
- package/package.json +1 -1
package/dist/inference.d.ts
CHANGED
|
@@ -158,6 +158,8 @@ export interface RunInferenceArgs {
|
|
|
158
158
|
network: NetworkConfig;
|
|
159
159
|
/** Inference model tag. Default: `"llama3-8b"`. */
|
|
160
160
|
model?: string;
|
|
161
|
+
/** Opt into worker-side web search (needs a search-capable worker). */
|
|
162
|
+
searchEnabled?: boolean;
|
|
161
163
|
/**
|
|
162
164
|
* Streaming callback invoked once per decrypted relay chunk. Use for live
|
|
163
165
|
* stdout / UI updates. Optional - the final `answer` is returned either way.
|
|
@@ -339,6 +341,8 @@ export interface RunInferenceWithKeyArgs {
|
|
|
339
341
|
prompt: string;
|
|
340
342
|
/** Inference model tag. Default: `"llama3-8b"`. */
|
|
341
343
|
model?: string;
|
|
344
|
+
/** Opt into worker-side web search (needs a search-capable worker). */
|
|
345
|
+
searchEnabled?: boolean;
|
|
342
346
|
/**
|
|
343
347
|
* Streaming callback invoked once per decrypted relay chunk. Use for live
|
|
344
348
|
* stdout / UI updates. Optional - the final `answer` is returned either way.
|
package/dist/inference.js
CHANGED
|
@@ -544,9 +544,11 @@ async function runOneAttempt(args, attempt) {
|
|
|
544
544
|
publicClient: args.publicClient,
|
|
545
545
|
network: args.network,
|
|
546
546
|
model: args.model,
|
|
547
|
+
...(args.searchEnabled ? { requiredCapabilities: ["search"] } : {}),
|
|
547
548
|
});
|
|
548
549
|
return runJobOnSession(session, args.prompt, {
|
|
549
550
|
onChunk: args.onChunk,
|
|
551
|
+
searchEnabled: args.searchEnabled,
|
|
550
552
|
jobCompletedTimeoutMs: args.jobCompletedTimeoutMs,
|
|
551
553
|
WebSocket: args.WebSocket,
|
|
552
554
|
relayUrl: args.relayUrl,
|
|
@@ -762,6 +764,7 @@ export async function runInferenceWithKey(args) {
|
|
|
762
764
|
publicClient: publicClient,
|
|
763
765
|
network,
|
|
764
766
|
model: args.model,
|
|
767
|
+
searchEnabled: args.searchEnabled,
|
|
765
768
|
onChunk: args.onChunk,
|
|
766
769
|
maxRetries: args.maxRetries,
|
|
767
770
|
jobCompletedTimeoutMs: args.jobCompletedTimeoutMs,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lightnode-sdk",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Read-only TypeScript client for LightChain AI: workers, jobs, models, on-chain registration, and per-model network analytics. Independent, community-built (not an official LightChain package).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|