telnyx 7.14.0 → 7.16.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 +25 -0
- package/client.d.mts +8 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -2
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/calls/actions.d.mts +10 -8
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +10 -8
- package/resources/calls/actions.d.ts.map +1 -1
- package/resources/calls/calls.d.mts +5 -5
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +5 -5
- package/resources/calls/calls.d.ts.map +1 -1
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/meeting-sessions/actions.d.mts +82 -0
- package/resources/meeting-sessions/actions.d.mts.map +1 -0
- package/resources/meeting-sessions/actions.d.ts +82 -0
- package/resources/meeting-sessions/actions.d.ts.map +1 -0
- package/resources/meeting-sessions/actions.js +59 -0
- package/resources/meeting-sessions/actions.js.map +1 -0
- package/resources/meeting-sessions/actions.mjs +55 -0
- package/resources/meeting-sessions/actions.mjs.map +1 -0
- package/resources/meeting-sessions/artifacts.d.mts +92 -0
- package/resources/meeting-sessions/artifacts.d.mts.map +1 -0
- package/resources/meeting-sessions/artifacts.d.ts +92 -0
- package/resources/meeting-sessions/artifacts.d.ts.map +1 -0
- package/resources/meeting-sessions/artifacts.js +62 -0
- package/resources/meeting-sessions/artifacts.js.map +1 -0
- package/resources/meeting-sessions/artifacts.mjs +58 -0
- package/resources/meeting-sessions/artifacts.mjs.map +1 -0
- package/resources/meeting-sessions/index.d.mts +4 -0
- package/resources/meeting-sessions/index.d.mts.map +1 -0
- package/resources/meeting-sessions/index.d.ts +4 -0
- package/resources/meeting-sessions/index.d.ts.map +1 -0
- package/resources/meeting-sessions/index.js +11 -0
- package/resources/meeting-sessions/index.js.map +1 -0
- package/resources/meeting-sessions/index.mjs +5 -0
- package/resources/meeting-sessions/index.mjs.map +1 -0
- package/resources/meeting-sessions/meeting-sessions.d.mts +580 -0
- package/resources/meeting-sessions/meeting-sessions.d.mts.map +1 -0
- package/resources/meeting-sessions/meeting-sessions.d.ts +580 -0
- package/resources/meeting-sessions/meeting-sessions.d.ts.map +1 -0
- package/resources/meeting-sessions/meeting-sessions.js +175 -0
- package/resources/meeting-sessions/meeting-sessions.js.map +1 -0
- package/resources/meeting-sessions/meeting-sessions.mjs +170 -0
- package/resources/meeting-sessions/meeting-sessions.mjs.map +1 -0
- package/resources/meeting-sessions.d.mts +2 -0
- package/resources/meeting-sessions.d.mts.map +1 -0
- package/resources/meeting-sessions.d.ts +2 -0
- package/resources/meeting-sessions.d.ts.map +1 -0
- package/resources/meeting-sessions.js +6 -0
- package/resources/meeting-sessions.js.map +1 -0
- package/resources/meeting-sessions.mjs +3 -0
- package/resources/meeting-sessions.mjs.map +1 -0
- package/resources/messaging-profiles/messaging-profiles.d.mts +1 -1
- package/resources/messaging-profiles/messaging-profiles.d.ts +1 -1
- package/resources/messaging-profiles/messaging-profiles.js +1 -1
- package/resources/messaging-profiles/messaging-profiles.mjs +1 -1
- package/resources/phone-numbers/voicemail.d.mts +132 -2
- package/resources/phone-numbers/voicemail.d.mts.map +1 -1
- package/resources/phone-numbers/voicemail.d.ts +132 -2
- package/resources/phone-numbers/voicemail.d.ts.map +1 -1
- package/resources/phone-numbers/voicemail.js +8 -2
- package/resources/phone-numbers/voicemail.js.map +1 -1
- package/resources/phone-numbers/voicemail.mjs +8 -2
- package/resources/phone-numbers/voicemail.mjs.map +1 -1
- package/resources/private-wireless-gateways.d.mts +1 -1
- package/resources/private-wireless-gateways.d.ts +1 -1
- package/resources/sim-cards/actions.d.mts +69 -3
- package/resources/sim-cards/actions.d.mts.map +1 -1
- package/resources/sim-cards/actions.d.ts +69 -3
- package/resources/sim-cards/actions.d.ts.map +1 -1
- package/resources/sim-cards/actions.js +38 -0
- package/resources/sim-cards/actions.js.map +1 -1
- package/resources/sim-cards/actions.mjs +38 -0
- package/resources/sim-cards/actions.mjs.map +1 -1
- package/resources/sim-cards/index.d.mts +1 -1
- package/resources/sim-cards/index.d.mts.map +1 -1
- package/resources/sim-cards/index.d.ts +1 -1
- package/resources/sim-cards/index.d.ts.map +1 -1
- package/resources/sim-cards/index.js.map +1 -1
- package/resources/sim-cards/index.mjs.map +1 -1
- package/resources/sim-cards/sim-cards.d.mts +2 -2
- package/resources/sim-cards/sim-cards.d.mts.map +1 -1
- package/resources/sim-cards/sim-cards.d.ts +2 -2
- package/resources/sim-cards/sim-cards.d.ts.map +1 -1
- package/resources/sim-cards/sim-cards.js.map +1 -1
- package/resources/sim-cards/sim-cards.mjs.map +1 -1
- package/resources/storage/index.d.mts +2 -1
- package/resources/storage/index.d.mts.map +1 -1
- package/resources/storage/index.d.ts +2 -1
- package/resources/storage/index.d.ts.map +1 -1
- package/resources/storage/index.js +3 -1
- package/resources/storage/index.js.map +1 -1
- package/resources/storage/index.mjs +1 -0
- package/resources/storage/index.mjs.map +1 -1
- package/resources/storage/kvs/index.d.mts +1 -1
- package/resources/storage/kvs/index.d.mts.map +1 -1
- package/resources/storage/kvs/index.d.ts +1 -1
- package/resources/storage/kvs/index.d.ts.map +1 -1
- package/resources/storage/kvs/index.js.map +1 -1
- package/resources/storage/kvs/index.mjs.map +1 -1
- package/resources/storage/kvs/kvs.d.mts +7 -1
- package/resources/storage/kvs/kvs.d.mts.map +1 -1
- package/resources/storage/kvs/kvs.d.ts +7 -1
- package/resources/storage/kvs/kvs.d.ts.map +1 -1
- package/resources/storage/kvs/kvs.js.map +1 -1
- package/resources/storage/kvs/kvs.mjs.map +1 -1
- package/resources/storage/sqldbs/actions.d.mts +84 -0
- package/resources/storage/sqldbs/actions.d.mts.map +1 -0
- package/resources/storage/sqldbs/actions.d.ts +84 -0
- package/resources/storage/sqldbs/actions.d.ts.map +1 -0
- package/resources/storage/sqldbs/actions.js +29 -0
- package/resources/storage/sqldbs/actions.js.map +1 -0
- package/resources/storage/sqldbs/actions.mjs +25 -0
- package/resources/storage/sqldbs/actions.mjs.map +1 -0
- package/resources/storage/sqldbs/index.d.mts +3 -0
- package/resources/storage/sqldbs/index.d.mts.map +1 -0
- package/resources/storage/sqldbs/index.d.ts +3 -0
- package/resources/storage/sqldbs/index.d.ts.map +1 -0
- package/resources/storage/sqldbs/index.js +9 -0
- package/resources/storage/sqldbs/index.js.map +1 -0
- package/resources/storage/sqldbs/index.mjs +4 -0
- package/resources/storage/sqldbs/index.mjs.map +1 -0
- package/resources/storage/sqldbs/sqldbs.d.mts +116 -0
- package/resources/storage/sqldbs/sqldbs.d.mts.map +1 -0
- package/resources/storage/sqldbs/sqldbs.d.ts +116 -0
- package/resources/storage/sqldbs/sqldbs.d.ts.map +1 -0
- package/resources/storage/sqldbs/sqldbs.js +94 -0
- package/resources/storage/sqldbs/sqldbs.js.map +1 -0
- package/resources/storage/sqldbs/sqldbs.mjs +89 -0
- package/resources/storage/sqldbs/sqldbs.mjs.map +1 -0
- package/resources/storage/sqldbs.d.mts +2 -0
- package/resources/storage/sqldbs.d.mts.map +1 -0
- package/resources/storage/sqldbs.d.ts +2 -0
- package/resources/storage/sqldbs.d.ts.map +1 -0
- package/resources/storage/sqldbs.js +6 -0
- package/resources/storage/sqldbs.js.map +1 -0
- package/resources/storage/sqldbs.mjs +3 -0
- package/resources/storage/sqldbs.mjs.map +1 -0
- package/resources/storage/storage.d.mts +6 -2
- package/resources/storage/storage.d.mts.map +1 -1
- package/resources/storage/storage.d.ts +6 -2
- package/resources/storage/storage.d.ts.map +1 -1
- package/resources/storage/storage.js +4 -0
- package/resources/storage/storage.js.map +1 -1
- package/resources/storage/storage.mjs +4 -0
- package/resources/storage/storage.mjs.map +1 -1
- package/resources/web-search/index.d.mts +3 -0
- package/resources/web-search/index.d.mts.map +1 -0
- package/resources/web-search/index.d.ts +3 -0
- package/resources/web-search/index.d.ts.map +1 -0
- package/resources/web-search/index.js +9 -0
- package/resources/web-search/index.js.map +1 -0
- package/resources/web-search/index.mjs +4 -0
- package/resources/web-search/index.mjs.map +1 -0
- package/resources/web-search/research.d.mts +148 -0
- package/resources/web-search/research.d.mts.map +1 -0
- package/resources/web-search/research.d.ts +148 -0
- package/resources/web-search/research.d.ts.map +1 -0
- package/resources/web-search/research.js +57 -0
- package/resources/web-search/research.js.map +1 -0
- package/resources/web-search/research.mjs +53 -0
- package/resources/web-search/research.mjs.map +1 -0
- package/resources/web-search/web-search.d.mts +204 -0
- package/resources/web-search/web-search.d.mts.map +1 -0
- package/resources/web-search/web-search.d.ts +204 -0
- package/resources/web-search/web-search.d.ts.map +1 -0
- package/resources/web-search/web-search.js +59 -0
- package/resources/web-search/web-search.js.map +1 -0
- package/resources/web-search/web-search.mjs +54 -0
- package/resources/web-search/web-search.mjs.map +1 -0
- package/resources/web-search.d.mts +2 -0
- package/resources/web-search.d.mts.map +1 -0
- package/resources/web-search.d.ts +2 -0
- package/resources/web-search.d.ts.map +1 -0
- package/resources/web-search.js +6 -0
- package/resources/web-search.js.map +1 -0
- package/resources/web-search.mjs +3 -0
- package/resources/web-search.mjs.map +1 -0
- package/resources/webhooks.d.mts +475 -3
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +475 -3
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +62 -0
- package/src/resources/calls/actions.ts +10 -8
- package/src/resources/calls/calls.ts +5 -5
- package/src/resources/index.ts +28 -0
- package/src/resources/meeting-sessions/actions.ts +108 -0
- package/src/resources/meeting-sessions/artifacts.ts +135 -0
- package/src/resources/meeting-sessions/index.ts +31 -0
- package/src/resources/meeting-sessions/meeting-sessions.ts +771 -0
- package/src/resources/meeting-sessions.ts +3 -0
- package/src/resources/messaging-profiles/messaging-profiles.ts +1 -1
- package/src/resources/phone-numbers/voicemail.ts +144 -2
- package/src/resources/private-wireless-gateways.ts +1 -1
- package/src/resources/sim-cards/actions.ts +93 -2
- package/src/resources/sim-cards/index.ts +3 -0
- package/src/resources/sim-cards/sim-cards.ts +6 -0
- package/src/resources/storage/index.ts +10 -0
- package/src/resources/storage/kvs/index.ts +1 -0
- package/src/resources/storage/kvs/kvs.ts +11 -0
- package/src/resources/storage/sqldbs/actions.ts +101 -0
- package/src/resources/storage/sqldbs/index.ts +12 -0
- package/src/resources/storage/sqldbs/sqldbs.ts +179 -0
- package/src/resources/storage/sqldbs.ts +3 -0
- package/src/resources/storage/storage.ts +24 -0
- package/src/resources/web-search/index.ts +17 -0
- package/src/resources/web-search/research.ts +180 -0
- package/src/resources/web-search/web-search.ts +266 -0
- package/src/resources/web-search.ts +3 -0
- package/src/resources/webhooks.ts +579 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Deep research with citations and async task polling.
|
|
6
|
+
*/
|
|
7
|
+
export class Research extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Starts a deep research task that runs multiple searches, reads sources, and
|
|
10
|
+
* synthesizes an answer with citations.
|
|
11
|
+
*
|
|
12
|
+
* ## Synchronous mode (default)
|
|
13
|
+
*
|
|
14
|
+
* When `background` is `false` or omitted, the request blocks until the research
|
|
15
|
+
* completes and returns the answer with citations. This can take up to 120 seconds
|
|
16
|
+
* depending on `research_effort`.
|
|
17
|
+
*
|
|
18
|
+
* ## Asynchronous mode
|
|
19
|
+
*
|
|
20
|
+
* When `background` is `true`, the request returns immediately with a `task_id`
|
|
21
|
+
* and `status: pending`. Poll `GET /web_search/research/{task_id}` to check when
|
|
22
|
+
* the research completes and retrieve the answer.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const research = await client.webSearch.research.create({
|
|
27
|
+
* query:
|
|
28
|
+
* 'Compare the performance of RAG vs fine-tuning for domain-specific QA',
|
|
29
|
+
* max_sources: 20,
|
|
30
|
+
* research_effort: 'standard',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
create(body, options) {
|
|
35
|
+
return this._client.post('/web_search/research', { body, ...options });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Polls the status of a previously started asynchronous research task. When the
|
|
39
|
+
* status is `completed`, the response includes the answer and citations. When the
|
|
40
|
+
* status is `failed`, the response includes an error message.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const research = await client.webSearch.research.retrieve(
|
|
45
|
+
* 'bf3026a5-dd57-44dd-b922-200041be3a4b',
|
|
46
|
+
* );
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
retrieve(taskID, options) {
|
|
50
|
+
return this._client.get(path `/web_search/research/${taskID}`, options);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=research.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"research.mjs","sourceRoot":"","sources":["../../src/resources/web-search/research.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAIlD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,MAAM,CAAC,IAA0B,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAc,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;CACF"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as WebSearchAPI from "./web-search.mjs";
|
|
3
|
+
import * as ResearchAPI from "./research.mjs";
|
|
4
|
+
import { Research, ResearchCitation, ResearchCreateParams, ResearchCreateResponse, ResearchRetrieveResponse } from "./research.mjs";
|
|
5
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
7
|
+
export declare class WebSearch extends APIResource {
|
|
8
|
+
research: ResearchAPI.Research;
|
|
9
|
+
/**
|
|
10
|
+
* Performs a real-time web search and returns structured, LLM-ready JSON results
|
|
11
|
+
* with titles, URLs, descriptions, and snippets. Supports filtering by domain,
|
|
12
|
+
* country, safe search, freshness, and live crawl.
|
|
13
|
+
*
|
|
14
|
+
* **Note:** `include_domains` and `exclude_domains` cannot be used in the same
|
|
15
|
+
* request. Use one or the other.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const webSearch = await client.webSearch.create({
|
|
20
|
+
* query: 'latest AI agent frameworks',
|
|
21
|
+
* count: 10,
|
|
22
|
+
* country: 'US',
|
|
23
|
+
* freshness: 'week',
|
|
24
|
+
* include_domains: ['arxiv.org', 'github.com'],
|
|
25
|
+
* safesearch: 'moderate',
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
create(body: WebSearchCreateParams, options?: RequestOptions): APIPromise<WebSearchCreateResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves clean HTML or Markdown content from a list of URLs. Supports up to 20
|
|
32
|
+
* URLs per request (public API limit). Specify which formats to return: `html`,
|
|
33
|
+
* `markdown`, `metadata`.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const response = await client.webSearch.contents({
|
|
38
|
+
* urls: [
|
|
39
|
+
* 'https://en.wikipedia.org/wiki/Artificial_intelligence',
|
|
40
|
+
* ],
|
|
41
|
+
* crawl_timeout: 10,
|
|
42
|
+
* formats: ['markdown', 'metadata'],
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
contents(body: WebSearchContentsParams, options?: RequestOptions): APIPromise<WebSearchContentsResponse>;
|
|
47
|
+
}
|
|
48
|
+
export interface WebSearchResult {
|
|
49
|
+
/**
|
|
50
|
+
* Short description or excerpt.
|
|
51
|
+
*/
|
|
52
|
+
description: string;
|
|
53
|
+
/**
|
|
54
|
+
* Relevant text snippets from the page.
|
|
55
|
+
*/
|
|
56
|
+
snippets: Array<string>;
|
|
57
|
+
/**
|
|
58
|
+
* Result title.
|
|
59
|
+
*/
|
|
60
|
+
title: string;
|
|
61
|
+
/**
|
|
62
|
+
* Result URL.
|
|
63
|
+
*/
|
|
64
|
+
url: string;
|
|
65
|
+
/**
|
|
66
|
+
* Favicon URL (if available).
|
|
67
|
+
*/
|
|
68
|
+
favicon_url?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Thumbnail image URL (if available).
|
|
71
|
+
*/
|
|
72
|
+
thumbnail_url?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface WebSearchCreateResponse {
|
|
75
|
+
data?: WebSearchCreateResponse.Data;
|
|
76
|
+
}
|
|
77
|
+
export declare namespace WebSearchCreateResponse {
|
|
78
|
+
interface Data {
|
|
79
|
+
results?: Data.Results;
|
|
80
|
+
}
|
|
81
|
+
namespace Data {
|
|
82
|
+
interface Results {
|
|
83
|
+
/**
|
|
84
|
+
* Web search results.
|
|
85
|
+
*/
|
|
86
|
+
web: Array<WebSearchAPI.WebSearchResult>;
|
|
87
|
+
/**
|
|
88
|
+
* News search results. Present only when the query surfaces news results.
|
|
89
|
+
*/
|
|
90
|
+
news?: Array<WebSearchAPI.WebSearchResult>;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export interface WebSearchContentsResponse {
|
|
95
|
+
data?: WebSearchContentsResponse.Data;
|
|
96
|
+
}
|
|
97
|
+
export declare namespace WebSearchContentsResponse {
|
|
98
|
+
interface Data {
|
|
99
|
+
results?: Array<Data.Result>;
|
|
100
|
+
}
|
|
101
|
+
namespace Data {
|
|
102
|
+
interface Result {
|
|
103
|
+
/**
|
|
104
|
+
* The source URL.
|
|
105
|
+
*/
|
|
106
|
+
url: string;
|
|
107
|
+
/**
|
|
108
|
+
* Cleaned HTML content (if `html` format requested; may also be present on freshly
|
|
109
|
+
* crawled pages).
|
|
110
|
+
*/
|
|
111
|
+
html?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Markdown content (if `markdown` format requested).
|
|
114
|
+
*/
|
|
115
|
+
markdown?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Page metadata (if `metadata` format requested).
|
|
118
|
+
*/
|
|
119
|
+
metadata?: Result.Metadata;
|
|
120
|
+
/**
|
|
121
|
+
* Page title (if available).
|
|
122
|
+
*/
|
|
123
|
+
title?: string;
|
|
124
|
+
}
|
|
125
|
+
namespace Result {
|
|
126
|
+
/**
|
|
127
|
+
* Page metadata (if `metadata` format requested).
|
|
128
|
+
*/
|
|
129
|
+
interface Metadata {
|
|
130
|
+
/**
|
|
131
|
+
* Favicon URL (if available).
|
|
132
|
+
*/
|
|
133
|
+
favicon_url?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Site name. Often empty.
|
|
136
|
+
*/
|
|
137
|
+
site_name?: string;
|
|
138
|
+
[k: string]: unknown;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export interface WebSearchCreateParams {
|
|
144
|
+
/**
|
|
145
|
+
* The search query text.
|
|
146
|
+
*/
|
|
147
|
+
query: string;
|
|
148
|
+
/**
|
|
149
|
+
* Number of results to return (1-100).
|
|
150
|
+
*/
|
|
151
|
+
count?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Two-letter country code (ISO 3166-1 alpha-2) to bias results.
|
|
154
|
+
*/
|
|
155
|
+
country?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Exclude results from these domains (bare hostnames, e.g. `pinterest.com`).
|
|
158
|
+
*/
|
|
159
|
+
exclude_domains?: Array<string>;
|
|
160
|
+
/**
|
|
161
|
+
* Time-based filter for results. Common values: `day`, `week`, `month`, `year`.
|
|
162
|
+
*/
|
|
163
|
+
freshness?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Restrict results to these domains (bare hostnames, e.g. `arxiv.org`).
|
|
166
|
+
*/
|
|
167
|
+
include_domains?: Array<string>;
|
|
168
|
+
/**
|
|
169
|
+
* When true, the provider crawls pages in real-time for fresh content. The boolean
|
|
170
|
+
* is translated to the provider's internal enum internally; callers always pass
|
|
171
|
+
* `true` or `false`.
|
|
172
|
+
*/
|
|
173
|
+
livecrawl?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Safe search filter level.
|
|
176
|
+
*/
|
|
177
|
+
safesearch?: 'off' | 'moderate' | 'strict';
|
|
178
|
+
}
|
|
179
|
+
export interface WebSearchContentsParams {
|
|
180
|
+
/**
|
|
181
|
+
* List of URLs to retrieve content from (max 20 for public API).
|
|
182
|
+
*/
|
|
183
|
+
urls: Array<string>;
|
|
184
|
+
/**
|
|
185
|
+
* Timeout for crawling each URL, in seconds (1-60).
|
|
186
|
+
*/
|
|
187
|
+
crawl_timeout?: number;
|
|
188
|
+
/**
|
|
189
|
+
* Content formats to return. If omitted, `html` and `metadata` are returned by
|
|
190
|
+
* default. Retrieval is best-effort per URL: a format field appears only when that
|
|
191
|
+
* content could be produced, and a freshly crawled page may also include `html`
|
|
192
|
+
* even when not requested.
|
|
193
|
+
*/
|
|
194
|
+
formats?: Array<'html' | 'markdown' | 'metadata'>;
|
|
195
|
+
/**
|
|
196
|
+
* Maximum age of cached content in seconds. `null` means no limit.
|
|
197
|
+
*/
|
|
198
|
+
max_age?: number | null;
|
|
199
|
+
}
|
|
200
|
+
export declare namespace WebSearch {
|
|
201
|
+
export { type WebSearchResult as WebSearchResult, type WebSearchCreateResponse as WebSearchCreateResponse, type WebSearchContentsResponse as WebSearchContentsResponse, type WebSearchCreateParams as WebSearchCreateParams, type WebSearchContentsParams as WebSearchContentsParams, };
|
|
202
|
+
export { Research as Research, type ResearchCitation as ResearchCitation, type ResearchCreateResponse as ResearchCreateResponse, type ResearchRetrieveResponse as ResearchRetrieveResponse, type ResearchCreateParams as ResearchCreateParams, };
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=web-search.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-search.d.mts","sourceRoot":"","sources":["../../src/resources/web-search/web-search.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,YAAY,yBAAqB;AAC7C,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACzB,uBAAmB;AACpB,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE,qBAAa,SAAU,SAAQ,WAAW;IACxC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAIlG;;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BAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as WebSearchAPI from "./web-search.js";
|
|
3
|
+
import * as ResearchAPI from "./research.js";
|
|
4
|
+
import { Research, ResearchCitation, ResearchCreateParams, ResearchCreateResponse, ResearchRetrieveResponse } from "./research.js";
|
|
5
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
7
|
+
export declare class WebSearch extends APIResource {
|
|
8
|
+
research: ResearchAPI.Research;
|
|
9
|
+
/**
|
|
10
|
+
* Performs a real-time web search and returns structured, LLM-ready JSON results
|
|
11
|
+
* with titles, URLs, descriptions, and snippets. Supports filtering by domain,
|
|
12
|
+
* country, safe search, freshness, and live crawl.
|
|
13
|
+
*
|
|
14
|
+
* **Note:** `include_domains` and `exclude_domains` cannot be used in the same
|
|
15
|
+
* request. Use one or the other.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const webSearch = await client.webSearch.create({
|
|
20
|
+
* query: 'latest AI agent frameworks',
|
|
21
|
+
* count: 10,
|
|
22
|
+
* country: 'US',
|
|
23
|
+
* freshness: 'week',
|
|
24
|
+
* include_domains: ['arxiv.org', 'github.com'],
|
|
25
|
+
* safesearch: 'moderate',
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
create(body: WebSearchCreateParams, options?: RequestOptions): APIPromise<WebSearchCreateResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves clean HTML or Markdown content from a list of URLs. Supports up to 20
|
|
32
|
+
* URLs per request (public API limit). Specify which formats to return: `html`,
|
|
33
|
+
* `markdown`, `metadata`.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const response = await client.webSearch.contents({
|
|
38
|
+
* urls: [
|
|
39
|
+
* 'https://en.wikipedia.org/wiki/Artificial_intelligence',
|
|
40
|
+
* ],
|
|
41
|
+
* crawl_timeout: 10,
|
|
42
|
+
* formats: ['markdown', 'metadata'],
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
contents(body: WebSearchContentsParams, options?: RequestOptions): APIPromise<WebSearchContentsResponse>;
|
|
47
|
+
}
|
|
48
|
+
export interface WebSearchResult {
|
|
49
|
+
/**
|
|
50
|
+
* Short description or excerpt.
|
|
51
|
+
*/
|
|
52
|
+
description: string;
|
|
53
|
+
/**
|
|
54
|
+
* Relevant text snippets from the page.
|
|
55
|
+
*/
|
|
56
|
+
snippets: Array<string>;
|
|
57
|
+
/**
|
|
58
|
+
* Result title.
|
|
59
|
+
*/
|
|
60
|
+
title: string;
|
|
61
|
+
/**
|
|
62
|
+
* Result URL.
|
|
63
|
+
*/
|
|
64
|
+
url: string;
|
|
65
|
+
/**
|
|
66
|
+
* Favicon URL (if available).
|
|
67
|
+
*/
|
|
68
|
+
favicon_url?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Thumbnail image URL (if available).
|
|
71
|
+
*/
|
|
72
|
+
thumbnail_url?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface WebSearchCreateResponse {
|
|
75
|
+
data?: WebSearchCreateResponse.Data;
|
|
76
|
+
}
|
|
77
|
+
export declare namespace WebSearchCreateResponse {
|
|
78
|
+
interface Data {
|
|
79
|
+
results?: Data.Results;
|
|
80
|
+
}
|
|
81
|
+
namespace Data {
|
|
82
|
+
interface Results {
|
|
83
|
+
/**
|
|
84
|
+
* Web search results.
|
|
85
|
+
*/
|
|
86
|
+
web: Array<WebSearchAPI.WebSearchResult>;
|
|
87
|
+
/**
|
|
88
|
+
* News search results. Present only when the query surfaces news results.
|
|
89
|
+
*/
|
|
90
|
+
news?: Array<WebSearchAPI.WebSearchResult>;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export interface WebSearchContentsResponse {
|
|
95
|
+
data?: WebSearchContentsResponse.Data;
|
|
96
|
+
}
|
|
97
|
+
export declare namespace WebSearchContentsResponse {
|
|
98
|
+
interface Data {
|
|
99
|
+
results?: Array<Data.Result>;
|
|
100
|
+
}
|
|
101
|
+
namespace Data {
|
|
102
|
+
interface Result {
|
|
103
|
+
/**
|
|
104
|
+
* The source URL.
|
|
105
|
+
*/
|
|
106
|
+
url: string;
|
|
107
|
+
/**
|
|
108
|
+
* Cleaned HTML content (if `html` format requested; may also be present on freshly
|
|
109
|
+
* crawled pages).
|
|
110
|
+
*/
|
|
111
|
+
html?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Markdown content (if `markdown` format requested).
|
|
114
|
+
*/
|
|
115
|
+
markdown?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Page metadata (if `metadata` format requested).
|
|
118
|
+
*/
|
|
119
|
+
metadata?: Result.Metadata;
|
|
120
|
+
/**
|
|
121
|
+
* Page title (if available).
|
|
122
|
+
*/
|
|
123
|
+
title?: string;
|
|
124
|
+
}
|
|
125
|
+
namespace Result {
|
|
126
|
+
/**
|
|
127
|
+
* Page metadata (if `metadata` format requested).
|
|
128
|
+
*/
|
|
129
|
+
interface Metadata {
|
|
130
|
+
/**
|
|
131
|
+
* Favicon URL (if available).
|
|
132
|
+
*/
|
|
133
|
+
favicon_url?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Site name. Often empty.
|
|
136
|
+
*/
|
|
137
|
+
site_name?: string;
|
|
138
|
+
[k: string]: unknown;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export interface WebSearchCreateParams {
|
|
144
|
+
/**
|
|
145
|
+
* The search query text.
|
|
146
|
+
*/
|
|
147
|
+
query: string;
|
|
148
|
+
/**
|
|
149
|
+
* Number of results to return (1-100).
|
|
150
|
+
*/
|
|
151
|
+
count?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Two-letter country code (ISO 3166-1 alpha-2) to bias results.
|
|
154
|
+
*/
|
|
155
|
+
country?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Exclude results from these domains (bare hostnames, e.g. `pinterest.com`).
|
|
158
|
+
*/
|
|
159
|
+
exclude_domains?: Array<string>;
|
|
160
|
+
/**
|
|
161
|
+
* Time-based filter for results. Common values: `day`, `week`, `month`, `year`.
|
|
162
|
+
*/
|
|
163
|
+
freshness?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Restrict results to these domains (bare hostnames, e.g. `arxiv.org`).
|
|
166
|
+
*/
|
|
167
|
+
include_domains?: Array<string>;
|
|
168
|
+
/**
|
|
169
|
+
* When true, the provider crawls pages in real-time for fresh content. The boolean
|
|
170
|
+
* is translated to the provider's internal enum internally; callers always pass
|
|
171
|
+
* `true` or `false`.
|
|
172
|
+
*/
|
|
173
|
+
livecrawl?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Safe search filter level.
|
|
176
|
+
*/
|
|
177
|
+
safesearch?: 'off' | 'moderate' | 'strict';
|
|
178
|
+
}
|
|
179
|
+
export interface WebSearchContentsParams {
|
|
180
|
+
/**
|
|
181
|
+
* List of URLs to retrieve content from (max 20 for public API).
|
|
182
|
+
*/
|
|
183
|
+
urls: Array<string>;
|
|
184
|
+
/**
|
|
185
|
+
* Timeout for crawling each URL, in seconds (1-60).
|
|
186
|
+
*/
|
|
187
|
+
crawl_timeout?: number;
|
|
188
|
+
/**
|
|
189
|
+
* Content formats to return. If omitted, `html` and `metadata` are returned by
|
|
190
|
+
* default. Retrieval is best-effort per URL: a format field appears only when that
|
|
191
|
+
* content could be produced, and a freshly crawled page may also include `html`
|
|
192
|
+
* even when not requested.
|
|
193
|
+
*/
|
|
194
|
+
formats?: Array<'html' | 'markdown' | 'metadata'>;
|
|
195
|
+
/**
|
|
196
|
+
* Maximum age of cached content in seconds. `null` means no limit.
|
|
197
|
+
*/
|
|
198
|
+
max_age?: number | null;
|
|
199
|
+
}
|
|
200
|
+
export declare namespace WebSearch {
|
|
201
|
+
export { type WebSearchResult as WebSearchResult, type WebSearchCreateResponse as WebSearchCreateResponse, type WebSearchContentsResponse as WebSearchContentsResponse, type WebSearchCreateParams as WebSearchCreateParams, type WebSearchContentsParams as WebSearchContentsParams, };
|
|
202
|
+
export { Research as Research, type ResearchCitation as ResearchCitation, type ResearchCreateResponse as ResearchCreateResponse, type ResearchRetrieveResponse as ResearchRetrieveResponse, type ResearchCreateParams as ResearchCreateParams, };
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=web-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-search.d.ts","sourceRoot":"","sources":["../../src/resources/web-search/web-search.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,YAAY,wBAAqB;AAC7C,OAAO,KAAK,WAAW,sBAAmB;AAC1C,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACzB,sBAAmB;AACpB,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAEhE,qBAAa,SAAU,SAAQ,WAAW;IACxC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAIlG;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uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.WebSearch = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const ResearchAPI = tslib_1.__importStar(require("./research.js"));
|
|
8
|
+
const research_1 = require("./research.js");
|
|
9
|
+
class WebSearch extends resource_1.APIResource {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.research = new ResearchAPI.Research(this._client);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Performs a real-time web search and returns structured, LLM-ready JSON results
|
|
16
|
+
* with titles, URLs, descriptions, and snippets. Supports filtering by domain,
|
|
17
|
+
* country, safe search, freshness, and live crawl.
|
|
18
|
+
*
|
|
19
|
+
* **Note:** `include_domains` and `exclude_domains` cannot be used in the same
|
|
20
|
+
* request. Use one or the other.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const webSearch = await client.webSearch.create({
|
|
25
|
+
* query: 'latest AI agent frameworks',
|
|
26
|
+
* count: 10,
|
|
27
|
+
* country: 'US',
|
|
28
|
+
* freshness: 'week',
|
|
29
|
+
* include_domains: ['arxiv.org', 'github.com'],
|
|
30
|
+
* safesearch: 'moderate',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
create(body, options) {
|
|
35
|
+
return this._client.post('/web_search', { body, ...options });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Retrieves clean HTML or Markdown content from a list of URLs. Supports up to 20
|
|
39
|
+
* URLs per request (public API limit). Specify which formats to return: `html`,
|
|
40
|
+
* `markdown`, `metadata`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response = await client.webSearch.contents({
|
|
45
|
+
* urls: [
|
|
46
|
+
* 'https://en.wikipedia.org/wiki/Artificial_intelligence',
|
|
47
|
+
* ],
|
|
48
|
+
* crawl_timeout: 10,
|
|
49
|
+
* formats: ['markdown', 'metadata'],
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
contents(body, options) {
|
|
54
|
+
return this._client.post('/web_search/contents', { body, ...options });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.WebSearch = WebSearch;
|
|
58
|
+
WebSearch.Research = research_1.Research;
|
|
59
|
+
//# sourceMappingURL=web-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-search.js","sourceRoot":"","sources":["../../src/resources/web-search/web-search.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAElD,mEAA0C;AAC1C,4CAMoB;AAIpB,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6C1E,CAAC;IA3CC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,IAA6B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;CACF;AA9CD,8BA8CC;AA0LD,SAAS,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import * as ResearchAPI from "./research.mjs";
|
|
4
|
+
import { Research, } from "./research.mjs";
|
|
5
|
+
export class WebSearch extends APIResource {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.research = new ResearchAPI.Research(this._client);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Performs a real-time web search and returns structured, LLM-ready JSON results
|
|
12
|
+
* with titles, URLs, descriptions, and snippets. Supports filtering by domain,
|
|
13
|
+
* country, safe search, freshness, and live crawl.
|
|
14
|
+
*
|
|
15
|
+
* **Note:** `include_domains` and `exclude_domains` cannot be used in the same
|
|
16
|
+
* request. Use one or the other.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const webSearch = await client.webSearch.create({
|
|
21
|
+
* query: 'latest AI agent frameworks',
|
|
22
|
+
* count: 10,
|
|
23
|
+
* country: 'US',
|
|
24
|
+
* freshness: 'week',
|
|
25
|
+
* include_domains: ['arxiv.org', 'github.com'],
|
|
26
|
+
* safesearch: 'moderate',
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
create(body, options) {
|
|
31
|
+
return this._client.post('/web_search', { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves clean HTML or Markdown content from a list of URLs. Supports up to 20
|
|
35
|
+
* URLs per request (public API limit). Specify which formats to return: `html`,
|
|
36
|
+
* `markdown`, `metadata`.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const response = await client.webSearch.contents({
|
|
41
|
+
* urls: [
|
|
42
|
+
* 'https://en.wikipedia.org/wiki/Artificial_intelligence',
|
|
43
|
+
* ],
|
|
44
|
+
* crawl_timeout: 10,
|
|
45
|
+
* formats: ['markdown', 'metadata'],
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
contents(body, options) {
|
|
50
|
+
return this._client.post('/web_search/contents', { body, ...options });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
WebSearch.Research = Research;
|
|
54
|
+
//# sourceMappingURL=web-search.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-search.mjs","sourceRoot":"","sources":["../../src/resources/web-search/web-search.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EACL,QAAQ,GAKT,uBAAmB;AAIpB,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA6C1E,CAAC;IA3CC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,IAA6B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;CACF;AA0LD,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-search.d.mts","sourceRoot":"","sources":["../src/resources/web-search.ts"],"names":[],"mappings":"AAEA,uCAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-search.d.ts","sourceRoot":"","sources":["../src/resources/web-search.ts"],"names":[],"mappings":"AAEA,sCAAmC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./web-search/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=web-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-search.js","sourceRoot":"","sources":["../src/resources/web-search.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gEAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-search.mjs","sourceRoot":"","sources":["../src/resources/web-search.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,uCAAmC"}
|