@fetchbrain.com/sdk 0.10.0 → 0.11.0
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/README.md +20 -8
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/mock/index.d.mts +1 -1
- package/dist/mock/index.d.ts +1 -1
- package/dist/{types-BCbMwaYW.d.mts → types-BgqTjfAN.d.mts} +11 -0
- package/dist/{types-BCbMwaYW.d.ts → types-BgqTjfAN.d.ts} +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -433,20 +433,32 @@ console.log(res.sources); // scored sources
|
|
|
433
433
|
```
|
|
434
434
|
|
|
435
435
|
Pick the model that writes the answer with `model` — the default is Gemma 4
|
|
436
|
-
26B (`"gemma-4-26b"`,
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
dashboard
|
|
436
|
+
26B (`"gemma-4-26b"`, 1 Ask credit, on every plan). Larger models use more
|
|
437
|
+
Ask credits per answer — `"llama-3.3-70b"` uses 2 on every plan; `"qwen3.8-27b"`
|
|
438
|
+
(3) and `"glm-5.3"` (5) need a paid plan — and `"byok"` answers with your own
|
|
439
|
+
linked provider model (configured in the dashboard, billed to your provider,
|
|
440
|
+
1 Ask credit). The dashboard's model picker shows each model's credits.
|
|
441
441
|
|
|
442
442
|
```typescript
|
|
443
443
|
const res = await client.ask("blue widgets under $50", {
|
|
444
444
|
answer: true,
|
|
445
|
-
model: "llama-3.3-70b", // or "
|
|
445
|
+
model: "llama-3.3-70b", // or "glm-5.3" / "byok" on paid plans
|
|
446
446
|
});
|
|
447
|
-
console.log(res.model);
|
|
447
|
+
console.log(res.model); // slug actually used
|
|
448
|
+
console.log(res.credits); // Ask credits this ask used
|
|
449
|
+
console.log(res.fallback); // "busy" | "unavailable" when the default answered instead
|
|
448
450
|
```
|
|
449
451
|
|
|
452
|
+
If the model you picked is busy or unavailable, the default model answers
|
|
453
|
+
instead and `fallback` says why; you're charged the default's credits.
|
|
454
|
+
|
|
455
|
+
With `model: "byok"` (your own linked model), FetchBrain never answers with
|
|
456
|
+
its own models. If your provider fails, you get the `sources` without an
|
|
457
|
+
`answer`, `fallback: "provider_error"`, and a `code`: `BYOK_KEY_INVALID`
|
|
458
|
+
(update your key), `BYOK_PROVIDER_BUSY` (rate-limited) or
|
|
459
|
+
`BYOK_PROVIDER_FAILED`. The ask still costs 1 credit. Your question and the
|
|
460
|
+
matching sources are sent to your provider under your agreement with them.
|
|
461
|
+
|
|
450
462
|
An answer can take tens of seconds, so `ask()` waits up to 60s by default.
|
|
451
463
|
Change that for every call with the `askTimeout` option, or for one call
|
|
452
464
|
with `timeout` (ms), which wins over `askTimeout`. Both accept 1 to 2147483647 ms
|
|
@@ -837,7 +849,7 @@ It depends on where they run. Memory is always private to your account.
|
|
|
837
849
|
`FETCHBRAIN_SCRAPER_ID` (see [Name your scraper](#name-your-scraper-scraper)).
|
|
838
850
|
- **A named scraper** (anywhere, including Apify) only sees its own memory.
|
|
839
851
|
- **Ask Your Brain in the dashboard** (and `ask()` calls with no platform
|
|
840
|
-
context) answers across
|
|
852
|
+
context) answers across every page Ask can read in your account.
|
|
841
853
|
|
|
842
854
|
**What leaves my process?**
|
|
843
855
|
Your requests (minus `Authorization`, `Cookie` and `Set-Cookie` headers),
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FetchBrainConfig, R as RawRequest, a as RecallResult, L as LearnedData, b as LearnResponse, S as StatsResponse, A as AskResponse, C as ChangeStats, c as RunReport, d as RunFlag, e as CircuitState, T as TelemetryData, f as TelemetryConfig, g as CircuitBreakerConfig, h as Logger, B as BatchConfig, i as LogLevel } from './types-
|
|
2
|
-
export { p as ChangeDetectionConfig, D as DriftItem, m as LearnRequest, o as LogUrlRequest, M as MemoryDepth, j as RecallRequest, k as RecallResponse, l as RecallResultItem, n as RecalledEvent, q as TelemetryRequest, r as TelemetryResponse } from './types-
|
|
1
|
+
import { F as FetchBrainConfig, R as RawRequest, a as RecallResult, L as LearnedData, b as LearnResponse, S as StatsResponse, A as AskResponse, C as ChangeStats, c as RunReport, d as RunFlag, e as CircuitState, T as TelemetryData, f as TelemetryConfig, g as CircuitBreakerConfig, h as Logger, B as BatchConfig, i as LogLevel } from './types-BgqTjfAN.mjs';
|
|
2
|
+
export { p as ChangeDetectionConfig, D as DriftItem, m as LearnRequest, o as LogUrlRequest, M as MemoryDepth, j as RecallRequest, k as RecallResponse, l as RecallResultItem, n as RecalledEvent, q as TelemetryRequest, r as TelemetryResponse } from './types-BgqTjfAN.mjs';
|
|
3
3
|
|
|
4
4
|
declare class FetchBrainClient {
|
|
5
5
|
private config;
|
|
@@ -67,7 +67,7 @@ declare class FetchBrainClient {
|
|
|
67
67
|
* Ask a natural-language question, answered from everything the account has learned
|
|
68
68
|
*
|
|
69
69
|
* `model` picks the generation model for answer mode from the server's
|
|
70
|
-
* menu (e.g. "llama-3.3-70b", "
|
|
70
|
+
* menu (e.g. "llama-3.3-70b", "glm-5.3" — larger models use more Ask
|
|
71
71
|
* credits), or "byok" to answer with your own linked provider model.
|
|
72
72
|
* Omit it for the default model.
|
|
73
73
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FetchBrainConfig, R as RawRequest, a as RecallResult, L as LearnedData, b as LearnResponse, S as StatsResponse, A as AskResponse, C as ChangeStats, c as RunReport, d as RunFlag, e as CircuitState, T as TelemetryData, f as TelemetryConfig, g as CircuitBreakerConfig, h as Logger, B as BatchConfig, i as LogLevel } from './types-
|
|
2
|
-
export { p as ChangeDetectionConfig, D as DriftItem, m as LearnRequest, o as LogUrlRequest, M as MemoryDepth, j as RecallRequest, k as RecallResponse, l as RecallResultItem, n as RecalledEvent, q as TelemetryRequest, r as TelemetryResponse } from './types-
|
|
1
|
+
import { F as FetchBrainConfig, R as RawRequest, a as RecallResult, L as LearnedData, b as LearnResponse, S as StatsResponse, A as AskResponse, C as ChangeStats, c as RunReport, d as RunFlag, e as CircuitState, T as TelemetryData, f as TelemetryConfig, g as CircuitBreakerConfig, h as Logger, B as BatchConfig, i as LogLevel } from './types-BgqTjfAN.js';
|
|
2
|
+
export { p as ChangeDetectionConfig, D as DriftItem, m as LearnRequest, o as LogUrlRequest, M as MemoryDepth, j as RecallRequest, k as RecallResponse, l as RecallResultItem, n as RecalledEvent, q as TelemetryRequest, r as TelemetryResponse } from './types-BgqTjfAN.js';
|
|
3
3
|
|
|
4
4
|
declare class FetchBrainClient {
|
|
5
5
|
private config;
|
|
@@ -67,7 +67,7 @@ declare class FetchBrainClient {
|
|
|
67
67
|
* Ask a natural-language question, answered from everything the account has learned
|
|
68
68
|
*
|
|
69
69
|
* `model` picks the generation model for answer mode from the server's
|
|
70
|
-
* menu (e.g. "llama-3.3-70b", "
|
|
70
|
+
* menu (e.g. "llama-3.3-70b", "glm-5.3" — larger models use more Ask
|
|
71
71
|
* credits), or "byok" to answer with your own linked provider model.
|
|
72
72
|
* Omit it for the default model.
|
|
73
73
|
*
|
package/dist/index.js
CHANGED
|
@@ -701,7 +701,7 @@ var FetchBrainClient = class {
|
|
|
701
701
|
* Ask a natural-language question, answered from everything the account has learned
|
|
702
702
|
*
|
|
703
703
|
* `model` picks the generation model for answer mode from the server's
|
|
704
|
-
* menu (e.g. "llama-3.3-70b", "
|
|
704
|
+
* menu (e.g. "llama-3.3-70b", "glm-5.3" — larger models use more Ask
|
|
705
705
|
* credits), or "byok" to answer with your own linked provider model.
|
|
706
706
|
* Omit it for the default model.
|
|
707
707
|
*
|