@orq-ai/node 4.16.0-rc.50 → 4.16.0-rc.51
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 +57 -41
- package/funcs/websearchSearch.d.ts +38 -0
- package/funcs/websearchSearch.d.ts.map +1 -0
- package/funcs/websearchSearch.js +142 -0
- package/funcs/websearchSearch.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/model.d.ts +6 -9
- package/models/components/model.d.ts.map +1 -1
- package/models/components/model.js +2 -2
- package/models/components/model.js.map +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/searchweb.d.ts +235 -0
- package/models/errors/searchweb.d.ts.map +1 -0
- package/models/errors/searchweb.js +351 -0
- package/models/errors/searchweb.js.map +1 -0
- package/models/operations/createtool.js +4 -4
- package/models/operations/deploymentinvoke.d.ts +4 -4
- package/models/operations/deploymentinvoke.d.ts.map +1 -1
- package/models/operations/deploymentinvoke.js +4 -5
- package/models/operations/deploymentinvoke.js.map +1 -1
- package/models/operations/getalltools.js +4 -4
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +4 -4
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievetool.js +4 -4
- package/models/operations/runagent.js +1 -1
- package/models/operations/searchweb.d.ts +217 -0
- package/models/operations/searchweb.d.ts.map +1 -0
- package/models/operations/searchweb.js +161 -0
- package/models/operations/searchweb.js.map +1 -0
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updatetool.js +4 -4
- package/package.json +1 -1
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/websearch.d.ts +32 -0
- package/sdk/websearch.d.ts.map +1 -0
- package/sdk/websearch.js +42 -0
- package/sdk/websearch.js.map +1 -0
- package/src/funcs/websearchSearch.ts +258 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/model.ts +10 -11
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/searchweb.ts +546 -0
- package/src/models/operations/createtool.ts +4 -4
- package/src/models/operations/deploymentinvoke.ts +9 -6
- package/src/models/operations/getalltools.ts +4 -4
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +4 -4
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrievetool.ts +4 -4
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/searchweb.ts +366 -0
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updatetool.ts +4 -4
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/websearch.ts +47 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Search the web with a selected provider
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Search with Exa, Ceramic, Linkup, Tavily, or Serper and return page URLs, titles, and descriptions in one response format. Authenticate with an API key that grants **websearch.execute** and send **Content-Type: application/json**.
|
|
34
|
+
*
|
|
35
|
+
* ### Provider and credentials
|
|
36
|
+
*
|
|
37
|
+
* Each request uses the selected provider. Exa uses **auto** search, Linkup uses **standard** depth, and Tavily uses **basic** depth.
|
|
38
|
+
*
|
|
39
|
+
* Credentials are selected from the authenticated workspace. A configured provider integration takes precedence over ORQ-managed credentials: the default integration is used, or the first configured integration if no default is set. Configure BYOK in the workspace integrations settings. Invalid integration credentials cause an error.
|
|
40
|
+
*
|
|
41
|
+
* ### Billing
|
|
42
|
+
*
|
|
43
|
+
* Managed searches use the same credits as the **AI Gateway** and charge the provider cost plus **US$0.001 per search** (US$1 per 1,000 searches). BYOK searches consume no ORQ credits and add no ORQ markup; the provider bills the integration owner directly.
|
|
44
|
+
*
|
|
45
|
+
* Exa's published auto rate is **US$7 per 1,000 requests** for up to 10 results, or **US$8 per 1,000** including the ORQ markup. Exa charges use the actual cost reported by the provider.
|
|
46
|
+
*
|
|
47
|
+
* A successful managed search is billable even if an output guardrail or output redaction failure prevents the results from being returned.
|
|
48
|
+
*
|
|
49
|
+
* ### Policies and observability
|
|
50
|
+
*
|
|
51
|
+
* PII Redaction is the only supported request plugin. Workspace PII settings and matching guardrail rules also apply. Query redaction runs before input guardrails and the provider call; result redaction runs before output guardrails and the response.
|
|
52
|
+
*
|
|
53
|
+
* Search spans and metrics record the provider, latency, result count, and cost. Use the **x-orq-trace-id** response header to find the trace.
|
|
54
|
+
*/
|
|
55
|
+
export function websearchSearch(
|
|
56
|
+
client: OrqCore,
|
|
57
|
+
request: operations.SearchWebRequestBody,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): APIPromise<
|
|
60
|
+
Result<
|
|
61
|
+
operations.SearchWebResponse,
|
|
62
|
+
| errors.SearchWebResponseBody
|
|
63
|
+
| errors.SearchWebWebsearchResponseBody
|
|
64
|
+
| errors.SearchWebWebsearchResponseResponseBody
|
|
65
|
+
| errors.SearchWebWebsearchResponse403ResponseBody
|
|
66
|
+
| errors.SearchWebWebsearchResponse415ResponseBody
|
|
67
|
+
| errors.SearchWebWebsearchResponse422ResponseBody
|
|
68
|
+
| errors.SearchWebWebsearchResponse429ResponseBody
|
|
69
|
+
| errors.SearchWebWebsearchResponse500ResponseBody
|
|
70
|
+
| errors.SearchWebWebsearchResponse502ResponseBody
|
|
71
|
+
| errors.SearchWebWebsearchResponse503ResponseBody
|
|
72
|
+
| errors.SearchWebWebsearchResponse504ResponseBody
|
|
73
|
+
| OrqError
|
|
74
|
+
| ResponseValidationError
|
|
75
|
+
| ConnectionError
|
|
76
|
+
| RequestAbortedError
|
|
77
|
+
| RequestTimeoutError
|
|
78
|
+
| InvalidRequestError
|
|
79
|
+
| UnexpectedClientError
|
|
80
|
+
| SDKValidationError
|
|
81
|
+
>
|
|
82
|
+
> {
|
|
83
|
+
return new APIPromise($do(
|
|
84
|
+
client,
|
|
85
|
+
request,
|
|
86
|
+
options,
|
|
87
|
+
));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async function $do(
|
|
91
|
+
client: OrqCore,
|
|
92
|
+
request: operations.SearchWebRequestBody,
|
|
93
|
+
options?: RequestOptions,
|
|
94
|
+
): Promise<
|
|
95
|
+
[
|
|
96
|
+
Result<
|
|
97
|
+
operations.SearchWebResponse,
|
|
98
|
+
| errors.SearchWebResponseBody
|
|
99
|
+
| errors.SearchWebWebsearchResponseBody
|
|
100
|
+
| errors.SearchWebWebsearchResponseResponseBody
|
|
101
|
+
| errors.SearchWebWebsearchResponse403ResponseBody
|
|
102
|
+
| errors.SearchWebWebsearchResponse415ResponseBody
|
|
103
|
+
| errors.SearchWebWebsearchResponse422ResponseBody
|
|
104
|
+
| errors.SearchWebWebsearchResponse429ResponseBody
|
|
105
|
+
| errors.SearchWebWebsearchResponse500ResponseBody
|
|
106
|
+
| errors.SearchWebWebsearchResponse502ResponseBody
|
|
107
|
+
| errors.SearchWebWebsearchResponse503ResponseBody
|
|
108
|
+
| errors.SearchWebWebsearchResponse504ResponseBody
|
|
109
|
+
| OrqError
|
|
110
|
+
| ResponseValidationError
|
|
111
|
+
| ConnectionError
|
|
112
|
+
| RequestAbortedError
|
|
113
|
+
| RequestTimeoutError
|
|
114
|
+
| InvalidRequestError
|
|
115
|
+
| UnexpectedClientError
|
|
116
|
+
| SDKValidationError
|
|
117
|
+
>,
|
|
118
|
+
APICall,
|
|
119
|
+
]
|
|
120
|
+
> {
|
|
121
|
+
const parsed = safeParse(
|
|
122
|
+
request,
|
|
123
|
+
(value) => operations.SearchWebRequestBody$outboundSchema.parse(value),
|
|
124
|
+
"Input validation failed",
|
|
125
|
+
);
|
|
126
|
+
if (!parsed.ok) {
|
|
127
|
+
return [parsed, { status: "invalid" }];
|
|
128
|
+
}
|
|
129
|
+
const payload = parsed.value;
|
|
130
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
131
|
+
|
|
132
|
+
const path = pathToFunc("/v3/websearch")();
|
|
133
|
+
|
|
134
|
+
const headers = new Headers(compactMap({
|
|
135
|
+
"Content-Type": "application/json",
|
|
136
|
+
Accept: "application/json",
|
|
137
|
+
}));
|
|
138
|
+
|
|
139
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
140
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
141
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
142
|
+
|
|
143
|
+
const context = {
|
|
144
|
+
options: client._options,
|
|
145
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
146
|
+
operationID: "search-web",
|
|
147
|
+
oAuth2Scopes: null,
|
|
148
|
+
|
|
149
|
+
resolvedSecurity: requestSecurity,
|
|
150
|
+
|
|
151
|
+
securitySource: client._options.apiKey,
|
|
152
|
+
retryConfig: options?.retries
|
|
153
|
+
|| client._options.retryConfig
|
|
154
|
+
|| { strategy: "none" },
|
|
155
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const requestRes = client._createRequest(context, {
|
|
159
|
+
security: requestSecurity,
|
|
160
|
+
method: "POST",
|
|
161
|
+
baseURL: options?.serverURL,
|
|
162
|
+
path: path,
|
|
163
|
+
headers: headers,
|
|
164
|
+
body: body,
|
|
165
|
+
userAgent: client._options.userAgent,
|
|
166
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
167
|
+
}, options);
|
|
168
|
+
if (!requestRes.ok) {
|
|
169
|
+
return [requestRes, { status: "invalid" }];
|
|
170
|
+
}
|
|
171
|
+
const req = requestRes.value;
|
|
172
|
+
|
|
173
|
+
const doResult = await client._do(req, {
|
|
174
|
+
context,
|
|
175
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
176
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
177
|
+
retryConfig: context.retryConfig,
|
|
178
|
+
retryCodes: context.retryCodes,
|
|
179
|
+
});
|
|
180
|
+
if (!doResult.ok) {
|
|
181
|
+
return [doResult, { status: "request-error", request: req }];
|
|
182
|
+
}
|
|
183
|
+
const response = doResult.value;
|
|
184
|
+
|
|
185
|
+
const responseFields = {
|
|
186
|
+
HttpMeta: { Response: response, Request: req },
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const [result] = await M.match<
|
|
190
|
+
operations.SearchWebResponse,
|
|
191
|
+
| errors.SearchWebResponseBody
|
|
192
|
+
| errors.SearchWebWebsearchResponseBody
|
|
193
|
+
| errors.SearchWebWebsearchResponseResponseBody
|
|
194
|
+
| errors.SearchWebWebsearchResponse403ResponseBody
|
|
195
|
+
| errors.SearchWebWebsearchResponse415ResponseBody
|
|
196
|
+
| errors.SearchWebWebsearchResponse422ResponseBody
|
|
197
|
+
| errors.SearchWebWebsearchResponse429ResponseBody
|
|
198
|
+
| errors.SearchWebWebsearchResponse500ResponseBody
|
|
199
|
+
| errors.SearchWebWebsearchResponse502ResponseBody
|
|
200
|
+
| errors.SearchWebWebsearchResponse503ResponseBody
|
|
201
|
+
| errors.SearchWebWebsearchResponse504ResponseBody
|
|
202
|
+
| OrqError
|
|
203
|
+
| ResponseValidationError
|
|
204
|
+
| ConnectionError
|
|
205
|
+
| RequestAbortedError
|
|
206
|
+
| RequestTimeoutError
|
|
207
|
+
| InvalidRequestError
|
|
208
|
+
| UnexpectedClientError
|
|
209
|
+
| SDKValidationError
|
|
210
|
+
>(
|
|
211
|
+
M.json(200, operations.SearchWebResponse$inboundSchema, {
|
|
212
|
+
hdrs: true,
|
|
213
|
+
key: "Result",
|
|
214
|
+
}),
|
|
215
|
+
M.jsonErr(400, errors.SearchWebResponseBody$inboundSchema),
|
|
216
|
+
M.jsonErr(401, errors.SearchWebWebsearchResponseBody$inboundSchema),
|
|
217
|
+
M.jsonErr(402, errors.SearchWebWebsearchResponseResponseBody$inboundSchema),
|
|
218
|
+
M.jsonErr(
|
|
219
|
+
403,
|
|
220
|
+
errors.SearchWebWebsearchResponse403ResponseBody$inboundSchema,
|
|
221
|
+
),
|
|
222
|
+
M.jsonErr(
|
|
223
|
+
415,
|
|
224
|
+
errors.SearchWebWebsearchResponse415ResponseBody$inboundSchema,
|
|
225
|
+
),
|
|
226
|
+
M.jsonErr(
|
|
227
|
+
422,
|
|
228
|
+
errors.SearchWebWebsearchResponse422ResponseBody$inboundSchema,
|
|
229
|
+
),
|
|
230
|
+
M.jsonErr(
|
|
231
|
+
429,
|
|
232
|
+
errors.SearchWebWebsearchResponse429ResponseBody$inboundSchema,
|
|
233
|
+
),
|
|
234
|
+
M.jsonErr(
|
|
235
|
+
500,
|
|
236
|
+
errors.SearchWebWebsearchResponse500ResponseBody$inboundSchema,
|
|
237
|
+
),
|
|
238
|
+
M.jsonErr(
|
|
239
|
+
502,
|
|
240
|
+
errors.SearchWebWebsearchResponse502ResponseBody$inboundSchema,
|
|
241
|
+
),
|
|
242
|
+
M.jsonErr(
|
|
243
|
+
503,
|
|
244
|
+
errors.SearchWebWebsearchResponse503ResponseBody$inboundSchema,
|
|
245
|
+
),
|
|
246
|
+
M.jsonErr(
|
|
247
|
+
504,
|
|
248
|
+
errors.SearchWebWebsearchResponse504ResponseBody$inboundSchema,
|
|
249
|
+
),
|
|
250
|
+
M.fail("4XX"),
|
|
251
|
+
M.fail("5XX"),
|
|
252
|
+
)(response, req, { extraFields: responseFields });
|
|
253
|
+
if (!result.ok) {
|
|
254
|
+
return [result, { status: "complete", request: req, response }];
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return [result, { status: "complete", request: req, response }];
|
|
258
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
58
58
|
export const SDK_METADATA = {
|
|
59
59
|
language: "typescript",
|
|
60
60
|
openapiDocVersion: "2.0",
|
|
61
|
-
sdkVersion: "4.16.0-rc.
|
|
61
|
+
sdkVersion: "4.16.0-rc.51",
|
|
62
62
|
genVersion: "2.943.0",
|
|
63
|
-
userAgent: "speakeasy-sdk/typescript 4.16.0-rc.
|
|
63
|
+
userAgent: "speakeasy-sdk/typescript 4.16.0-rc.51 2.943.0 2.0 @orq-ai/node",
|
|
64
64
|
} as const;
|
|
@@ -39,20 +39,17 @@ export type Model = {
|
|
|
39
39
|
*/
|
|
40
40
|
id: string;
|
|
41
41
|
/**
|
|
42
|
-
* When orq listed this offering,
|
|
43
|
-
*
|
|
44
|
-
* @remarks
|
|
45
|
-
* JSON).
|
|
42
|
+
* When orq listed this offering, as an RFC 3339 UTC timestamp.
|
|
46
43
|
*/
|
|
47
|
-
created:
|
|
44
|
+
created: Date;
|
|
48
45
|
/**
|
|
49
|
-
* When this offering stops being served,
|
|
46
|
+
* When this offering stops being served, as an RFC 3339 UTC timestamp:
|
|
50
47
|
*
|
|
51
48
|
* @remarks
|
|
52
|
-
*
|
|
53
|
-
*
|
|
49
|
+
* orq's own sunset date if one is set, otherwise the developer's announced
|
|
50
|
+
* deprecation date. Absent when neither is set.
|
|
54
51
|
*/
|
|
55
|
-
deprecation?:
|
|
52
|
+
deprecation?: Date | undefined;
|
|
56
53
|
/**
|
|
57
54
|
* Display name shown in the orq model garden.
|
|
58
55
|
*/
|
|
@@ -168,8 +165,10 @@ export function artificialIntelligenceFromJSON(
|
|
|
168
165
|
export const Model$inboundSchema: z.ZodType<Model, z.ZodTypeDef, unknown> = z
|
|
169
166
|
.object({
|
|
170
167
|
id: z.string(),
|
|
171
|
-
created: z.string(),
|
|
172
|
-
deprecation: z.string().
|
|
168
|
+
created: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
169
|
+
deprecation: z.string().datetime({ offset: true }).transform(v =>
|
|
170
|
+
new Date(v)
|
|
171
|
+
).optional(),
|
|
173
172
|
name: z.string(),
|
|
174
173
|
description: z.string(),
|
|
175
174
|
provider: ModelProvider$inboundSchema,
|
|
@@ -40,7 +40,7 @@ export const ReasoningPart$inboundSchema: z.ZodType<
|
|
|
40
40
|
z.ZodTypeDef,
|
|
41
41
|
unknown
|
|
42
42
|
> = z.object({
|
|
43
|
-
_id: z.string().default("
|
|
43
|
+
_id: z.string().default("reasoning_01m4766ze4107nrn430kb569b6"),
|
|
44
44
|
metadata: z.record(z.any()).optional(),
|
|
45
45
|
kind: z.literal("reasoning"),
|
|
46
46
|
reasoning: z.string(),
|
|
@@ -30,6 +30,7 @@ export * from "./retrieveagentrequest.js";
|
|
|
30
30
|
export * from "./retrieveagentschedule.js";
|
|
31
31
|
export * from "./retrieveresponse.js";
|
|
32
32
|
export * from "./sdkvalidationerror.js";
|
|
33
|
+
export * from "./searchweb.js";
|
|
33
34
|
export * from "./streamagent.js";
|
|
34
35
|
export * from "./streamrunagent.js";
|
|
35
36
|
export * from "./triggeragentschedule.js";
|