totalum-sdk 1.11.0 → 1.12.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/CHANGELOG.md +20 -0
- package/dist/_types/{coerce.d-BKhuaDya.d.ts → coerce.d-Cp5NZQN-.d.ts} +1 -1
- package/dist/_types/{errors.d-RTRkidv5.d.ts → errors.d-ve4rY-Hx.d.ts} +37 -5
- package/dist/_types/{integrations.d-CzTa9T-L.d.ts → integrations.d-BRhNKT7K.d.ts} +2 -2
- package/dist/_types/{ops.d-CNsrT4Ma.d.ts → ops.d-DIC4u0go.d.ts} +2 -2
- package/dist/ai/index.d.ts +275 -23
- package/dist/ai/index.js +305 -24
- package/dist/analytics/index.d.ts +58 -12
- package/dist/analytics/index.js +46 -3
- package/dist/browser/index.d.ts +228 -20
- package/dist/browser/index.js +122 -13
- package/dist/connections/index.d.ts +305 -23
- package/dist/connections/index.js +302 -21
- package/dist/cron/index.d.ts +147 -20
- package/dist/cron/index.js +157 -15
- package/dist/d1/errors.js +15 -0
- package/dist/d1/index.d.ts +254 -10
- package/dist/d1/index.js +24 -4
- package/dist/d1/session.js +26 -2
- package/dist/email/index.d.ts +65 -10
- package/dist/email/index.js +60 -5
- package/dist/errors.js +17 -0
- package/dist/files/index.d.ts +243 -20
- package/dist/files/index.js +247 -14
- package/dist/index.d.ts +25 -10
- package/dist/index.js +19 -5
- package/dist/logs/index.d.ts +48 -10
- package/dist/logs/index.js +39 -4
- package/dist/payments/index.d.ts +221 -23
- package/dist/payments/index.js +216 -18
- package/dist/pdf/index.d.ts +59 -9
- package/dist/pdf/index.js +54 -4
- package/dist/react/index.d.ts +78 -6
- package/dist/react/index.js +51 -5
- package/dist/realtime/index.d.ts +55 -8
- package/dist/realtime/index.js +53 -6
- package/dist/scan/index.d.ts +78 -10
- package/dist/scan/index.js +63 -3
- package/dist/seo/index.d.ts +1118 -8
- package/dist/seo/index.js +325 -4
- package/dist/speech/index.d.ts +34 -10
- package/dist/speech/index.js +25 -5
- package/dist/vectors/index.d.ts +96 -9
- package/dist/vectors/index.js +93 -7
- package/dist/web/index.d.ts +168 -15
- package/dist/web/index.js +163 -10
- package/dist/webhooks/index.d.ts +122 -15
- package/dist/webhooks/index.js +119 -13
- package/package.json +2 -1
- package/totalum-sdk.md +10336 -754
- package/totalum-sdk.signatures.json +69 -1
package/dist/seo/index.js
CHANGED
|
@@ -1,12 +1,333 @@
|
|
|
1
|
-
import { jsonClient } from '../http.js';
|
|
1
|
+
import { envelopeClient, jsonClient, withUsage } from '../http.js';
|
|
2
2
|
export { TotalumError, isTotalumError } from '../errors.js';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Creates the `seo` namespace (the same object as `totalum.seo`, scope `seo`): search and AI-answer research —
|
|
5
|
+
* Google results, AI Overviews and AI Mode, Maps, what ChatGPT, Claude, Gemini and Perplexity answer and cite,
|
|
6
|
+
* keyword ideas and volumes, competitors and keyword gaps, backlinks and on-page analysis — for a country and
|
|
7
|
+
* language (ISO codes, e.g. `es`/`es`), billed in credits (every result carries `usage.credits`); plus IndexNow for
|
|
8
|
+
* verified custom domains, free. The plan limits the research calls per minute and per month.
|
|
9
|
+
*
|
|
10
|
+
* @param options - The project key, API URL and environment; each falls back to its environment variable.
|
|
11
|
+
* @returns The `seo` namespace: the methods below.
|
|
12
|
+
* @example
|
|
13
|
+
* import { totalumSeo } from 'totalum-sdk/seo';
|
|
14
|
+
*
|
|
15
|
+
* const seo = totalumSeo();
|
|
16
|
+
* const { keywords } = await seo.keywords.ideas({ keywords: ['dentista'], country: 'es', language: 'es' });
|
|
17
|
+
*/
|
|
4
18
|
export function totalumSeo(options = {}) {
|
|
5
19
|
const call = jsonClient(options);
|
|
20
|
+
const paid = envelopeClient(options);
|
|
21
|
+
const post = async (route, input) => withUsage(await paid('POST', `/v1/seo/${route}`, input));
|
|
6
22
|
return {
|
|
7
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Tells the search engines that use IndexNow (Bing, Yandex, Seznam, Naver, …) that these pages of the project's
|
|
25
|
+
* custom domain were added or changed, so they are crawled again soon, and fetches each domain's `/sitemap.xml` so
|
|
26
|
+
* it is fresh. Call it after publishing a post or editing a product page. Only verified custom domains are sent:
|
|
27
|
+
* for Totalum's own hosts the answer is `indexNow: 'skipped_no_custom_domain'`. Free.
|
|
28
|
+
*
|
|
29
|
+
* @param urls - Full URLs on the project's hostnames.
|
|
30
|
+
* @returns How many URLs were accepted and what was sent.
|
|
31
|
+
* @throws URL_NOT_PROJECT_HOST (400) A URL is not on one of the project's hostnames; `details.url`.
|
|
32
|
+
* @throws INDEXNOW_ERROR (502) IndexNow refused the submission.
|
|
33
|
+
* @throws ENGINE_UNAVAILABLE (502) SEO is unavailable; retry shortly.
|
|
34
|
+
* @example
|
|
35
|
+
* const out = await totalum.seo.notifyChanged(['https://www.acme.com/blog/launch', 'https://www.acme.com/pricing']);
|
|
36
|
+
* //=>
|
|
37
|
+
* { "accepted": 2, "indexNow": "sent", "sitemapsPinged": true }
|
|
38
|
+
*/
|
|
8
39
|
notifyChanged: (urls) => call('POST', '/v1/seo/notify-changed', { urls }),
|
|
9
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* The project's IndexNow key: the template serves it at `/<key>.txt` so search engines can check the submissions
|
|
42
|
+
* are yours. Free.
|
|
43
|
+
*
|
|
44
|
+
* @returns The key and the URL it is served at.
|
|
45
|
+
* @throws ENGINE_UNAVAILABLE (502) SEO is unavailable; retry shortly.
|
|
46
|
+
* @example
|
|
47
|
+
* const { key, keyLocation } = await totalum.seo.indexNowKey();
|
|
48
|
+
* //=>
|
|
49
|
+
* { "key": "99d8cc52…", "keyLocation": "https://acme.totalum.app/99d8cc52….txt" }
|
|
50
|
+
*/
|
|
10
51
|
indexNowKey: () => call('GET', '/v1/seo/indexnow-key'),
|
|
52
|
+
/**
|
|
53
|
+
* The countries and languages the research methods accept, and for each country the languages keyword, domain
|
|
54
|
+
* and AI data exist in (search results take any listed language). Free.
|
|
55
|
+
*
|
|
56
|
+
* @returns Every country and language code.
|
|
57
|
+
* @throws FORBIDDEN_SCOPE (403) The key lacks the `seo` scope.
|
|
58
|
+
* @example
|
|
59
|
+
* const { countries } = await totalum.seo.locations();
|
|
60
|
+
* //=>
|
|
61
|
+
* { "countries": [{ "country": "es", "name": "Spain", "dataLanguages": ["es"] }, …], "languages": [{ "language": "ca", "name": "Catalan" }, …] }
|
|
62
|
+
*/
|
|
63
|
+
locations: () => call('GET', '/v1/seo/locations'),
|
|
64
|
+
serp: {
|
|
65
|
+
/**
|
|
66
|
+
* Google's results for a keyword as searched from a country (or one of its cities), in a language: the organic
|
|
67
|
+
* results, the featured snippet, "People also ask", related searches and the AI Overview with its sources. Use
|
|
68
|
+
* it to see what ranks and what the page that ranks must answer.
|
|
69
|
+
*
|
|
70
|
+
* @param input - The keyword, where it is searched from and how many results.
|
|
71
|
+
* @returns The results page and the credits it cost.
|
|
72
|
+
* @throws SEO_CITY_NOT_FOUND (400) No such city in `country`.
|
|
73
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
|
|
74
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
75
|
+
* @throws PROVIDER_TIMEOUT (504) The search took too long; retry.
|
|
76
|
+
* @throws PROVIDER_UNAVAILABLE (503) Search data is unavailable; retry later.
|
|
77
|
+
* @example
|
|
78
|
+
* const page = await totalum.seo.serp.google({ keyword: 'dentista barcelona', country: 'es', language: 'es', city: 'Barcelona' });
|
|
79
|
+
* //=>
|
|
80
|
+
* {
|
|
81
|
+
* "keyword": "dentista barcelona",
|
|
82
|
+
* "totalResults": 3150000,
|
|
83
|
+
* "organic": [{ "position": 1, "title": "Clínica Dental …", "url": "https://www.example.es/", "domain": "www.example.es", "snippet": "…", "breadcrumb": "https://www.example.es" }],
|
|
84
|
+
* "featuredSnippet": null,
|
|
85
|
+
* "peopleAlsoAsk": [{ "question": "¿Cuánto cuesta un empaste en Barcelona?", "answer": null }],
|
|
86
|
+
* "relatedSearches": ["dentista barcelona urgencias"],
|
|
87
|
+
* "aiOverview": null,
|
|
88
|
+
* "usage": { "credits": 0.1429 }
|
|
89
|
+
* }
|
|
90
|
+
*/
|
|
91
|
+
google: (input) => post('serp/google', input),
|
|
92
|
+
/**
|
|
93
|
+
* Google's AI Mode answer for a question and the pages it cites, where Google offers AI Mode.
|
|
94
|
+
*
|
|
95
|
+
* @param input - The question and where it is asked from.
|
|
96
|
+
* @returns The answer, its sources and the credits it cost.
|
|
97
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) Google does not offer AI Mode there, or no data for that country and language.
|
|
98
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
99
|
+
* @throws PROVIDER_TIMEOUT (504) The search took too long; retry.
|
|
100
|
+
* @throws PROVIDER_UNAVAILABLE (503) Search data is unavailable; retry later.
|
|
101
|
+
* @example
|
|
102
|
+
* const ai = await totalum.seo.serp.aiMode({ keyword: 'best budgeting apps', country: 'us', language: 'en' });
|
|
103
|
+
* //=>
|
|
104
|
+
* { "keyword": "best budgeting apps", "answer": "Popular choices include …", "sources": [{ "title": "…", "url": "https://…", "domain": "…" }], "usage": { "credits": 0.2858 } }
|
|
105
|
+
*/
|
|
106
|
+
aiMode: (input) => post('serp/google-ai-mode', input),
|
|
107
|
+
/**
|
|
108
|
+
* Google Maps results for a search (local businesses): name, category, address, phone, website, rating and
|
|
109
|
+
* reviews — the local competitors of a business.
|
|
110
|
+
*
|
|
111
|
+
* @param input - The search, where it is made from and how many results.
|
|
112
|
+
* @returns The places, best first, and the credits it cost.
|
|
113
|
+
* @throws SEO_CITY_NOT_FOUND (400) No such city in `country`.
|
|
114
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
|
|
115
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
116
|
+
* @throws PROVIDER_TIMEOUT (504) The search took too long; retry.
|
|
117
|
+
* @throws PROVIDER_UNAVAILABLE (503) Search data is unavailable; retry later.
|
|
118
|
+
* @example
|
|
119
|
+
* const { results } = await totalum.seo.serp.maps({ keyword: 'dentista', country: 'es', language: 'es', city: 'Barcelona', depth: 10 });
|
|
120
|
+
* //=>
|
|
121
|
+
* { "keyword": "dentista", "results": [{ "position": 1, "title": "Clínica Dental …", "category": "Dentista", "rating": 4.9, "reviews": 812, … }], "usage": { "credits": 0.1429 } }
|
|
122
|
+
*/
|
|
123
|
+
maps: (input) => post('serp/google-maps', input),
|
|
124
|
+
},
|
|
125
|
+
ai: {
|
|
126
|
+
/**
|
|
127
|
+
* What an AI assistant (ChatGPT, Claude, Gemini or Perplexity) answers to a question, with the web searches it
|
|
128
|
+
* ran, the pages it cited and their domains — to see which brands and sites the AIs recommend (GEO). Among the
|
|
129
|
+
* dearer research calls: ask a few real questions, not dozens.
|
|
130
|
+
*
|
|
131
|
+
* @param input - The question, the assistant and the country its web search runs from.
|
|
132
|
+
* @returns The answer, its sources and the credits it cost.
|
|
133
|
+
* @throws SEO_REQUEST_REJECTED (400) The question or model was refused; `details.field`.
|
|
134
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
135
|
+
* @throws PROVIDER_TIMEOUT (504) The answer took too long; retry.
|
|
136
|
+
* @throws PROVIDER_UNAVAILABLE (503) The AI data is unavailable; retry later.
|
|
137
|
+
* @example
|
|
138
|
+
* const a = await totalum.seo.ai.answer({ prompt: 'Mejor clínica dental en Barcelona', platform: 'chatgpt', country: 'es' });
|
|
139
|
+
* //=>
|
|
140
|
+
* { "platform": "chatgpt", "model": "…", "answer": "Algunas de las clínicas mejor valoradas …", "sources": [{ "title": "…", "url": "https://…", "domain": "…" }], "citedDomains": ["www.doctoralia.es"], "searchQueries": ["mejor clínica dental barcelona"], "usage": { "credits": 2.1883 } }
|
|
141
|
+
*/
|
|
142
|
+
answer: (input) => post('ai/answer', input),
|
|
143
|
+
/**
|
|
144
|
+
* ChatGPT's search answer for a query as shown to users in a country: the answer, the sources and search results
|
|
145
|
+
* it showed, and the brands it named.
|
|
146
|
+
*
|
|
147
|
+
* @param input - The query and the country and language.
|
|
148
|
+
* @returns The answer, its sources, brands and the credits it cost.
|
|
149
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
|
|
150
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
151
|
+
* @throws PROVIDER_TIMEOUT (504) The answer took too long; retry.
|
|
152
|
+
* @throws PROVIDER_UNAVAILABLE (503) The AI data is unavailable; retry later.
|
|
153
|
+
* @example
|
|
154
|
+
* const s = await totalum.seo.ai.chatgptSearch({ keyword: 'best budgeting app', country: 'us', language: 'en' });
|
|
155
|
+
* //=>
|
|
156
|
+
* { "keyword": "best budgeting app", "answer": "…", "sources": [], "searchResults": [], "brands": [{ "name": "YNAB", "category": "Software" }], "searchQueries": ["best budgeting app 2026"], "usage": { "credits": 0.2858 } }
|
|
157
|
+
*/
|
|
158
|
+
chatgptSearch: (input) => post('ai/chatgpt-search', input),
|
|
159
|
+
/**
|
|
160
|
+
* Where a domain, or a keyword or brand, is mentioned in AI answers (Google's AI Overviews; ChatGPT for the
|
|
161
|
+
* United States in English): the questions and answers, or the most cited domains or pages. Give exactly one
|
|
162
|
+
* of `domain` or `keyword`. The dearest research call: use it once per brand, not per page.
|
|
163
|
+
*
|
|
164
|
+
* @param input - The domain or keyword, the place, the AI and the view.
|
|
165
|
+
* @returns The mentions (or top domains or pages) and the credits it cost.
|
|
166
|
+
* @throws VALIDATION_ERROR (400) Neither or both of `domain` and `keyword`.
|
|
167
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
|
|
168
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
169
|
+
* @throws PROVIDER_UNAVAILABLE (503) The AI data is unavailable; retry later.
|
|
170
|
+
* @example
|
|
171
|
+
* const m = await totalum.seo.ai.mentions({ keyword: 'budgeting app', country: 'us', language: 'en', view: 'top-domains', limit: 5 });
|
|
172
|
+
* //=>
|
|
173
|
+
* { "totalCount": 1814, "domains": [{ "domain": "www.nerdwallet.com", "mentions": 416, "aiSearchVolume": 316550 }], "usage": { "credits": 7.5 } }
|
|
174
|
+
*/
|
|
175
|
+
mentions: (input) => post('ai/mentions', input),
|
|
176
|
+
/**
|
|
177
|
+
* How often keywords are asked to AI assistants per month (AI search volume), per keyword.
|
|
178
|
+
*
|
|
179
|
+
* @param input - Up to 1,000 keywords and the place.
|
|
180
|
+
* @returns The AI search volume per keyword and the credits it cost.
|
|
181
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
|
|
182
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
183
|
+
* @throws PROVIDER_UNAVAILABLE (503) The AI data is unavailable; retry later.
|
|
184
|
+
* @example
|
|
185
|
+
* const v = await totalum.seo.ai.keywordVolume({ keywords: ['budget planner'], country: 'us', language: 'en' });
|
|
186
|
+
* //=>
|
|
187
|
+
* { "keywords": [{ "keyword": "budget planner", "aiSearchVolume": 3241, "monthlySearches": [{ "year": 2026, "month": 10, "aiSearchVolume": 3241 }] }], "usage": { "credits": 0.7215 } }
|
|
188
|
+
*/
|
|
189
|
+
keywordVolume: (input) => post('ai/keyword-volume', input),
|
|
190
|
+
},
|
|
191
|
+
keywords: {
|
|
192
|
+
/**
|
|
193
|
+
* Keyword ideas around seed keywords (phrases containing the first seed first, then wider ideas), each with its
|
|
194
|
+
* monthly Google search volume, cost per click, competition, difficulty and intent — to choose what a page or an
|
|
195
|
+
* article targets.
|
|
196
|
+
*
|
|
197
|
+
* @param input - Up to 20 seed keywords, the place and how many ideas.
|
|
198
|
+
* @returns The ideas and the credits it cost.
|
|
199
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No keyword data for that country and language.
|
|
200
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
201
|
+
* @throws PROVIDER_UNAVAILABLE (503) Keyword data is unavailable; retry later.
|
|
202
|
+
* @example
|
|
203
|
+
* const { keywords } = await totalum.seo.keywords.ideas({ keywords: ['dentista barcelona'], country: 'es', language: 'es', limit: 20 });
|
|
204
|
+
* //=>
|
|
205
|
+
* { "keywords": [{ "keyword": "dentista barcelona", "searchVolume": 4400, "cpc": 2.1, "competition": 0.4, "competitionLevel": "medium", "difficulty": 31, "intent": "commercial", "trend": { "monthly": 0, "quarterly": 22, "yearly": -18 }, "monthlySearches": [{ "year": 2026, "month": 10, "searchVolume": 4400 }] }], "usage": { "credits": 2.0572 } }
|
|
206
|
+
*/
|
|
207
|
+
ideas: (input) => post('keywords/ideas', input),
|
|
208
|
+
/**
|
|
209
|
+
* The searches Google relates to a keyword ("related searches", followed `depth` hops), with the same data as
|
|
210
|
+
* `ideas` — topic clusters and article ideas.
|
|
211
|
+
*
|
|
212
|
+
* @param input - The keyword, the place, the depth and how many.
|
|
213
|
+
* @returns The related keywords and the credits it cost.
|
|
214
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No keyword data for that country and language.
|
|
215
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
216
|
+
* @throws PROVIDER_UNAVAILABLE (503) Keyword data is unavailable; retry later.
|
|
217
|
+
* @example
|
|
218
|
+
* const { keywords } = await totalum.seo.keywords.related({ keyword: 'emergency fund', country: 'us', language: 'en', limit: 20 });
|
|
219
|
+
* //=>
|
|
220
|
+
* { "keywords": [{ "keyword": "how much emergency fund", "searchVolume": 2900, "difficulty": 22, "intent": "informational", … }], "usage": { "credits": 0.9343 } }
|
|
221
|
+
*/
|
|
222
|
+
related: (input) => post('keywords/related', input),
|
|
223
|
+
/**
|
|
224
|
+
* The search data of keywords you already have (up to 700): volume, cost per click, competition, difficulty,
|
|
225
|
+
* intent and the last 12 months.
|
|
226
|
+
*
|
|
227
|
+
* @param input - The keywords and the place.
|
|
228
|
+
* @returns One row per keyword found and the credits it cost.
|
|
229
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No keyword data for that country and language.
|
|
230
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
231
|
+
* @throws PROVIDER_UNAVAILABLE (503) Keyword data is unavailable; retry later.
|
|
232
|
+
* @example
|
|
233
|
+
* const { keywords } = await totalum.seo.keywords.overview({ keywords: ['implantes dentales barcelona', 'ortodoncia invisible barcelona'], country: 'es', language: 'es' });
|
|
234
|
+
* //=>
|
|
235
|
+
* { "keywords": [{ "keyword": "implantes dentales barcelona", "searchVolume": 1900, "difficulty": 28, … }], "usage": { "credits": 0.8743 } }
|
|
236
|
+
*/
|
|
237
|
+
overview: (input) => post('keywords/overview', input),
|
|
238
|
+
/**
|
|
239
|
+
* Google Trends interest over time (0–100) for up to 5 keywords, worldwide or in a country — seasonality and
|
|
240
|
+
* which wording is rising.
|
|
241
|
+
*
|
|
242
|
+
* @param input - The keywords, the place (optional) and the period.
|
|
243
|
+
* @returns The timeline and the credits it cost.
|
|
244
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
245
|
+
* @throws PROVIDER_UNAVAILABLE (503) Trends data is unavailable; retry later.
|
|
246
|
+
* @example
|
|
247
|
+
* const t = await totalum.seo.keywords.trends({ keywords: ['budget app', 'expense tracker'], country: 'us' });
|
|
248
|
+
* //=>
|
|
249
|
+
* { "keywords": ["budget app", "expense tracker"], "timeline": [{ "from": "2025-11-23", "to": "2025-11-29", "values": [71, 40] }], "usage": { "credits": 0.7858 } }
|
|
250
|
+
*/
|
|
251
|
+
trends: (input) => post('keywords/trends', input),
|
|
252
|
+
},
|
|
253
|
+
domain: {
|
|
254
|
+
/**
|
|
255
|
+
* The keywords a domain ranks for on Google in a country, with its position, the ranking URL and the estimated
|
|
256
|
+
* traffic — what a competitor gets its visits from.
|
|
257
|
+
*
|
|
258
|
+
* @param input - The domain, the place and how many keywords.
|
|
259
|
+
* @returns The ranked keywords, best first, and the credits it cost.
|
|
260
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
|
|
261
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
262
|
+
* @throws PROVIDER_UNAVAILABLE (503) Domain data is unavailable; retry later.
|
|
263
|
+
* @example
|
|
264
|
+
* const d = await totalum.seo.domain.keywords({ domain: 'example.es', country: 'es', language: 'es', limit: 20 });
|
|
265
|
+
* //=>
|
|
266
|
+
* { "domain": "example.es", "totalCount": 1273, "keywords": [{ "keyword": "…", "position": 1, "url": "https://example.es/p", "traffic": 2.97, "searchVolume": 880, … }], "usage": { "credits": 0.9 } }
|
|
267
|
+
*/
|
|
268
|
+
keywords: (input) => post('domain/keywords', input),
|
|
269
|
+
/**
|
|
270
|
+
* The domains that compete with a domain on Google in a country (most shared keywords first).
|
|
271
|
+
*
|
|
272
|
+
* @param input - The domain, the place and how many competitors.
|
|
273
|
+
* @returns The competitors and the credits it cost.
|
|
274
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
|
|
275
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
276
|
+
* @throws PROVIDER_UNAVAILABLE (503) Domain data is unavailable; retry later.
|
|
277
|
+
* @example
|
|
278
|
+
* const c = await totalum.seo.domain.competitors({ domain: 'example.es', country: 'es', language: 'es', limit: 5 });
|
|
279
|
+
* //=>
|
|
280
|
+
* { "domain": "example.es", "competitors": [{ "domain": "rival.es", "sharedKeywords": 540, "avgPosition": 18.2, "organicKeywords": 9000, "traffic": 12000 }], "usage": { "credits": 0.9086 } }
|
|
281
|
+
*/
|
|
282
|
+
competitors: (input) => post('domain/competitors', input),
|
|
283
|
+
/**
|
|
284
|
+
* The keyword gap between a domain and a competitor: the keywords the competitor ranks for and the domain does
|
|
285
|
+
* not (`missing`), or that both rank for (`shared`).
|
|
286
|
+
*
|
|
287
|
+
* @param input - The domain, the competitor, the place, the mode and how many.
|
|
288
|
+
* @returns The keywords with both positions and the credits it cost.
|
|
289
|
+
* @throws NOT_AVAILABLE_IN_COUNTRY (400) No data for that country and language.
|
|
290
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
291
|
+
* @throws PROVIDER_UNAVAILABLE (503) Domain data is unavailable; retry later.
|
|
292
|
+
* @example
|
|
293
|
+
* const g = await totalum.seo.domain.keywordGap({ domain: 'example.es', competitor: 'rival.es', country: 'es', language: 'es' });
|
|
294
|
+
* //=>
|
|
295
|
+
* { "domain": "example.es", "competitor": "rival.es", "keywords": [{ "keyword": "…", "competitorPosition": 3, "competitorUrl": "https://rival.es/p", "domainPosition": null, "domainUrl": null, … }], "usage": { "credits": 0.9 } }
|
|
296
|
+
*/
|
|
297
|
+
keywordGap: (input) => post('domain/keyword-gap', input),
|
|
298
|
+
/**
|
|
299
|
+
* A domain's backlink profile: authority rank, backlinks, referring domains, spam score and where its links come
|
|
300
|
+
* from.
|
|
301
|
+
*
|
|
302
|
+
* @param input - The domain.
|
|
303
|
+
* @returns The summary and the credits it cost.
|
|
304
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
305
|
+
* @throws PROVIDER_UNAVAILABLE (503) Backlink data is unavailable; retry later.
|
|
306
|
+
* @example
|
|
307
|
+
* const b = await totalum.seo.domain.backlinks({ domain: 'example.es' });
|
|
308
|
+
* //=>
|
|
309
|
+
* { "domain": "example.es", "rank": 212, "backlinks": 667, "referringDomains": 235, "spamScore": 11, …, "usage": { "credits": 1.7169 } }
|
|
310
|
+
*/
|
|
311
|
+
backlinks: (input) => post('domain/backlinks-summary', input),
|
|
312
|
+
},
|
|
313
|
+
page: {
|
|
314
|
+
/**
|
|
315
|
+
* Reads one public page as a search engine does: title, description, canonical, headings, word count, links,
|
|
316
|
+
* images, structured data, social tags, an on-page score with the issues found, and its main text by section —
|
|
317
|
+
* the structure of a page that ranks.
|
|
318
|
+
*
|
|
319
|
+
* @param input - The page's URL.
|
|
320
|
+
* @returns The page analysis and the credits it cost.
|
|
321
|
+
* @throws SEO_REQUEST_REJECTED (400) The page could not be read; `details.field`.
|
|
322
|
+
* @throws RATE_LIMIT_EXCEEDED (429) The plan's SEO calls per minute or per month are used up; `details.period`.
|
|
323
|
+
* @throws PROVIDER_TIMEOUT (504) The page took too long; retry.
|
|
324
|
+
* @throws PROVIDER_UNAVAILABLE (503) Page analysis is unavailable; retry later.
|
|
325
|
+
* @example
|
|
326
|
+
* const p = await totalum.seo.page.analyze({ url: 'https://www.example.es/' });
|
|
327
|
+
* //=>
|
|
328
|
+
* { "url": "https://www.example.es/", "statusCode": 200, "title": "Ejemplo", "headings": { "h1": ["Ejemplo"], "h2": ["…"], "h3": [] }, "wordCount": 2418, "hasStructuredData": true, "score": 91.59, "issues": ["title_too_long"], "content": [{ "heading": "Ejemplo", "level": 1, "text": "…" }], …, "usage": { "credits": 0.0215 } }
|
|
329
|
+
*/
|
|
330
|
+
analyze: (input) => post('page/analyze', input),
|
|
331
|
+
},
|
|
11
332
|
};
|
|
12
333
|
}
|
package/dist/speech/index.d.ts
CHANGED
|
@@ -1,28 +1,52 @@
|
|
|
1
|
-
import { T as TranscribeInput, A as SpeakInput, B as StoredMedia } from '../_types/integrations.d-
|
|
2
|
-
export { H as TranscribeOutput } from '../_types/integrations.d-
|
|
3
|
-
import { T as TotalumClientOptions } from '../_types/errors.d-
|
|
4
|
-
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
5
|
-
import '../_types/coerce.d-
|
|
1
|
+
import { T as TranscribeInput, A as SpeakInput, B as StoredMedia } from '../_types/integrations.d-BRhNKT7K.js';
|
|
2
|
+
export { H as TranscribeOutput } from '../_types/integrations.d-BRhNKT7K.js';
|
|
3
|
+
import { T as TotalumClientOptions } from '../_types/errors.d-ve4rY-Hx.js';
|
|
4
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-ve4rY-Hx.js';
|
|
5
|
+
import '../_types/coerce.d-Cp5NZQN-.js';
|
|
6
6
|
|
|
7
7
|
/** The audio bytes of `synthesize` without `store`, and what the call cost (`usage.credits`, the call's hold). */
|
|
8
8
|
interface SpeechAudio {
|
|
9
|
+
/** The audio file's bytes: return them from a route, or upload them with `files.upload`. */
|
|
9
10
|
audio: ArrayBuffer;
|
|
11
|
+
/** The audio's MIME type: `audio/mpeg` (mp3), `audio/wav` or `audio/ogg` (opus). */
|
|
10
12
|
contentType: string;
|
|
13
|
+
/** What the call cost. */
|
|
11
14
|
usage: {
|
|
15
|
+
/** Credits charged for this call. */
|
|
12
16
|
credits: number;
|
|
13
17
|
};
|
|
14
18
|
/** @deprecated Since 1.0.0: use `usage.credits` (the same number). */
|
|
15
19
|
readonly credits: number;
|
|
16
20
|
}
|
|
17
21
|
/**
|
|
18
|
-
* `
|
|
19
|
-
*
|
|
20
|
-
* working.
|
|
22
|
+
* Creates the `speech` namespace (the same object as `totalum.speech`, scope `speech`): speech to text and text to
|
|
23
|
+
* speech through Totalum. The AI gateway (`ai.gatewayConfig()`) also offers `/audio/speech` and
|
|
24
|
+
* `/audio/transcriptions` for OpenAI-compatible clients; these methods keep working.
|
|
25
|
+
*
|
|
26
|
+
* @param options - The project key, API URL and environment; each falls back to its environment variable.
|
|
27
|
+
* @returns The `speech` namespace: the methods below.
|
|
28
|
+
* @example
|
|
29
|
+
* import { totalumSpeech } from 'totalum-sdk/speech';
|
|
30
|
+
*
|
|
31
|
+
* const speech = totalumSpeech();
|
|
32
|
+
* const { text } = await speech.transcribe({ url: 'https://example.com/voice-note.mp3' });
|
|
21
33
|
*/
|
|
22
34
|
declare function totalumSpeech(options?: TotalumClientOptions): {
|
|
23
35
|
/**
|
|
24
|
-
* Speech to text
|
|
25
|
-
* project stored
|
|
36
|
+
* Speech to text: transcribes a recording, a voice note or a video's audio, from a `url` (a public one, or a file
|
|
37
|
+
* this project stored) or from `audioBase64` plus a `filename` with its extension. Formats: mp3, mp4, m4a, wav,
|
|
38
|
+
* webm, ogg, opus, flac, aac; at most 25 MB. Billed in credits per second of audio.
|
|
39
|
+
*
|
|
40
|
+
* @param input - The audio and the language.
|
|
41
|
+
* @returns The text, the audio's duration and what it cost.
|
|
42
|
+
* @throws AUDIO_FILE_REQUIRED (400) No audio was given, or the URL could not be read.
|
|
43
|
+
* @throws INVALID_AUDIO_FORMAT (400) The file extension is not a supported audio format.
|
|
44
|
+
* @throws AUDIO_FILE_TOO_LARGE (413) The audio is over 25 MB.
|
|
45
|
+
* @throws AI_PROVIDER_UNAVAILABLE (502) The audio could not be transcribed; retry.
|
|
46
|
+
* @example
|
|
47
|
+
* const result = await totalum.speech.transcribe({ url: voiceNote.fileUrl, language: 'en' });
|
|
48
|
+
* //=>
|
|
49
|
+
* { "text": "Hello there.", "durationSec": 10, "usage": { "credits": 0.0064 } }
|
|
26
50
|
*/
|
|
27
51
|
transcribe: (input: TranscribeInput) => Promise<{
|
|
28
52
|
text: string;
|
package/dist/speech/index.js
CHANGED
|
@@ -2,9 +2,17 @@ import { deprecated } from '../deprecate.js';
|
|
|
2
2
|
import { jsonClient, rawClient } from '../http.js';
|
|
3
3
|
export { TotalumError, isTotalumError } from '../errors.js';
|
|
4
4
|
/**
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
* working.
|
|
5
|
+
* Creates the `speech` namespace (the same object as `totalum.speech`, scope `speech`): speech to text and text to
|
|
6
|
+
* speech through Totalum. The AI gateway (`ai.gatewayConfig()`) also offers `/audio/speech` and
|
|
7
|
+
* `/audio/transcriptions` for OpenAI-compatible clients; these methods keep working.
|
|
8
|
+
*
|
|
9
|
+
* @param options - The project key, API URL and environment; each falls back to its environment variable.
|
|
10
|
+
* @returns The `speech` namespace: the methods below.
|
|
11
|
+
* @example
|
|
12
|
+
* import { totalumSpeech } from 'totalum-sdk/speech';
|
|
13
|
+
*
|
|
14
|
+
* const speech = totalumSpeech();
|
|
15
|
+
* const { text } = await speech.transcribe({ url: 'https://example.com/voice-note.mp3' });
|
|
8
16
|
*/
|
|
9
17
|
export function totalumSpeech(options = {}) {
|
|
10
18
|
const call = jsonClient(options);
|
|
@@ -29,8 +37,20 @@ export function totalumSpeech(options = {}) {
|
|
|
29
37
|
}
|
|
30
38
|
return {
|
|
31
39
|
/**
|
|
32
|
-
* Speech to text
|
|
33
|
-
* project stored
|
|
40
|
+
* Speech to text: transcribes a recording, a voice note or a video's audio, from a `url` (a public one, or a file
|
|
41
|
+
* this project stored) or from `audioBase64` plus a `filename` with its extension. Formats: mp3, mp4, m4a, wav,
|
|
42
|
+
* webm, ogg, opus, flac, aac; at most 25 MB. Billed in credits per second of audio.
|
|
43
|
+
*
|
|
44
|
+
* @param input - The audio and the language.
|
|
45
|
+
* @returns The text, the audio's duration and what it cost.
|
|
46
|
+
* @throws AUDIO_FILE_REQUIRED (400) No audio was given, or the URL could not be read.
|
|
47
|
+
* @throws INVALID_AUDIO_FORMAT (400) The file extension is not a supported audio format.
|
|
48
|
+
* @throws AUDIO_FILE_TOO_LARGE (413) The audio is over 25 MB.
|
|
49
|
+
* @throws AI_PROVIDER_UNAVAILABLE (502) The audio could not be transcribed; retry.
|
|
50
|
+
* @example
|
|
51
|
+
* const result = await totalum.speech.transcribe({ url: voiceNote.fileUrl, language: 'en' });
|
|
52
|
+
* //=>
|
|
53
|
+
* { "text": "Hello there.", "durationSec": 10, "usage": { "credits": 0.0064 } }
|
|
34
54
|
*/
|
|
35
55
|
transcribe: (input) => call('POST', '/v1/speech/transcribe', input),
|
|
36
56
|
synthesize,
|
package/dist/vectors/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as ZodObject, d as ZodString, c as ZodOptional, e as ZodArray, k as ZodNumber, f as ZodEnum, h as ZodRecord, n as ZodUnion, j as ZodBoolean, m as $strip, o as output, l as ZodInt, q as $partial,
|
|
2
|
-
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-
|
|
1
|
+
import { Z as ZodObject, d as ZodString, c as ZodOptional, e as ZodArray, k as ZodNumber, f as ZodEnum, h as ZodRecord, n as ZodUnion, j as ZodBoolean, m as $strip, o as output, l as ZodInt, q as $partial, A as $strict, T as TotalumClientOptions, U as Usage } from '../_types/errors.d-ve4rY-Hx.js';
|
|
2
|
+
export { a as TotalumError, b as TotalumErrorCode, i as isTotalumError } from '../_types/errors.d-ve4rY-Hx.js';
|
|
3
3
|
|
|
4
4
|
/** `text` = the `embed` preset's space; `image` = the `embed-image` preset's text+image space. */
|
|
5
5
|
declare const VectorSpace: ZodEnum<{
|
|
@@ -95,18 +95,44 @@ declare const VectorRecord: ZodObject<{
|
|
|
95
95
|
type VectorRecord = output<typeof VectorRecord>;
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
|
-
* `
|
|
98
|
+
* Creates the `vectors` namespace (the same object as `totalum.vectors`; scope `vectors`; server-side code only: it
|
|
99
|
+
* needs the project key). Every
|
|
99
100
|
* project environment has its own private vector store: ids, namespaces and indexes are Totalum's, never yours to
|
|
100
101
|
* name, and `x-totalum-env` (the `env` option) keeps dev and live apart. Vectors are 1,024 numbers; `text` is
|
|
101
102
|
* embedded with the `embed` model and `image` (a project file key, a files URL, an https URL or a data URL) with the
|
|
102
103
|
* `embed-image` model, whose space also embeds text: search images by words with `space: 'image'`. Filter on the
|
|
103
104
|
* metadata keys `source`, `type`, `tag`, `group` (strings) and `page` (number).
|
|
105
|
+
*
|
|
106
|
+
* @param options - The project key, API URL and environment; each falls back to its environment variable.
|
|
107
|
+
* @returns The `vectors` namespace: the methods below.
|
|
108
|
+
* @example
|
|
109
|
+
* import { totalumVectors } from 'totalum-sdk/vectors';
|
|
110
|
+
*
|
|
111
|
+
* const vectors = totalumVectors();
|
|
112
|
+
* const { count } = await vectors.count();
|
|
104
113
|
*/
|
|
105
114
|
declare function totalumVectors(options?: TotalumClientOptions): {
|
|
106
115
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
116
|
+
* Stores up to 100 items (at most 8 of them images) for semantic search: give each an `id` of yours (the row id),
|
|
117
|
+
* its content as `text`, `image` or ready-made `values`, and metadata to filter on. Writing an existing id replaces
|
|
118
|
+
* it. The answer (and `count()`) means stored; `query` and `get` see the write later — often seconds, sometimes 10+
|
|
109
119
|
* minutes (the index applies writes asynchronously). Never wait or poll for a write to become searchable.
|
|
120
|
+
*
|
|
121
|
+
* @param vectors - The items to store; each has exactly one of `text`, `image` or `values`.
|
|
122
|
+
* @returns How many were written, how many the environment now holds, and what it cost.
|
|
123
|
+
* @throws VALIDATION_ERROR (400) More than 100 items or 8 images, duplicate ids, an item with no or several contents, a
|
|
124
|
+
* metadata key starting with `_`, or metadata over 9 KB.
|
|
125
|
+
* @throws VECTORS_LIMIT_REACHED (403) The plan's stored vectors per environment are used up; delete some or upgrade.
|
|
126
|
+
* @throws FILE_TOO_LARGE (413) An image is over 20 MB.
|
|
127
|
+
* @throws AI_PROVIDER_UNAVAILABLE (502) The text or image could not be embedded; retry.
|
|
128
|
+
* @throws PROVIDER_UNAVAILABLE (503) The vector store is unavailable (or being set up: retry in a minute).
|
|
129
|
+
* @example
|
|
130
|
+
* await totalum.vectors.upsert([
|
|
131
|
+
* { id: 'faq-12', text: 'Refunds are possible for 30 days after purchase.', metadata: { source: 'faq', tag: 'billing' } },
|
|
132
|
+
* { id: 'product-88', image: product.photo.key, metadata: { type: 'product' } },
|
|
133
|
+
* ]);
|
|
134
|
+
* //=>
|
|
135
|
+
* { "upserted": 2, "count": 2, "usage": { "credits": 0.0021 } }
|
|
110
136
|
*/
|
|
111
137
|
upsert: (vectors: VectorUpsertItem[]) => Promise<Omit<Omit<{
|
|
112
138
|
upserted: number;
|
|
@@ -117,20 +143,72 @@ declare function totalumVectors(options?: TotalumClientOptions): {
|
|
|
117
143
|
}, "usage">, "usage"> & {
|
|
118
144
|
usage: Usage;
|
|
119
145
|
}>;
|
|
120
|
-
/**
|
|
146
|
+
/**
|
|
147
|
+
* Finds the stored items closest in meaning to a text, an image or a vector — "search by meaning". Results are best
|
|
148
|
+
* first with a similarity `score`; filter them on metadata. Pass exactly one of `text`, `image` or `values`.
|
|
149
|
+
*
|
|
150
|
+
* @param input - What to search for, how many results, and the metadata filter.
|
|
151
|
+
* @returns The closest items (best first) and what the query cost.
|
|
152
|
+
* @throws VALIDATION_ERROR (400) None or several of `text`/`image`/`values`, `topK` over 50, a filter over 2 KB or on
|
|
153
|
+
* another metadata key.
|
|
154
|
+
* @throws FILE_TOO_LARGE (413) The image is over 20 MB.
|
|
155
|
+
* @throws AI_PROVIDER_UNAVAILABLE (502) The query could not be embedded; retry.
|
|
156
|
+
* @throws PROVIDER_UNAVAILABLE (503) The vector store is unavailable; retry later.
|
|
157
|
+
* @example
|
|
158
|
+
* const { matches } = await totalum.vectors.query({
|
|
159
|
+
* text: 'Can I get my money back?',
|
|
160
|
+
* topK: 3,
|
|
161
|
+
* filter: { source: 'faq' },
|
|
162
|
+
* });
|
|
163
|
+
* //=>
|
|
164
|
+
* {
|
|
165
|
+
* "matches": [
|
|
166
|
+
* { "id": "faq-12", "score": 0.83, "space": "text", "metadata": { "source": "faq", "tag": "billing" } },
|
|
167
|
+
* { "id": "faq-07", "score": 0.61, "space": "text", "metadata": { "source": "faq", "tag": "orders" } }
|
|
168
|
+
* ],
|
|
169
|
+
* "usage": { "credits": 0.0006 }
|
|
170
|
+
* }
|
|
171
|
+
* @example
|
|
172
|
+
* // images that look like a description (image search by words)
|
|
173
|
+
* const { matches } = await totalum.vectors.query({ text: 'red running shoes', space: 'image', topK: 8 });
|
|
174
|
+
*/
|
|
121
175
|
query: (input: VectorsQueryInput) => Promise<Omit<{
|
|
176
|
+
/** The closest items, best first. */
|
|
122
177
|
matches: VectorMatch[];
|
|
123
178
|
}, "usage"> & {
|
|
124
179
|
usage: Usage;
|
|
125
180
|
}>;
|
|
126
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Reads stored items back by id, with their numbers and metadata. Unknown ids — and ids written in the last seconds
|
|
183
|
+
* or minutes — are left out of the answer. Free.
|
|
184
|
+
*
|
|
185
|
+
* @param ids - Up to 100 ids.
|
|
186
|
+
* @returns The items found (possibly fewer than asked).
|
|
187
|
+
* @throws VALIDATION_ERROR (400) No ids, or more than 100.
|
|
188
|
+
* @example
|
|
189
|
+
* const [doc] = await totalum.vectors.get(['faq-12']);
|
|
190
|
+
* //=>
|
|
191
|
+
* [
|
|
192
|
+
* { "id": "faq-12", "space": "text", "values": [0.0138, -0.0121, 0.0125, …], "metadata": { "source": "faq", "tag": "billing" } }
|
|
193
|
+
* ]
|
|
194
|
+
*/
|
|
127
195
|
get: (ids: string[]) => Promise<{
|
|
128
196
|
id: string;
|
|
129
197
|
space: "text" | "image";
|
|
130
198
|
values: number[];
|
|
131
199
|
metadata?: Record<string, string | number | boolean | string[]> | undefined;
|
|
132
200
|
}[]>;
|
|
133
|
-
/**
|
|
201
|
+
/**
|
|
202
|
+
* Deletes items by id — when the row they describe is deleted. Ids that do not exist are ignored.
|
|
203
|
+
*
|
|
204
|
+
* @param ids - Up to 1,000 ids.
|
|
205
|
+
* @returns How many existed and were deleted, how many the environment still holds, and what it cost.
|
|
206
|
+
* @throws VALIDATION_ERROR (400) No ids, or more than 1,000.
|
|
207
|
+
* @example
|
|
208
|
+
* const out = await totalum.vectors.delete(['faq-12', 'faq-13']);
|
|
209
|
+
* //=>
|
|
210
|
+
* { "deleted": 1, "count": 41, "usage": { "credits": 0 } }
|
|
211
|
+
*/
|
|
134
212
|
delete: (ids: string[]) => Promise<Omit<Omit<{
|
|
135
213
|
deleted: number;
|
|
136
214
|
count: number;
|
|
@@ -140,7 +218,16 @@ declare function totalumVectors(options?: TotalumClientOptions): {
|
|
|
140
218
|
}, "usage">, "usage"> & {
|
|
141
219
|
usage: Usage;
|
|
142
220
|
}>;
|
|
143
|
-
/**
|
|
221
|
+
/**
|
|
222
|
+
* How many items this environment stores, in total and per space. Free.
|
|
223
|
+
*
|
|
224
|
+
* @returns The totals.
|
|
225
|
+
* @throws PROVIDER_UNAVAILABLE (503) The vector store is unavailable; retry later.
|
|
226
|
+
* @example
|
|
227
|
+
* const counts = await totalum.vectors.count();
|
|
228
|
+
* //=>
|
|
229
|
+
* { "count": 42, "text": 40, "image": 2 }
|
|
230
|
+
*/
|
|
144
231
|
count: () => Promise<{
|
|
145
232
|
count: number;
|
|
146
233
|
text: number;
|