@aui.io/aui-client 1.2.36 → 1.2.38

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 CHANGED
@@ -272,15 +272,16 @@ Submit a new message to an existing task (non-streaming).
272
272
  ```typescript
273
273
  const messageResponse = await client.controllerApi.sendMessage({
274
274
  task_id: string, // Task identifier
275
- text: string, // Message text
275
+ text?: string, // Message text (optional in v1.2.36+)
276
276
  is_external_api?: boolean, // Optional: mark as external API call
277
- include_trace_info?: boolean, // Optional: include trace/debug info in response (NEW)
277
+ include_trace_info?: boolean, // Optional: include trace/debug info in response (NEW in v1.2.35)
278
278
  context?: { // Optional: additional context
279
279
  url?: string,
280
280
  lead_details?: Record<string, any>,
281
281
  welcome_message?: string
282
282
  },
283
- agent_variables?: Record<string, unknown> // Optional: custom agent variables
283
+ agent_variables?: Record<string, unknown>, // Optional: custom agent variables
284
+ static_context?: Record<string, unknown> // Optional: static context data (NEW in v1.2.36)
284
285
  });
285
286
 
286
287
  // Returns: Message - Complete agent response with optional product cards
@@ -351,23 +352,33 @@ const traceInfo = await client.controllerApi.getTraceInfo('your-task-id', messag
351
352
  console.log('Trace Info:', traceInfo);
352
353
  ```
353
354
 
354
- #### `getDirectFollowupSuggestions(taskId)` - Get Direct Followup Suggestions (NEW in v1.2.28)
355
- Retrieve AI-generated followup suggestions for a specific task.
355
+ #### `getDirectFollowupSuggestions(request?)` - Get Direct Followup Suggestions
356
+ Retrieve AI-generated followup suggestions. Accepts optional `context` and `created_by` parameters.
356
357
 
357
358
  ```typescript
358
- const suggestions: string[] = await client.controllerApi.getDirectFollowupSuggestions('your-task-id');
359
+ const response = await client.controllerApi.getDirectFollowupSuggestions({
360
+ context?: Record<string, unknown>, // Optional: context data (e.g., { task_id: 'xxx' })
361
+ created_by?: string // Optional: user identifier
362
+ });
359
363
 
360
- // Returns: string[] - Array of suggested followup questions
364
+ // Returns: DirectFollowupSuggestionsResponse
365
+ // {
366
+ // suggestions?: string[], // Array of suggested followup questions
367
+ // metadata_id?: string // Metadata ID for tracking/analytics
368
+ // }
361
369
  ```
362
370
 
363
371
  **Example:**
364
372
 
365
373
  ```typescript
366
- // Get followup suggestions for a task
367
- const suggestions: string[] = await client.controllerApi.getDirectFollowupSuggestions('your-task-id');
374
+ const response = await client.controllerApi.getDirectFollowupSuggestions({
375
+ context: { task_id: 'your-task-id' },
376
+ created_by: 'user123'
377
+ });
368
378
 
379
+ console.log('Metadata ID:', response.metadata_id);
369
380
  console.log('Suggested followups:');
370
- suggestions.forEach((suggestion, index) => {
381
+ response.suggestions?.forEach((suggestion, index) => {
371
382
  console.log(`${index + 1}. ${suggestion}`);
372
383
  });
373
384
  ```
@@ -656,7 +667,7 @@ async function debugAgentResponse(taskId: string) {
656
667
  debugAgentResponse('task-123');
657
668
  ```
658
669
 
659
- ### Get Direct Followup Suggestions (NEW in v1.2.28)
670
+ ### Get Direct Followup Suggestions
660
671
 
661
672
  ```typescript
662
673
  import { ApolloClient } from '@aui.io/aui-client';
@@ -665,18 +676,21 @@ const client = new ApolloClient({
665
676
  networkApiKey: 'API_KEY_YOUR_KEY_HERE'
666
677
  });
667
678
 
668
- async function getSuggestedQuestions(taskId: string) {
679
+ async function getSuggestedQuestions(taskId: string, userId: string) {
669
680
  try {
670
- // Get AI-generated followup suggestions based on conversation context
671
- const suggestions = await client.controllerApi.getDirectFollowupSuggestions(taskId);
681
+ // Get AI-generated followup suggestions with context and user info
682
+ const response = await client.controllerApi.getDirectFollowupSuggestions({
683
+ context: { task_id: taskId },
684
+ created_by: userId
685
+ });
672
686
 
687
+ console.log('Metadata ID:', response.metadata_id);
673
688
  console.log('Suggested followup questions:');
674
- suggestions.forEach((suggestion, index) => {
689
+ response.suggestions?.forEach((suggestion, index) => {
675
690
  console.log(` ${index + 1}. ${suggestion}`);
676
691
  });
677
692
 
678
- // Use these suggestions to guide the user's next interaction
679
- return suggestions;
693
+ return response;
680
694
  } catch (error) {
681
695
  console.error('Error getting suggestions:', error);
682
696
  throw error;
@@ -684,8 +698,9 @@ async function getSuggestedQuestions(taskId: string) {
684
698
  }
685
699
 
686
700
  // Example usage
687
- getSuggestedQuestions('task-123');
701
+ getSuggestedQuestions('task-123', 'user-456');
688
702
  // Output:
703
+ // Metadata ID: 69e4b4d4359671434fdff849
689
704
  // Suggested followup questions:
690
705
  // 1. "What colors are available?"
691
706
  // 2. "Do you offer financing options?"
@@ -45,8 +45,8 @@ class ApolloClient {
45
45
  "x-network-api-key": _options === null || _options === void 0 ? void 0 : _options.networkApiKey,
46
46
  "X-Fern-Language": "JavaScript",
47
47
  "X-Fern-SDK-Name": "@aui.io/aui-client",
48
- "X-Fern-SDK-Version": "1.2.36",
49
- "User-Agent": "@aui.io/aui-client/1.2.36",
48
+ "X-Fern-SDK-Version": "1.2.38",
49
+ "User-Agent": "@aui.io/aui-client/1.2.38",
50
50
  "X-Fern-Runtime": core.RUNTIME.type,
51
51
  "X-Fern-Runtime-Version": core.RUNTIME.version,
52
52
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -103,15 +103,15 @@ export declare class ControllerApi {
103
103
  getAgentContext(request: Record<string, unknown>, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.CreateTopicRequestBody>;
104
104
  private __getAgentContext;
105
105
  /**
106
- * @param {string} taskId
106
+ * @param {Apollo.DirectFollowupSuggestionsRequest} request
107
107
  * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
108
108
  *
109
109
  * @throws {@link Apollo.UnprocessableEntityError}
110
110
  *
111
111
  * @example
112
- * await client.controllerApi.getDirectFollowupSuggestions("task_id")
112
+ * await client.controllerApi.getDirectFollowupSuggestions()
113
113
  */
114
- getDirectFollowupSuggestions(taskId: string, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.DirectFollowupSuggestionsResponse>;
114
+ getDirectFollowupSuggestions(request?: Apollo.DirectFollowupSuggestionsRequest, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.DirectFollowupSuggestionsResponse>;
115
115
  private __getDirectFollowupSuggestions;
116
116
  /**
117
117
  * @param {string} taskId
@@ -536,28 +536,31 @@ class ControllerApi {
536
536
  });
537
537
  }
538
538
  /**
539
- * @param {string} taskId
539
+ * @param {Apollo.DirectFollowupSuggestionsRequest} request
540
540
  * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
541
541
  *
542
542
  * @throws {@link Apollo.UnprocessableEntityError}
543
543
  *
544
544
  * @example
545
- * await client.controllerApi.getDirectFollowupSuggestions("task_id")
545
+ * await client.controllerApi.getDirectFollowupSuggestions()
546
546
  */
547
- getDirectFollowupSuggestions(taskId, requestOptions) {
548
- return core.HttpResponsePromise.fromPromise(this.__getDirectFollowupSuggestions(taskId, requestOptions));
547
+ getDirectFollowupSuggestions(request = {}, requestOptions) {
548
+ return core.HttpResponsePromise.fromPromise(this.__getDirectFollowupSuggestions(request, requestOptions));
549
549
  }
550
- __getDirectFollowupSuggestions(taskId, requestOptions) {
551
- return __awaiter(this, void 0, void 0, function* () {
550
+ __getDirectFollowupSuggestions() {
551
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
552
552
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
553
553
  const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
554
554
  "x-network-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.networkApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.networkApiKey,
555
555
  }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
556
556
  const _response = yield core.fetcher({
557
- url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `api/v1/external/tasks/${core.url.encodePathParam(taskId)}/direct-followup-suggestions`),
558
- method: "GET",
557
+ url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, "api/v1/external/direct-followup-suggestions"),
558
+ method: "POST",
559
559
  headers: _headers,
560
+ contentType: "application/json",
560
561
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
562
+ requestType: "json",
563
+ body: request,
561
564
  timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
562
565
  maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
563
566
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -590,7 +593,7 @@ class ControllerApi {
590
593
  rawResponse: _response.rawResponse,
591
594
  });
592
595
  case "timeout":
593
- throw new errors.ApolloTimeoutError("Timeout exceeded when calling GET /api/v1/external/tasks/{task_id}/direct-followup-suggestions.");
596
+ throw new errors.ApolloTimeoutError("Timeout exceeded when calling POST /api/v1/external/direct-followup-suggestions.");
594
597
  case "unknown":
595
598
  throw new errors.ApolloError({
596
599
  message: _response.error.errorMessage,
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface DirectFollowupSuggestionsRequest {
6
+ context?: Record<string, unknown>;
7
+ created_by?: string;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,5 @@
1
1
  export type { CreateTaskRequest } from "./CreateTaskRequest.js";
2
+ export type { DirectFollowupSuggestionsRequest } from "./DirectFollowupSuggestionsRequest.js";
2
3
  export type { ExternalWidgetRenderRequest } from "./ExternalWidgetRenderRequest.js";
3
4
  export type { GetProductMetadataRequest } from "./GetProductMetadataRequest.js";
4
5
  export type { ListUserTasksRequest } from "./ListUserTasksRequest.js";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.2.36";
1
+ export declare const SDK_VERSION = "1.2.38";
@@ -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 = "1.2.36";
4
+ exports.SDK_VERSION = "1.2.38";
@@ -9,8 +9,8 @@ export class ApolloClient {
9
9
  "x-network-api-key": _options === null || _options === void 0 ? void 0 : _options.networkApiKey,
10
10
  "X-Fern-Language": "JavaScript",
11
11
  "X-Fern-SDK-Name": "@aui.io/aui-client",
12
- "X-Fern-SDK-Version": "1.2.36",
13
- "User-Agent": "@aui.io/aui-client/1.2.36",
12
+ "X-Fern-SDK-Version": "1.2.38",
13
+ "User-Agent": "@aui.io/aui-client/1.2.38",
14
14
  "X-Fern-Runtime": core.RUNTIME.type,
15
15
  "X-Fern-Runtime-Version": core.RUNTIME.version,
16
16
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -103,15 +103,15 @@ export declare class ControllerApi {
103
103
  getAgentContext(request: Record<string, unknown>, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.CreateTopicRequestBody>;
104
104
  private __getAgentContext;
105
105
  /**
106
- * @param {string} taskId
106
+ * @param {Apollo.DirectFollowupSuggestionsRequest} request
107
107
  * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
108
108
  *
109
109
  * @throws {@link Apollo.UnprocessableEntityError}
110
110
  *
111
111
  * @example
112
- * await client.controllerApi.getDirectFollowupSuggestions("task_id")
112
+ * await client.controllerApi.getDirectFollowupSuggestions()
113
113
  */
114
- getDirectFollowupSuggestions(taskId: string, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.DirectFollowupSuggestionsResponse>;
114
+ getDirectFollowupSuggestions(request?: Apollo.DirectFollowupSuggestionsRequest, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.DirectFollowupSuggestionsResponse>;
115
115
  private __getDirectFollowupSuggestions;
116
116
  /**
117
117
  * @param {string} taskId
@@ -500,28 +500,31 @@ export class ControllerApi {
500
500
  });
501
501
  }
502
502
  /**
503
- * @param {string} taskId
503
+ * @param {Apollo.DirectFollowupSuggestionsRequest} request
504
504
  * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
505
505
  *
506
506
  * @throws {@link Apollo.UnprocessableEntityError}
507
507
  *
508
508
  * @example
509
- * await client.controllerApi.getDirectFollowupSuggestions("task_id")
509
+ * await client.controllerApi.getDirectFollowupSuggestions()
510
510
  */
511
- getDirectFollowupSuggestions(taskId, requestOptions) {
512
- return core.HttpResponsePromise.fromPromise(this.__getDirectFollowupSuggestions(taskId, requestOptions));
511
+ getDirectFollowupSuggestions(request = {}, requestOptions) {
512
+ return core.HttpResponsePromise.fromPromise(this.__getDirectFollowupSuggestions(request, requestOptions));
513
513
  }
514
- __getDirectFollowupSuggestions(taskId, requestOptions) {
515
- return __awaiter(this, void 0, void 0, function* () {
514
+ __getDirectFollowupSuggestions() {
515
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
516
516
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
517
517
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
518
518
  "x-network-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.networkApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.networkApiKey,
519
519
  }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
520
520
  const _response = yield core.fetcher({
521
- url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `api/v1/external/tasks/${core.url.encodePathParam(taskId)}/direct-followup-suggestions`),
522
- method: "GET",
521
+ url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, "api/v1/external/direct-followup-suggestions"),
522
+ method: "POST",
523
523
  headers: _headers,
524
+ contentType: "application/json",
524
525
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
526
+ requestType: "json",
527
+ body: request,
525
528
  timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
526
529
  maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
527
530
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -554,7 +557,7 @@ export class ControllerApi {
554
557
  rawResponse: _response.rawResponse,
555
558
  });
556
559
  case "timeout":
557
- throw new errors.ApolloTimeoutError("Timeout exceeded when calling GET /api/v1/external/tasks/{task_id}/direct-followup-suggestions.");
560
+ throw new errors.ApolloTimeoutError("Timeout exceeded when calling POST /api/v1/external/direct-followup-suggestions.");
558
561
  case "unknown":
559
562
  throw new errors.ApolloError({
560
563
  message: _response.error.errorMessage,
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface DirectFollowupSuggestionsRequest {
6
+ context?: Record<string, unknown>;
7
+ created_by?: string;
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,4 +1,5 @@
1
1
  export type { CreateTaskRequest } from "./CreateTaskRequest.mjs";
2
+ export type { DirectFollowupSuggestionsRequest } from "./DirectFollowupSuggestionsRequest.mjs";
2
3
  export type { ExternalWidgetRenderRequest } from "./ExternalWidgetRenderRequest.mjs";
3
4
  export type { GetProductMetadataRequest } from "./GetProductMetadataRequest.mjs";
4
5
  export type { ListUserTasksRequest } from "./ListUserTasksRequest.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.2.36";
1
+ export declare const SDK_VERSION = "1.2.38";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.2.36";
1
+ export const SDK_VERSION = "1.2.38";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aui.io/aui-client",
3
- "version": "1.2.36",
3
+ "version": "1.2.38",
4
4
  "private": false,
5
5
  "repository": "github:aui-io/aui-client-typescript",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -358,7 +358,7 @@ await client.controllerApi.getAgentContext({
358
358
  </dl>
359
359
  </details>
360
360
 
361
- <details><summary><code>client.controllerApi.<a href="/src/api/resources/controllerApi/client/Client.ts">getDirectFollowupSuggestions</a>(taskId) -> Apollo.DirectFollowupSuggestionsResponse</code></summary>
361
+ <details><summary><code>client.controllerApi.<a href="/src/api/resources/controllerApi/client/Client.ts">getDirectFollowupSuggestions</a>({ ...params }) -> Apollo.DirectFollowupSuggestionsResponse</code></summary>
362
362
  <dl>
363
363
  <dd>
364
364
 
@@ -371,7 +371,7 @@ await client.controllerApi.getAgentContext({
371
371
  <dd>
372
372
 
373
373
  ```typescript
374
- await client.controllerApi.getDirectFollowupSuggestions("task_id");
374
+ await client.controllerApi.getDirectFollowupSuggestions();
375
375
 
376
376
  ```
377
377
  </dd>
@@ -387,7 +387,7 @@ await client.controllerApi.getDirectFollowupSuggestions("task_id");
387
387
  <dl>
388
388
  <dd>
389
389
 
390
- **taskId:** `string`
390
+ **request:** `Apollo.DirectFollowupSuggestionsRequest`
391
391
 
392
392
  </dd>
393
393
  </dl>