@athenaintel/sdk 4.3.2191 → 4.3.2193

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 (35) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agents/resources/general/client/Client.d.ts +26 -2
  3. package/dist/cjs/api/resources/agents/resources/general/client/Client.js +91 -1
  4. package/dist/cjs/api/resources/agents/resources/general/client/index.d.ts +1 -1
  5. package/dist/cjs/api/resources/agents/resources/general/client/index.js +0 -15
  6. package/dist/cjs/api/resources/agents/resources/index.d.ts +0 -1
  7. package/dist/cjs/api/resources/agents/resources/index.js +0 -4
  8. package/dist/cjs/api/types/GeneralAgentAsyncInvokeResponseOut.d.ts +11 -0
  9. package/dist/cjs/api/{resources/agents/resources/general/client/requests → types}/GeneralAgentRequest.d.ts +2 -11
  10. package/dist/cjs/api/{resources/agents/resources/general/client/requests/index.js → types/GeneralAgentRequest.js} +1 -0
  11. package/dist/cjs/api/types/index.d.ts +2 -0
  12. package/dist/cjs/api/types/index.js +2 -0
  13. package/dist/cjs/version.d.ts +1 -1
  14. package/dist/cjs/version.js +1 -1
  15. package/dist/esm/BaseClient.mjs +2 -2
  16. package/dist/esm/api/resources/agents/resources/general/client/Client.d.mts +26 -2
  17. package/dist/esm/api/resources/agents/resources/general/client/Client.mjs +91 -1
  18. package/dist/esm/api/resources/agents/resources/general/client/index.d.mts +1 -1
  19. package/dist/esm/api/resources/agents/resources/general/client/index.mjs +1 -1
  20. package/dist/esm/api/resources/agents/resources/index.d.mts +0 -1
  21. package/dist/esm/api/resources/agents/resources/index.mjs +0 -1
  22. package/dist/esm/api/types/GeneralAgentAsyncInvokeResponseOut.d.mts +11 -0
  23. package/dist/esm/api/{resources/agents/resources/general/client/requests → types}/GeneralAgentRequest.d.mts +2 -11
  24. package/dist/esm/api/types/GeneralAgentRequest.mjs +2 -0
  25. package/dist/esm/api/types/index.d.mts +2 -0
  26. package/dist/esm/api/types/index.mjs +2 -0
  27. package/dist/esm/version.d.mts +1 -1
  28. package/dist/esm/version.mjs +1 -1
  29. package/package.json +1 -1
  30. package/reference.md +72 -1
  31. package/dist/cjs/api/resources/agents/resources/general/client/requests/index.d.ts +0 -1
  32. package/dist/esm/api/resources/agents/resources/general/client/requests/index.d.mts +0 -1
  33. package/dist/esm/api/resources/agents/resources/general/client/requests/index.mjs +0 -1
  34. /package/dist/cjs/api/{resources/agents/resources/general/client/requests/GeneralAgentRequest.js → types/GeneralAgentAsyncInvokeResponseOut.js} +0 -0
  35. /package/dist/esm/api/{resources/agents/resources/general/client/requests/GeneralAgentRequest.mjs → types/GeneralAgentAsyncInvokeResponseOut.mjs} +0 -0
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@athenaintel/sdk",
46
- "X-Fern-SDK-Version": "4.3.2191",
47
- "User-Agent": "@athenaintel/sdk/4.3.2191",
46
+ "X-Fern-SDK-Version": "4.3.2193",
47
+ "User-Agent": "@athenaintel/sdk/4.3.2193",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -17,7 +17,7 @@ export declare class GeneralClient {
17
17
  * Call the agent with the messages list, wait for the agent to complete,
18
18
  * and return the result.
19
19
  *
20
- * @param {AthenaIntelligence.agents.GeneralAgentRequest} request
20
+ * @param {AthenaIntelligence.GeneralAgentRequest} request
21
21
  * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
22
22
  *
23
23
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
@@ -33,6 +33,30 @@ export declare class GeneralClient {
33
33
  * }]
34
34
  * })
35
35
  */
36
- invoke(request: AthenaIntelligence.agents.GeneralAgentRequest, requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse>;
36
+ invoke(request: AthenaIntelligence.GeneralAgentRequest, requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse>;
37
37
  private __invoke;
38
+ /**
39
+ * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it.
40
+ *
41
+ * @param {AthenaIntelligence.GeneralAgentRequest} request
42
+ * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
43
+ *
44
+ * @throws {@link AthenaIntelligence.ForbiddenError}
45
+ * @throws {@link AthenaIntelligence.NotFoundError}
46
+ * @throws {@link AthenaIntelligence.ConflictError}
47
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
48
+ *
49
+ * @example
50
+ * await client.agents.general.invokeAsync({
51
+ * config: {
52
+ * enabled_tools: ["search"]
53
+ * },
54
+ * messages: [{
55
+ * content: "Please call the search tool for AAPL news.",
56
+ * role: "user"
57
+ * }]
58
+ * })
59
+ */
60
+ invokeAsync(request: AthenaIntelligence.GeneralAgentRequest, requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentAsyncInvokeResponseOut>;
61
+ private __invokeAsync;
38
62
  }
@@ -60,7 +60,7 @@ class GeneralClient {
60
60
  * Call the agent with the messages list, wait for the agent to complete,
61
61
  * and return the result.
62
62
  *
63
- * @param {AthenaIntelligence.agents.GeneralAgentRequest} request
63
+ * @param {AthenaIntelligence.GeneralAgentRequest} request
64
64
  * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
65
65
  *
66
66
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
@@ -138,5 +138,95 @@ class GeneralClient {
138
138
  }
139
139
  });
140
140
  }
141
+ /**
142
+ * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it.
143
+ *
144
+ * @param {AthenaIntelligence.GeneralAgentRequest} request
145
+ * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
146
+ *
147
+ * @throws {@link AthenaIntelligence.ForbiddenError}
148
+ * @throws {@link AthenaIntelligence.NotFoundError}
149
+ * @throws {@link AthenaIntelligence.ConflictError}
150
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
151
+ *
152
+ * @example
153
+ * await client.agents.general.invokeAsync({
154
+ * config: {
155
+ * enabled_tools: ["search"]
156
+ * },
157
+ * messages: [{
158
+ * content: "Please call the search tool for AAPL news.",
159
+ * role: "user"
160
+ * }]
161
+ * })
162
+ */
163
+ invokeAsync(request, requestOptions) {
164
+ return core.HttpResponsePromise.fromPromise(this.__invokeAsync(request, requestOptions));
165
+ }
166
+ __invokeAsync(request, requestOptions) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
169
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
170
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
171
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
172
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, "api/v0/agents/general/invoke-async"),
173
+ method: "POST",
174
+ headers: _headers,
175
+ contentType: "application/json",
176
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
177
+ requestType: "json",
178
+ body: request,
179
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
180
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
181
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
182
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
183
+ logging: this._options.logging,
184
+ });
185
+ if (_response.ok) {
186
+ return {
187
+ data: _response.body,
188
+ rawResponse: _response.rawResponse,
189
+ };
190
+ }
191
+ if (_response.error.reason === "status-code") {
192
+ switch (_response.error.statusCode) {
193
+ case 403:
194
+ throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
195
+ case 404:
196
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
197
+ case 409:
198
+ throw new AthenaIntelligence.ConflictError(_response.error.body, _response.rawResponse);
199
+ case 422:
200
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
201
+ default:
202
+ throw new errors.AthenaIntelligenceError({
203
+ statusCode: _response.error.statusCode,
204
+ body: _response.error.body,
205
+ rawResponse: _response.rawResponse,
206
+ });
207
+ }
208
+ }
209
+ switch (_response.error.reason) {
210
+ case "non-json":
211
+ throw new errors.AthenaIntelligenceError({
212
+ statusCode: _response.error.statusCode,
213
+ body: _response.error.rawBody,
214
+ rawResponse: _response.rawResponse,
215
+ });
216
+ case "body-is-null":
217
+ throw new errors.AthenaIntelligenceError({
218
+ statusCode: _response.error.statusCode,
219
+ rawResponse: _response.rawResponse,
220
+ });
221
+ case "timeout":
222
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/agents/general/invoke-async.");
223
+ case "unknown":
224
+ throw new errors.AthenaIntelligenceError({
225
+ message: _response.error.errorMessage,
226
+ rawResponse: _response.rawResponse,
227
+ });
228
+ }
229
+ });
230
+ }
141
231
  }
142
232
  exports.GeneralClient = GeneralClient;
@@ -1 +1 @@
1
- export * from "./requests/index.js";
1
+ export {};
@@ -1,17 +1,2 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./requests/index.js"), exports);
@@ -1,2 +1 @@
1
- export * from "./general/client/requests/index.js";
2
1
  export * as general from "./general/index.js";
@@ -15,9 +15,6 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
- };
21
18
  var __importStar = (this && this.__importStar) || (function () {
22
19
  var ownKeys = function(o) {
23
20
  ownKeys = Object.getOwnPropertyNames || function (o) {
@@ -37,5 +34,4 @@ var __importStar = (this && this.__importStar) || (function () {
37
34
  })();
38
35
  Object.defineProperty(exports, "__esModule", { value: true });
39
36
  exports.general = void 0;
40
- __exportStar(require("./general/client/requests/index.js"), exports);
41
37
  exports.general = __importStar(require("./general/index.js"));
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Acknowledgement for an asynchronous general-agent invocation.
3
+ */
4
+ export interface GeneralAgentAsyncInvokeResponseOut {
5
+ /** Human-readable status message */
6
+ message: string;
7
+ /** Status of the invocation (always 'started' for async) */
8
+ status: string;
9
+ /** Thread ID of the run. Poll `GET /threads/{thread_id}/status` (`client.threads.get_status`) until `status` is 'completed' or 'failed'; pass `include_messages=true` to read the agent's reply. */
10
+ thread_id: string;
11
+ }
@@ -1,15 +1,6 @@
1
- import type * as AthenaIntelligence from "../../../../../../index.js";
1
+ import type * as AthenaIntelligence from "../index.js";
2
2
  /**
3
- * @example
4
- * {
5
- * config: {
6
- * enabled_tools: ["search"]
7
- * },
8
- * messages: [{
9
- * content: "Please call the search tool for AAPL news.",
10
- * role: "user"
11
- * }]
12
- * }
3
+ * A chat request for the Athena SDK.
13
4
  */
14
5
  export interface GeneralAgentRequest {
15
6
  /** The channel through which the request is being made. */
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -69,7 +69,9 @@ export * from "./EmailSearchResponseOut.js";
69
69
  export * from "./EmailSearchResultOut.js";
70
70
  export * from "./FileTooLargeError.js";
71
71
  export * from "./FolderResponse.js";
72
+ export * from "./GeneralAgentAsyncInvokeResponseOut.js";
72
73
  export * from "./GeneralAgentConfig.js";
74
+ export * from "./GeneralAgentRequest.js";
73
75
  export * from "./GeneralAgentResponse.js";
74
76
  export * from "./GeneralAgentResponseMessage.js";
75
77
  export * from "./GeneralAgentResponseMessageKwargs.js";
@@ -85,7 +85,9 @@ __exportStar(require("./EmailSearchResponseOut.js"), exports);
85
85
  __exportStar(require("./EmailSearchResultOut.js"), exports);
86
86
  __exportStar(require("./FileTooLargeError.js"), exports);
87
87
  __exportStar(require("./FolderResponse.js"), exports);
88
+ __exportStar(require("./GeneralAgentAsyncInvokeResponseOut.js"), exports);
88
89
  __exportStar(require("./GeneralAgentConfig.js"), exports);
90
+ __exportStar(require("./GeneralAgentRequest.js"), exports);
89
91
  __exportStar(require("./GeneralAgentResponse.js"), exports);
90
92
  __exportStar(require("./GeneralAgentResponseMessage.js"), exports);
91
93
  __exportStar(require("./GeneralAgentResponseMessageKwargs.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.2191";
1
+ export declare const SDK_VERSION = "4.3.2193";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "4.3.2191";
4
+ exports.SDK_VERSION = "4.3.2193";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@athenaintel/sdk",
9
- "X-Fern-SDK-Version": "4.3.2191",
10
- "User-Agent": "@athenaintel/sdk/4.3.2191",
9
+ "X-Fern-SDK-Version": "4.3.2193",
10
+ "User-Agent": "@athenaintel/sdk/4.3.2193",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -17,7 +17,7 @@ export declare class GeneralClient {
17
17
  * Call the agent with the messages list, wait for the agent to complete,
18
18
  * and return the result.
19
19
  *
20
- * @param {AthenaIntelligence.agents.GeneralAgentRequest} request
20
+ * @param {AthenaIntelligence.GeneralAgentRequest} request
21
21
  * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
22
22
  *
23
23
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
@@ -33,6 +33,30 @@ export declare class GeneralClient {
33
33
  * }]
34
34
  * })
35
35
  */
36
- invoke(request: AthenaIntelligence.agents.GeneralAgentRequest, requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse>;
36
+ invoke(request: AthenaIntelligence.GeneralAgentRequest, requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse>;
37
37
  private __invoke;
38
+ /**
39
+ * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it.
40
+ *
41
+ * @param {AthenaIntelligence.GeneralAgentRequest} request
42
+ * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
43
+ *
44
+ * @throws {@link AthenaIntelligence.ForbiddenError}
45
+ * @throws {@link AthenaIntelligence.NotFoundError}
46
+ * @throws {@link AthenaIntelligence.ConflictError}
47
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
48
+ *
49
+ * @example
50
+ * await client.agents.general.invokeAsync({
51
+ * config: {
52
+ * enabled_tools: ["search"]
53
+ * },
54
+ * messages: [{
55
+ * content: "Please call the search tool for AAPL news.",
56
+ * role: "user"
57
+ * }]
58
+ * })
59
+ */
60
+ invokeAsync(request: AthenaIntelligence.GeneralAgentRequest, requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentAsyncInvokeResponseOut>;
61
+ private __invokeAsync;
38
62
  }
@@ -24,7 +24,7 @@ export class GeneralClient {
24
24
  * Call the agent with the messages list, wait for the agent to complete,
25
25
  * and return the result.
26
26
  *
27
- * @param {AthenaIntelligence.agents.GeneralAgentRequest} request
27
+ * @param {AthenaIntelligence.GeneralAgentRequest} request
28
28
  * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
29
29
  *
30
30
  * @throws {@link AthenaIntelligence.UnprocessableEntityError}
@@ -102,4 +102,94 @@ export class GeneralClient {
102
102
  }
103
103
  });
104
104
  }
105
+ /**
106
+ * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it.
107
+ *
108
+ * @param {AthenaIntelligence.GeneralAgentRequest} request
109
+ * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
110
+ *
111
+ * @throws {@link AthenaIntelligence.ForbiddenError}
112
+ * @throws {@link AthenaIntelligence.NotFoundError}
113
+ * @throws {@link AthenaIntelligence.ConflictError}
114
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
115
+ *
116
+ * @example
117
+ * await client.agents.general.invokeAsync({
118
+ * config: {
119
+ * enabled_tools: ["search"]
120
+ * },
121
+ * messages: [{
122
+ * content: "Please call the search tool for AAPL news.",
123
+ * role: "user"
124
+ * }]
125
+ * })
126
+ */
127
+ invokeAsync(request, requestOptions) {
128
+ return core.HttpResponsePromise.fromPromise(this.__invokeAsync(request, requestOptions));
129
+ }
130
+ __invokeAsync(request, requestOptions) {
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
133
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
134
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
135
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
136
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, "api/v0/agents/general/invoke-async"),
137
+ method: "POST",
138
+ headers: _headers,
139
+ contentType: "application/json",
140
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
141
+ requestType: "json",
142
+ body: request,
143
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
144
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
145
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
146
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
147
+ logging: this._options.logging,
148
+ });
149
+ if (_response.ok) {
150
+ return {
151
+ data: _response.body,
152
+ rawResponse: _response.rawResponse,
153
+ };
154
+ }
155
+ if (_response.error.reason === "status-code") {
156
+ switch (_response.error.statusCode) {
157
+ case 403:
158
+ throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
159
+ case 404:
160
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
161
+ case 409:
162
+ throw new AthenaIntelligence.ConflictError(_response.error.body, _response.rawResponse);
163
+ case 422:
164
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
165
+ default:
166
+ throw new errors.AthenaIntelligenceError({
167
+ statusCode: _response.error.statusCode,
168
+ body: _response.error.body,
169
+ rawResponse: _response.rawResponse,
170
+ });
171
+ }
172
+ }
173
+ switch (_response.error.reason) {
174
+ case "non-json":
175
+ throw new errors.AthenaIntelligenceError({
176
+ statusCode: _response.error.statusCode,
177
+ body: _response.error.rawBody,
178
+ rawResponse: _response.rawResponse,
179
+ });
180
+ case "body-is-null":
181
+ throw new errors.AthenaIntelligenceError({
182
+ statusCode: _response.error.statusCode,
183
+ rawResponse: _response.rawResponse,
184
+ });
185
+ case "timeout":
186
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/agents/general/invoke-async.");
187
+ case "unknown":
188
+ throw new errors.AthenaIntelligenceError({
189
+ message: _response.error.errorMessage,
190
+ rawResponse: _response.rawResponse,
191
+ });
192
+ }
193
+ });
194
+ }
105
195
  }
@@ -1 +1 @@
1
- export * from "./requests/index.mjs";
1
+ export {};
@@ -1 +1 @@
1
- export * from "./requests/index.mjs";
1
+ export {};
@@ -1,2 +1 @@
1
- export * from "./general/client/requests/index.mjs";
2
1
  export * as general from "./general/index.mjs";
@@ -1,2 +1 @@
1
- export * from "./general/client/requests/index.mjs";
2
1
  export * as general from "./general/index.mjs";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Acknowledgement for an asynchronous general-agent invocation.
3
+ */
4
+ export interface GeneralAgentAsyncInvokeResponseOut {
5
+ /** Human-readable status message */
6
+ message: string;
7
+ /** Status of the invocation (always 'started' for async) */
8
+ status: string;
9
+ /** Thread ID of the run. Poll `GET /threads/{thread_id}/status` (`client.threads.get_status`) until `status` is 'completed' or 'failed'; pass `include_messages=true` to read the agent's reply. */
10
+ thread_id: string;
11
+ }
@@ -1,15 +1,6 @@
1
- import type * as AthenaIntelligence from "../../../../../../index.mjs";
1
+ import type * as AthenaIntelligence from "../index.mjs";
2
2
  /**
3
- * @example
4
- * {
5
- * config: {
6
- * enabled_tools: ["search"]
7
- * },
8
- * messages: [{
9
- * content: "Please call the search tool for AAPL news.",
10
- * role: "user"
11
- * }]
12
- * }
3
+ * A chat request for the Athena SDK.
13
4
  */
14
5
  export interface GeneralAgentRequest {
15
6
  /** The channel through which the request is being made. */
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -69,7 +69,9 @@ export * from "./EmailSearchResponseOut.mjs";
69
69
  export * from "./EmailSearchResultOut.mjs";
70
70
  export * from "./FileTooLargeError.mjs";
71
71
  export * from "./FolderResponse.mjs";
72
+ export * from "./GeneralAgentAsyncInvokeResponseOut.mjs";
72
73
  export * from "./GeneralAgentConfig.mjs";
74
+ export * from "./GeneralAgentRequest.mjs";
73
75
  export * from "./GeneralAgentResponse.mjs";
74
76
  export * from "./GeneralAgentResponseMessage.mjs";
75
77
  export * from "./GeneralAgentResponseMessageKwargs.mjs";
@@ -69,7 +69,9 @@ export * from "./EmailSearchResponseOut.mjs";
69
69
  export * from "./EmailSearchResultOut.mjs";
70
70
  export * from "./FileTooLargeError.mjs";
71
71
  export * from "./FolderResponse.mjs";
72
+ export * from "./GeneralAgentAsyncInvokeResponseOut.mjs";
72
73
  export * from "./GeneralAgentConfig.mjs";
74
+ export * from "./GeneralAgentRequest.mjs";
73
75
  export * from "./GeneralAgentResponse.mjs";
74
76
  export * from "./GeneralAgentResponseMessage.mjs";
75
77
  export * from "./GeneralAgentResponseMessageKwargs.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.2191";
1
+ export declare const SDK_VERSION = "4.3.2193";
@@ -1 +1 @@
1
- export const SDK_VERSION = "4.3.2191";
1
+ export const SDK_VERSION = "4.3.2193";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenaintel/sdk",
3
- "version": "4.3.2191",
3
+ "version": "4.3.2193",
4
4
  "private": false,
5
5
  "repository": "github:Athena-Intel/athena-typescript",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -5245,7 +5245,78 @@ await client.agents.general.invoke({
5245
5245
  <dl>
5246
5246
  <dd>
5247
5247
 
5248
- **request:** `AthenaIntelligence.agents.GeneralAgentRequest`
5248
+ **request:** `AthenaIntelligence.GeneralAgentRequest`
5249
+
5250
+ </dd>
5251
+ </dl>
5252
+
5253
+ <dl>
5254
+ <dd>
5255
+
5256
+ **requestOptions:** `GeneralClient.RequestOptions`
5257
+
5258
+ </dd>
5259
+ </dl>
5260
+ </dd>
5261
+ </dl>
5262
+
5263
+
5264
+ </dd>
5265
+ </dl>
5266
+ </details>
5267
+
5268
+ <details><summary><code>client.agents.general.<a href="/src/api/resources/agents/resources/general/client/Client.ts">invokeAsync</a>({ ...params }) -> AthenaIntelligence.GeneralAgentAsyncInvokeResponseOut</code></summary>
5269
+ <dl>
5270
+ <dd>
5271
+
5272
+ #### 📝 Description
5273
+
5274
+ <dl>
5275
+ <dd>
5276
+
5277
+ <dl>
5278
+ <dd>
5279
+
5280
+ Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it.
5281
+ </dd>
5282
+ </dl>
5283
+ </dd>
5284
+ </dl>
5285
+
5286
+ #### 🔌 Usage
5287
+
5288
+ <dl>
5289
+ <dd>
5290
+
5291
+ <dl>
5292
+ <dd>
5293
+
5294
+ ```typescript
5295
+ await client.agents.general.invokeAsync({
5296
+ config: {
5297
+ enabled_tools: ["search"]
5298
+ },
5299
+ messages: [{
5300
+ content: "Please call the search tool for AAPL news.",
5301
+ role: "user"
5302
+ }]
5303
+ });
5304
+
5305
+ ```
5306
+ </dd>
5307
+ </dl>
5308
+ </dd>
5309
+ </dl>
5310
+
5311
+ #### ⚙️ Parameters
5312
+
5313
+ <dl>
5314
+ <dd>
5315
+
5316
+ <dl>
5317
+ <dd>
5318
+
5319
+ **request:** `AthenaIntelligence.GeneralAgentRequest`
5249
5320
 
5250
5321
  </dd>
5251
5322
  </dl>
@@ -1 +0,0 @@
1
- export type { GeneralAgentRequest } from "./GeneralAgentRequest.js";
@@ -1 +0,0 @@
1
- export type { GeneralAgentRequest } from "./GeneralAgentRequest.mjs";