@orq-ai/node 4.11.0 → 4.11.3

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.
Files changed (181) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +2 -2
  3. package/lib/config.js +2 -2
  4. package/models/components/evaluatorresponsefunction.js +2 -2
  5. package/models/components/evaluatorresponsehttp.js +2 -2
  6. package/models/components/evaluatorresponsejsonschema.js +2 -2
  7. package/models/components/evaluatorresponsellm.js +2 -2
  8. package/models/components/evaluatorresponsepython.js +2 -2
  9. package/models/components/evaluatorresponseragas.js +2 -2
  10. package/models/components/evaluatorresponsetypescript.js +2 -2
  11. package/models/components/reasoningpart.js +1 -1
  12. package/models/operations/createdataset.js +1 -1
  13. package/models/operations/createdatasetitem.js +4 -4
  14. package/models/operations/createdatasource.js +1 -1
  15. package/models/operations/createtool.js +6 -6
  16. package/models/operations/getalltools.js +6 -6
  17. package/models/operations/getv2humanevalsets.js +2 -2
  18. package/models/operations/getv2humanevalsetsid.js +2 -2
  19. package/models/operations/listdatasetdatapoints.js +4 -4
  20. package/models/operations/listdatasets.js +1 -1
  21. package/models/operations/listdatasources.js +1 -1
  22. package/models/operations/patchv2humanevalsetsid.js +2 -2
  23. package/models/operations/postv2feedbackevaluation.js +3 -3
  24. package/models/operations/postv2humanevalsets.js +2 -2
  25. package/models/operations/retrievedatapoint.js +4 -4
  26. package/models/operations/retrievedataset.js +1 -1
  27. package/models/operations/retrievedatasource.js +1 -1
  28. package/models/operations/retrievetool.js +6 -6
  29. package/models/operations/runagent.js +1 -1
  30. package/models/operations/streamrunagent.js +1 -1
  31. package/models/operations/updatedatapoint.js +4 -4
  32. package/models/operations/updatedataset.js +1 -1
  33. package/models/operations/updatedatasource.js +1 -1
  34. package/models/operations/updatetool.js +7 -7
  35. package/package.json +3 -3
  36. package/packages/orq-rc/src/funcs/notifiersCreate.ts +162 -0
  37. package/packages/orq-rc/src/funcs/notifiersDelete.ts +168 -0
  38. package/packages/orq-rc/src/funcs/notifiersGet.ts +168 -0
  39. package/packages/orq-rc/src/funcs/notifiersList.ts +171 -0
  40. package/packages/orq-rc/src/funcs/notifiersUpdate.ts +171 -0
  41. package/packages/orq-rc/src/funcs/tracesAggregate.ts +162 -0
  42. package/packages/orq-rc/src/funcs/tracesGet.ts +168 -0
  43. package/packages/orq-rc/src/funcs/tracesGetSpan.ts +172 -0
  44. package/packages/orq-rc/src/funcs/tracesListFacetValues.ts +177 -0
  45. package/packages/orq-rc/src/funcs/tracesListFacets.ts +144 -0
  46. package/packages/orq-rc/src/funcs/tracesListFields.ts +144 -0
  47. package/packages/orq-rc/src/funcs/tracesListSpans.ts +174 -0
  48. package/packages/orq-rc/src/funcs/tracesQuery.ts +162 -0
  49. package/packages/orq-rc/src/funcs/tracesSearch.ts +162 -0
  50. package/packages/orq-rc/src/lib/config.ts +3 -3
  51. package/packages/orq-rc/src/models/components/actionreviewrequestedstreamingevent.ts +5 -0
  52. package/packages/orq-rc/src/models/components/agentstartedstreamingevent.ts +5 -0
  53. package/packages/orq-rc/src/models/components/aggregatetracesrequest.ts +65 -0
  54. package/packages/orq-rc/src/models/components/aggregatetracesresponse.ts +37 -0
  55. package/packages/orq-rc/src/models/components/createnotifierrequest.ts +433 -0
  56. package/packages/orq-rc/src/models/components/createnotifierresponse.ts +35 -0
  57. package/packages/orq-rc/src/models/components/deletenotifierresponse.ts +27 -0
  58. package/packages/orq-rc/src/models/components/evaluatorresponsefunction.ts +2 -2
  59. package/packages/orq-rc/src/models/components/evaluatorresponsehttp.ts +2 -2
  60. package/packages/orq-rc/src/models/components/evaluatorresponsejsonschema.ts +2 -2
  61. package/packages/orq-rc/src/models/components/evaluatorresponsellm.ts +2 -2
  62. package/packages/orq-rc/src/models/components/evaluatorresponsepython.ts +2 -2
  63. package/packages/orq-rc/src/models/components/evaluatorresponseragas.ts +2 -2
  64. package/packages/orq-rc/src/models/components/evaluatorresponsetypescript.ts +2 -2
  65. package/packages/orq-rc/src/models/components/getnotifierresponse.ts +35 -0
  66. package/packages/orq-rc/src/models/components/gettraceresponse.ts +32 -0
  67. package/packages/orq-rc/src/models/components/gettracespanresponse.ts +32 -0
  68. package/packages/orq-rc/src/models/components/index.ts +36 -0
  69. package/packages/orq-rc/src/models/components/listnotifiersresponse.ts +50 -0
  70. package/packages/orq-rc/src/models/components/listtracefacetsresponse.ts +32 -0
  71. package/packages/orq-rc/src/models/components/listtracefacetvaluesresponse.ts +44 -0
  72. package/packages/orq-rc/src/models/components/listtracefieldsresponse.ts +32 -0
  73. package/packages/orq-rc/src/models/components/listtracespansresponse.ts +44 -0
  74. package/packages/orq-rc/src/models/components/notifier.ts +465 -0
  75. package/packages/orq-rc/src/models/components/notifiertype.ts +21 -0
  76. package/packages/orq-rc/src/models/components/querytracesrequest.ts +48 -0
  77. package/packages/orq-rc/src/models/components/querytracesresponse.ts +37 -0
  78. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  79. package/packages/orq-rc/src/models/components/searchtracesrequest.ts +68 -0
  80. package/packages/orq-rc/src/models/components/searchtracesresponse.ts +72 -0
  81. package/packages/orq-rc/src/models/components/spandetail.ts +53 -0
  82. package/packages/orq-rc/src/models/components/spansummary.ts +76 -0
  83. package/packages/orq-rc/src/models/components/traceagent.ts +33 -0
  84. package/packages/orq-rc/src/models/components/traceaggregaterow.ts +33 -0
  85. package/packages/orq-rc/src/models/components/tracecompute.ts +30 -0
  86. package/packages/orq-rc/src/models/components/tracecontext.ts +39 -0
  87. package/packages/orq-rc/src/models/components/tracecost.ts +77 -0
  88. package/packages/orq-rc/src/models/components/tracefacet.ts +35 -0
  89. package/packages/orq-rc/src/models/components/tracefacetvalue.ts +33 -0
  90. package/packages/orq-rc/src/models/components/tracefield.ts +56 -0
  91. package/packages/orq-rc/src/models/components/tracefilter.ts +33 -0
  92. package/packages/orq-rc/src/models/components/tracesearchmeta.ts +45 -0
  93. package/packages/orq-rc/src/models/components/tracesort.ts +30 -0
  94. package/packages/orq-rc/src/models/components/tracesummary.ts +152 -0
  95. package/packages/orq-rc/src/models/components/traceusage.ts +62 -0
  96. package/packages/orq-rc/src/models/components/updatenotifierrequest.ts +130 -0
  97. package/packages/orq-rc/src/models/components/updatenotifierresponse.ts +35 -0
  98. package/packages/orq-rc/src/models/operations/createagentrequest.ts +77 -0
  99. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  100. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
  101. package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
  102. package/packages/orq-rc/src/models/operations/createprompt.ts +2 -0
  103. package/packages/orq-rc/src/models/operations/createtool.ts +6 -6
  104. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +2 -0
  105. package/packages/orq-rc/src/models/operations/deployments.ts +2 -0
  106. package/packages/orq-rc/src/models/operations/deploymentstream.ts +2 -0
  107. package/packages/orq-rc/src/models/operations/getallprompts.ts +2 -0
  108. package/packages/orq-rc/src/models/operations/getalltools.ts +6 -6
  109. package/packages/orq-rc/src/models/operations/getoneprompt.ts +2 -0
  110. package/packages/orq-rc/src/models/operations/getpromptversion.ts +2 -0
  111. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  112. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  113. package/packages/orq-rc/src/models/operations/index.ts +8 -0
  114. package/packages/orq-rc/src/models/operations/listagents.ts +5 -0
  115. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
  116. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  117. package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
  118. package/packages/orq-rc/src/models/operations/listpromptversions.ts +2 -0
  119. package/packages/orq-rc/src/models/operations/notifierdelete.ts +36 -0
  120. package/packages/orq-rc/src/models/operations/notifierget.ts +36 -0
  121. package/packages/orq-rc/src/models/operations/notifierlist.ts +59 -0
  122. package/packages/orq-rc/src/models/operations/notifierupdate.ts +41 -0
  123. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  124. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +3 -3
  125. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  126. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +5 -0
  127. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
  128. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  129. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
  130. package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
  131. package/packages/orq-rc/src/models/operations/runagent.ts +67 -1
  132. package/packages/orq-rc/src/models/operations/streamrunagent.ts +67 -1
  133. package/packages/orq-rc/src/models/operations/tracesget.ts +36 -0
  134. package/packages/orq-rc/src/models/operations/tracesgetspan.ts +40 -0
  135. package/packages/orq-rc/src/models/operations/traceslistfacetvalues.ts +50 -0
  136. package/packages/orq-rc/src/models/operations/traceslistspans.ts +43 -0
  137. package/packages/orq-rc/src/models/operations/updateagent.ts +77 -0
  138. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
  139. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  140. package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
  141. package/packages/orq-rc/src/models/operations/updateprompt.ts +2 -0
  142. package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
  143. package/packages/orq-rc/src/sdk/feedback.ts +2 -2
  144. package/packages/orq-rc/src/sdk/notifiers.ts +100 -0
  145. package/packages/orq-rc/src/sdk/sdk.ts +12 -0
  146. package/packages/orq-rc/src/sdk/traces.ts +168 -0
  147. package/sdk/feedback.d.ts +2 -2
  148. package/sdk/feedback.js +2 -2
  149. package/src/lib/config.ts +2 -2
  150. package/src/models/components/evaluatorresponsefunction.ts +2 -2
  151. package/src/models/components/evaluatorresponsehttp.ts +2 -2
  152. package/src/models/components/evaluatorresponsejsonschema.ts +2 -2
  153. package/src/models/components/evaluatorresponsellm.ts +2 -2
  154. package/src/models/components/evaluatorresponsepython.ts +2 -2
  155. package/src/models/components/evaluatorresponseragas.ts +2 -2
  156. package/src/models/components/evaluatorresponsetypescript.ts +2 -2
  157. package/src/models/components/reasoningpart.ts +1 -1
  158. package/src/models/operations/createdataset.ts +1 -1
  159. package/src/models/operations/createdatasetitem.ts +4 -4
  160. package/src/models/operations/createdatasource.ts +1 -1
  161. package/src/models/operations/createtool.ts +6 -6
  162. package/src/models/operations/getalltools.ts +6 -6
  163. package/src/models/operations/getv2humanevalsets.ts +2 -2
  164. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  165. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  166. package/src/models/operations/listdatasets.ts +1 -1
  167. package/src/models/operations/listdatasources.ts +1 -1
  168. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  169. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  170. package/src/models/operations/postv2humanevalsets.ts +2 -2
  171. package/src/models/operations/retrievedatapoint.ts +4 -4
  172. package/src/models/operations/retrievedataset.ts +1 -1
  173. package/src/models/operations/retrievedatasource.ts +1 -1
  174. package/src/models/operations/retrievetool.ts +6 -6
  175. package/src/models/operations/runagent.ts +1 -1
  176. package/src/models/operations/streamrunagent.ts +1 -1
  177. package/src/models/operations/updatedatapoint.ts +4 -4
  178. package/src/models/operations/updatedataset.ts +1 -1
  179. package/src/models/operations/updatedatasource.ts +1 -1
  180. package/src/models/operations/updatetool.ts +7 -7
  181. package/src/sdk/feedback.ts +2 -2
@@ -0,0 +1,174 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } 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 * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.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
+ * List trace spans
31
+ *
32
+ * @remarks
33
+ * List canonical span summaries for a trace.
34
+ */
35
+ export function tracesListSpans(
36
+ client: OrqCore,
37
+ request: operations.TracesListSpansRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.ListTraceSpansResponse,
42
+ | OrqError
43
+ | ResponseValidationError
44
+ | ConnectionError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | InvalidRequestError
48
+ | UnexpectedClientError
49
+ | SDKValidationError
50
+ >
51
+ > {
52
+ return new APIPromise($do(
53
+ client,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: OrqCore,
61
+ request: operations.TracesListSpansRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.ListTraceSpansResponse,
67
+ | OrqError
68
+ | ResponseValidationError
69
+ | ConnectionError
70
+ | RequestAbortedError
71
+ | RequestTimeoutError
72
+ | InvalidRequestError
73
+ | UnexpectedClientError
74
+ | SDKValidationError
75
+ >,
76
+ APICall,
77
+ ]
78
+ > {
79
+ const parsed = safeParse(
80
+ request,
81
+ (value) => operations.TracesListSpansRequest$outboundSchema.parse(value),
82
+ "Input validation failed",
83
+ );
84
+ if (!parsed.ok) {
85
+ return [parsed, { status: "invalid" }];
86
+ }
87
+ const payload = parsed.value;
88
+ const body = null;
89
+
90
+ const pathParams = {
91
+ trace_id: encodeSimple("trace_id", payload.trace_id, {
92
+ explode: false,
93
+ charEncoding: "percent",
94
+ }),
95
+ };
96
+ const path = pathToFunc("/v2/traces/{trace_id}/spans")(pathParams);
97
+
98
+ const query = encodeFormQuery({
99
+ "limit": payload.limit,
100
+ "page_token": payload.page_token,
101
+ });
102
+
103
+ const headers = new Headers(compactMap({
104
+ Accept: "application/json",
105
+ }));
106
+
107
+ const secConfig = await extractSecurity(client._options.apiKey);
108
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
109
+ const requestSecurity = resolveGlobalSecurity(securityInput);
110
+
111
+ const context = {
112
+ options: client._options,
113
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
114
+ operationID: "TracesListSpans",
115
+ oAuth2Scopes: null,
116
+
117
+ resolvedSecurity: requestSecurity,
118
+
119
+ securitySource: client._options.apiKey,
120
+ retryConfig: options?.retries
121
+ || client._options.retryConfig
122
+ || { strategy: "none" },
123
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
124
+ };
125
+
126
+ const requestRes = client._createRequest(context, {
127
+ security: requestSecurity,
128
+ method: "GET",
129
+ baseURL: options?.serverURL,
130
+ path: path,
131
+ headers: headers,
132
+ query: query,
133
+ body: body,
134
+ userAgent: client._options.userAgent,
135
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
136
+ }, options);
137
+ if (!requestRes.ok) {
138
+ return [requestRes, { status: "invalid" }];
139
+ }
140
+ const req = requestRes.value;
141
+
142
+ const doResult = await client._do(req, {
143
+ context,
144
+ isErrorStatusCode: (statusCode: number) =>
145
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
146
+ retryConfig: context.retryConfig,
147
+ retryCodes: context.retryCodes,
148
+ });
149
+ if (!doResult.ok) {
150
+ return [doResult, { status: "request-error", request: req }];
151
+ }
152
+ const response = doResult.value;
153
+
154
+ const [result] = await M.match<
155
+ components.ListTraceSpansResponse,
156
+ | OrqError
157
+ | ResponseValidationError
158
+ | ConnectionError
159
+ | RequestAbortedError
160
+ | RequestTimeoutError
161
+ | InvalidRequestError
162
+ | UnexpectedClientError
163
+ | SDKValidationError
164
+ >(
165
+ M.json(200, components.ListTraceSpansResponse$inboundSchema),
166
+ M.fail("4XX"),
167
+ M.fail("5XX"),
168
+ )(response, req);
169
+ if (!result.ok) {
170
+ return [result, { status: "complete", request: req, response }];
171
+ }
172
+
173
+ return [result, { status: "complete", request: req, response }];
174
+ }
@@ -0,0 +1,162 @@
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 * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.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 { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Query traces with OQL
30
+ *
31
+ * @remarks
32
+ * Run an OQL trace query. OQL is validated against the trace field registry and compiled through the trace planner.
33
+ */
34
+ export function tracesQuery(
35
+ client: OrqCore,
36
+ request: components.QueryTracesRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ components.QueryTracesResponse,
41
+ | OrqError
42
+ | ResponseValidationError
43
+ | ConnectionError
44
+ | RequestAbortedError
45
+ | RequestTimeoutError
46
+ | InvalidRequestError
47
+ | UnexpectedClientError
48
+ | SDKValidationError
49
+ >
50
+ > {
51
+ return new APIPromise($do(
52
+ client,
53
+ request,
54
+ options,
55
+ ));
56
+ }
57
+
58
+ async function $do(
59
+ client: OrqCore,
60
+ request: components.QueryTracesRequest,
61
+ options?: RequestOptions,
62
+ ): Promise<
63
+ [
64
+ Result<
65
+ components.QueryTracesResponse,
66
+ | OrqError
67
+ | ResponseValidationError
68
+ | ConnectionError
69
+ | RequestAbortedError
70
+ | RequestTimeoutError
71
+ | InvalidRequestError
72
+ | UnexpectedClientError
73
+ | SDKValidationError
74
+ >,
75
+ APICall,
76
+ ]
77
+ > {
78
+ const parsed = safeParse(
79
+ request,
80
+ (value) => components.QueryTracesRequest$outboundSchema.parse(value),
81
+ "Input validation failed",
82
+ );
83
+ if (!parsed.ok) {
84
+ return [parsed, { status: "invalid" }];
85
+ }
86
+ const payload = parsed.value;
87
+ const body = encodeJSON("body", payload, { explode: true });
88
+
89
+ const path = pathToFunc("/v2/traces/query")();
90
+
91
+ const headers = new Headers(compactMap({
92
+ "Content-Type": "application/json",
93
+ Accept: "application/json",
94
+ }));
95
+
96
+ const secConfig = await extractSecurity(client._options.apiKey);
97
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
98
+ const requestSecurity = resolveGlobalSecurity(securityInput);
99
+
100
+ const context = {
101
+ options: client._options,
102
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
103
+ operationID: "TracesQueryOql",
104
+ oAuth2Scopes: null,
105
+
106
+ resolvedSecurity: requestSecurity,
107
+
108
+ securitySource: client._options.apiKey,
109
+ retryConfig: options?.retries
110
+ || client._options.retryConfig
111
+ || { strategy: "none" },
112
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
113
+ };
114
+
115
+ const requestRes = client._createRequest(context, {
116
+ security: requestSecurity,
117
+ method: "POST",
118
+ baseURL: options?.serverURL,
119
+ path: path,
120
+ headers: headers,
121
+ body: body,
122
+ userAgent: client._options.userAgent,
123
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
124
+ }, options);
125
+ if (!requestRes.ok) {
126
+ return [requestRes, { status: "invalid" }];
127
+ }
128
+ const req = requestRes.value;
129
+
130
+ const doResult = await client._do(req, {
131
+ context,
132
+ isErrorStatusCode: (statusCode: number) =>
133
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
134
+ retryConfig: context.retryConfig,
135
+ retryCodes: context.retryCodes,
136
+ });
137
+ if (!doResult.ok) {
138
+ return [doResult, { status: "request-error", request: req }];
139
+ }
140
+ const response = doResult.value;
141
+
142
+ const [result] = await M.match<
143
+ components.QueryTracesResponse,
144
+ | OrqError
145
+ | ResponseValidationError
146
+ | ConnectionError
147
+ | RequestAbortedError
148
+ | RequestTimeoutError
149
+ | InvalidRequestError
150
+ | UnexpectedClientError
151
+ | SDKValidationError
152
+ >(
153
+ M.json(200, components.QueryTracesResponse$inboundSchema),
154
+ M.fail("4XX"),
155
+ M.fail("5XX"),
156
+ )(response, req);
157
+ if (!result.ok) {
158
+ return [result, { status: "complete", request: req, response }];
159
+ }
160
+
161
+ return [result, { status: "complete", request: req, response }];
162
+ }
@@ -0,0 +1,162 @@
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 * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.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 { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Search traces
30
+ *
31
+ * @remarks
32
+ * Search trace summaries using the structured trace filter contract.
33
+ */
34
+ export function tracesSearch(
35
+ client: OrqCore,
36
+ request: components.SearchTracesRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ components.SearchTracesResponse,
41
+ | OrqError
42
+ | ResponseValidationError
43
+ | ConnectionError
44
+ | RequestAbortedError
45
+ | RequestTimeoutError
46
+ | InvalidRequestError
47
+ | UnexpectedClientError
48
+ | SDKValidationError
49
+ >
50
+ > {
51
+ return new APIPromise($do(
52
+ client,
53
+ request,
54
+ options,
55
+ ));
56
+ }
57
+
58
+ async function $do(
59
+ client: OrqCore,
60
+ request: components.SearchTracesRequest,
61
+ options?: RequestOptions,
62
+ ): Promise<
63
+ [
64
+ Result<
65
+ components.SearchTracesResponse,
66
+ | OrqError
67
+ | ResponseValidationError
68
+ | ConnectionError
69
+ | RequestAbortedError
70
+ | RequestTimeoutError
71
+ | InvalidRequestError
72
+ | UnexpectedClientError
73
+ | SDKValidationError
74
+ >,
75
+ APICall,
76
+ ]
77
+ > {
78
+ const parsed = safeParse(
79
+ request,
80
+ (value) => components.SearchTracesRequest$outboundSchema.parse(value),
81
+ "Input validation failed",
82
+ );
83
+ if (!parsed.ok) {
84
+ return [parsed, { status: "invalid" }];
85
+ }
86
+ const payload = parsed.value;
87
+ const body = encodeJSON("body", payload, { explode: true });
88
+
89
+ const path = pathToFunc("/v2/traces/search")();
90
+
91
+ const headers = new Headers(compactMap({
92
+ "Content-Type": "application/json",
93
+ Accept: "application/json",
94
+ }));
95
+
96
+ const secConfig = await extractSecurity(client._options.apiKey);
97
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
98
+ const requestSecurity = resolveGlobalSecurity(securityInput);
99
+
100
+ const context = {
101
+ options: client._options,
102
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
103
+ operationID: "TracesSearch",
104
+ oAuth2Scopes: null,
105
+
106
+ resolvedSecurity: requestSecurity,
107
+
108
+ securitySource: client._options.apiKey,
109
+ retryConfig: options?.retries
110
+ || client._options.retryConfig
111
+ || { strategy: "none" },
112
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
113
+ };
114
+
115
+ const requestRes = client._createRequest(context, {
116
+ security: requestSecurity,
117
+ method: "POST",
118
+ baseURL: options?.serverURL,
119
+ path: path,
120
+ headers: headers,
121
+ body: body,
122
+ userAgent: client._options.userAgent,
123
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
124
+ }, options);
125
+ if (!requestRes.ok) {
126
+ return [requestRes, { status: "invalid" }];
127
+ }
128
+ const req = requestRes.value;
129
+
130
+ const doResult = await client._do(req, {
131
+ context,
132
+ isErrorStatusCode: (statusCode: number) =>
133
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
134
+ retryConfig: context.retryConfig,
135
+ retryCodes: context.retryCodes,
136
+ });
137
+ if (!doResult.ok) {
138
+ return [doResult, { status: "request-error", request: req }];
139
+ }
140
+ const response = doResult.value;
141
+
142
+ const [result] = await M.match<
143
+ components.SearchTracesResponse,
144
+ | OrqError
145
+ | ResponseValidationError
146
+ | ConnectionError
147
+ | RequestAbortedError
148
+ | RequestTimeoutError
149
+ | InvalidRequestError
150
+ | UnexpectedClientError
151
+ | SDKValidationError
152
+ >(
153
+ M.json(200, components.SearchTracesResponse$inboundSchema),
154
+ M.fail("4XX"),
155
+ M.fail("5XX"),
156
+ )(response, req);
157
+ if (!result.ok) {
158
+ return [result, { status: "complete", request: req, response }];
159
+ }
160
+
161
+ return [result, { status: "complete", request: req, response }];
162
+ }
@@ -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.11.0-rc.79",
62
- genVersion: "2.915.0",
63
- userAgent: "speakeasy-sdk/typescript 4.11.0-rc.79 2.915.0 2.0 @orq-ai/node",
61
+ sdkVersion: "4.12.0-rc.3",
62
+ genVersion: "2.915.1",
63
+ userAgent: "speakeasy-sdk/typescript 4.12.0-rc.3 2.915.1 2.0 @orq-ai/node",
64
64
  } as const;
@@ -38,6 +38,10 @@ export type Tool = {
38
38
  * Optional tool description
39
39
  */
40
40
  description?: string | undefined;
41
+ /**
42
+ * Static tool configuration set at design time. Merged over LLM-provided arguments at execution time.
43
+ */
44
+ configuration?: { [k: string]: any } | undefined;
41
45
  requiresApproval: boolean;
42
46
  /**
43
47
  * Nested tool ID for MCP tools (identifies specific tool within MCP server)
@@ -101,6 +105,7 @@ export const Tool$inboundSchema: z.ZodType<Tool, z.ZodTypeDef, unknown> = z
101
105
  action_type: z.string(),
102
106
  display_name: z.string().optional(),
103
107
  description: z.string().optional(),
108
+ configuration: z.record(z.any()).optional(),
104
109
  requires_approval: z.boolean().default(false),
105
110
  tool_id: z.string().optional(),
106
111
  conditions: z.array(z.lazy(() => Conditions$inboundSchema)).optional(),
@@ -97,6 +97,10 @@ export type Tools = {
97
97
  * Optional tool description
98
98
  */
99
99
  description?: string | undefined;
100
+ /**
101
+ * Static tool configuration set at design time. Merged over LLM-provided arguments at execution time.
102
+ */
103
+ configuration?: { [k: string]: any } | undefined;
100
104
  requiresApproval: boolean;
101
105
  /**
102
106
  * Nested tool ID for MCP tools (identifies specific tool within MCP server)
@@ -328,6 +332,7 @@ export const Tools$inboundSchema: z.ZodType<Tools, z.ZodTypeDef, unknown> = z
328
332
  action_type: z.string(),
329
333
  display_name: z.string().optional(),
330
334
  description: z.string().optional(),
335
+ configuration: z.record(z.any()).optional(),
331
336
  requires_approval: z.boolean().default(false),
332
337
  tool_id: z.string().optional(),
333
338
  conditions: z.array(
@@ -0,0 +1,65 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ TraceCompute,
9
+ TraceCompute$Outbound,
10
+ TraceCompute$outboundSchema,
11
+ } from "./tracecompute.js";
12
+ import {
13
+ TraceFilter,
14
+ TraceFilter$Outbound,
15
+ TraceFilter$outboundSchema,
16
+ } from "./tracefilter.js";
17
+
18
+ export type AggregateTracesRequest = {
19
+ from?: Date | undefined;
20
+ to?: Date | undefined;
21
+ filters?: Array<TraceFilter> | undefined;
22
+ groupBy?: Array<string> | undefined;
23
+ compute?: Array<TraceCompute> | undefined;
24
+ limit?: number | undefined;
25
+ filterOperator?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export type AggregateTracesRequest$Outbound = {
30
+ from?: string | undefined;
31
+ to?: string | undefined;
32
+ filters?: Array<TraceFilter$Outbound> | undefined;
33
+ group_by?: Array<string> | undefined;
34
+ compute?: Array<TraceCompute$Outbound> | undefined;
35
+ limit?: number | undefined;
36
+ filter_operator?: string | undefined;
37
+ };
38
+
39
+ /** @internal */
40
+ export const AggregateTracesRequest$outboundSchema: z.ZodType<
41
+ AggregateTracesRequest$Outbound,
42
+ z.ZodTypeDef,
43
+ AggregateTracesRequest
44
+ > = z.object({
45
+ from: z.date().transform(v => v.toISOString()).optional(),
46
+ to: z.date().transform(v => v.toISOString()).optional(),
47
+ filters: z.array(TraceFilter$outboundSchema).optional(),
48
+ groupBy: z.array(z.string()).optional(),
49
+ compute: z.array(TraceCompute$outboundSchema).optional(),
50
+ limit: z.number().int().optional(),
51
+ filterOperator: z.string().optional(),
52
+ }).transform((v) => {
53
+ return remap$(v, {
54
+ groupBy: "group_by",
55
+ filterOperator: "filter_operator",
56
+ });
57
+ });
58
+
59
+ export function aggregateTracesRequestToJSON(
60
+ aggregateTracesRequest: AggregateTracesRequest,
61
+ ): string {
62
+ return JSON.stringify(
63
+ AggregateTracesRequest$outboundSchema.parse(aggregateTracesRequest),
64
+ );
65
+ }
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ TraceAggregateRow,
11
+ TraceAggregateRow$inboundSchema,
12
+ } from "./traceaggregaterow.js";
13
+
14
+ export type AggregateTracesResponse = {
15
+ object?: string | undefined;
16
+ data?: Array<TraceAggregateRow> | undefined;
17
+ };
18
+
19
+ /** @internal */
20
+ export const AggregateTracesResponse$inboundSchema: z.ZodType<
21
+ AggregateTracesResponse,
22
+ z.ZodTypeDef,
23
+ unknown
24
+ > = z.object({
25
+ object: z.string().optional(),
26
+ data: z.array(TraceAggregateRow$inboundSchema).optional(),
27
+ });
28
+
29
+ export function aggregateTracesResponseFromJSON(
30
+ jsonString: string,
31
+ ): SafeParseResult<AggregateTracesResponse, SDKValidationError> {
32
+ return safeParse(
33
+ jsonString,
34
+ (x) => AggregateTracesResponse$inboundSchema.parse(JSON.parse(x)),
35
+ `Failed to parse 'AggregateTracesResponse' from JSON`,
36
+ );
37
+ }