@crestal/nation-sdk 0.7.16 → 0.7.18

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
@@ -1,4 +1,4 @@
1
- ## @crestal/nation-sdk@0.7.16
1
+ ## @crestal/nation-sdk@0.7.18
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @crestal/nation-sdk@0.7.16 --save
39
+ npm install @crestal/nation-sdk@0.7.18 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -64,6 +64,7 @@ Class | Method | HTTP request | Description
64
64
  *AgentApi* | [**overrideAgentPublicInfo**](docs/AgentApi.md#overrideagentpublicinfo) | **PUT** /agents/{agent_id}/public-info | Override Agent Public Information
65
65
  *AgentApi* | [**publishAgent**](docs/AgentApi.md#publishagent) | **POST** /agents/{agent_id}/publish | Publish Agent
66
66
  *AgentApi* | [**resetAgentApiKey**](docs/AgentApi.md#resetagentapikey) | **POST** /agents/{agent_id}/api-key/reset | Reset Agent API Key
67
+ *AgentApi* | [**unpublishAgent**](docs/AgentApi.md#unpublishagent) | **POST** /agents/{agent_id}/unpublish | Unpublish Agent
67
68
  *AgentApi* | [**validateAgentCreate**](docs/AgentApi.md#validateagentcreate) | **POST** /agent/validate | Validate Agent Create
68
69
  *AgentApi* | [**validateAgentUpdate**](docs/AgentApi.md#validateagentupdate) | **POST** /agents/{agent_id}/validate | Validate Agent Update
69
70
  *ChatApi* | [**clearChatThreadMemory**](docs/ChatApi.md#clearchatthreadmemory) | **POST** /agents/{aid}/chats/{chat_id}/clear | Clear chat thread short-term memory
@@ -74,8 +75,10 @@ Class | Method | HTTP request | Description
74
75
  *ChatApi* | [**getSkillHistory**](docs/ChatApi.md#getskillhistory) | **GET** /agents/{aid}/skill/history | Skill History
75
76
  *ChatApi* | [**listChatsForAgent**](docs/ChatApi.md#listchatsforagent) | **GET** /agents/{aid}/chats | List chat threads for an agent
76
77
  *ChatApi* | [**listMessagesInChat**](docs/ChatApi.md#listmessagesinchat) | **GET** /agents/{aid}/chats/{chat_id}/messages | List messages in a chat thread
78
+ *ChatApi* | [**listMessagesInDraft**](docs/ChatApi.md#listmessagesindraft) | **GET** /agents/{aid}/draft/messages | List messages in an agent draft session
77
79
  *ChatApi* | [**retryMessageInChat**](docs/ChatApi.md#retrymessageinchat) | **POST** /agents/{aid}/chats/{chat_id}/messages/retry | Retry a message in a chat thread
78
80
  *ChatApi* | [**sendMessageToChat**](docs/ChatApi.md#sendmessagetochat) | **POST** /agents/{aid}/chats/{chat_id}/messages | Send a message to a chat thread
81
+ *ChatApi* | [**sendMessageToDraft**](docs/ChatApi.md#sendmessagetodraft) | **POST** /agents/{aid}/draft/messages | Send a message to an agent draft session
79
82
  *ChatApi* | [**updateChatThread**](docs/ChatApi.md#updatechatthread) | **PATCH** /agents/{aid}/chats/{chat_id} | Update a chat thread
80
83
  *CreditApi* | [**fetchCreditEvent**](docs/CreditApi.md#fetchcreditevent) | **GET** /credit/events/{event_id} | Credit Event
81
84
  *CreditApi* | [**getUserAccount**](docs/CreditApi.md#getuseraccount) | **GET** /credit/user/account | Get User Account
package/api.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Nation IntentKit API
5
5
  * API for Nation IntentKit services
6
6
  *
7
- * The version of the OpenAPI document: 0.7.16
7
+ * The version of the OpenAPI document: 0.7.18
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4196,6 +4196,44 @@ export const AgentApiAxiosParamCreator = function (configuration?: Configuration
4196
4196
 
4197
4197
 
4198
4198
 
4199
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
4200
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
4201
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
4202
+
4203
+ return {
4204
+ url: toPathString(localVarUrlObj),
4205
+ options: localVarRequestOptions,
4206
+ };
4207
+ },
4208
+ /**
4209
+ * Unpublish an agent by setting its state back to private.
4210
+ * @summary Unpublish Agent
4211
+ * @param {string} agentId ID of the agent to unpublish
4212
+ * @param {*} [options] Override http request option.
4213
+ * @throws {RequiredError}
4214
+ */
4215
+ unpublishAgent: async (agentId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
4216
+ // verify required parameter 'agentId' is not null or undefined
4217
+ assertParamExists('unpublishAgent', 'agentId', agentId)
4218
+ const localVarPath = `/agents/{agent_id}/unpublish`
4219
+ .replace(`{${"agent_id"}}`, encodeURIComponent(String(agentId)));
4220
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
4221
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4222
+ let baseOptions;
4223
+ if (configuration) {
4224
+ baseOptions = configuration.baseOptions;
4225
+ }
4226
+
4227
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
4228
+ const localVarHeaderParameter = {} as any;
4229
+ const localVarQueryParameter = {} as any;
4230
+
4231
+ // authentication HTTPBearer required
4232
+ // http bearer authentication required
4233
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
4234
+
4235
+
4236
+
4199
4237
  setSearchParams(localVarUrlObj, localVarQueryParameter);
4200
4238
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
4201
4239
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -4472,6 +4510,19 @@ export const AgentApiFp = function(configuration?: Configuration) {
4472
4510
  const localVarOperationServerBasePath = operationServerMap['AgentApi.resetAgentApiKey']?.[localVarOperationServerIndex]?.url;
4473
4511
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
4474
4512
  },
4513
+ /**
4514
+ * Unpublish an agent by setting its state back to private.
4515
+ * @summary Unpublish Agent
4516
+ * @param {string} agentId ID of the agent to unpublish
4517
+ * @param {*} [options] Override http request option.
4518
+ * @throws {RequiredError}
4519
+ */
4520
+ async unpublishAgent(agentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Agent>> {
4521
+ const localVarAxiosArgs = await localVarAxiosParamCreator.unpublishAgent(agentId, options);
4522
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
4523
+ const localVarOperationServerBasePath = operationServerMap['AgentApi.unpublishAgent']?.[localVarOperationServerIndex]?.url;
4524
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
4525
+ },
4475
4526
  /**
4476
4527
  * Validate agent configuration. **Request Body:** * `agent` - Agent configuration **Returns:** * `204 No Content` - Agent configuration is valid **Raises:** * `HTTPException`: - 400: Invalid agent configuration - 422: Invalid agent configuration from intentkit core or JSON schema validation - 500: Server error
4477
4528
  * @summary Validate Agent Create
@@ -4647,6 +4698,16 @@ export const AgentApiFactory = function (configuration?: Configuration, basePath
4647
4698
  resetAgentApiKey(agentId: string, options?: RawAxiosRequestConfig): AxiosPromise<AgentApiKeyResponse> {
4648
4699
  return localVarFp.resetAgentApiKey(agentId, options).then((request) => request(axios, basePath));
4649
4700
  },
4701
+ /**
4702
+ * Unpublish an agent by setting its state back to private.
4703
+ * @summary Unpublish Agent
4704
+ * @param {string} agentId ID of the agent to unpublish
4705
+ * @param {*} [options] Override http request option.
4706
+ * @throws {RequiredError}
4707
+ */
4708
+ unpublishAgent(agentId: string, options?: RawAxiosRequestConfig): AxiosPromise<Agent> {
4709
+ return localVarFp.unpublishAgent(agentId, options).then((request) => request(axios, basePath));
4710
+ },
4650
4711
  /**
4651
4712
  * Validate agent configuration. **Request Body:** * `agent` - Agent configuration **Returns:** * `204 No Content` - Agent configuration is valid **Raises:** * `HTTPException`: - 400: Invalid agent configuration - 422: Invalid agent configuration from intentkit core or JSON schema validation - 500: Server error
4652
4713
  * @summary Validate Agent Create
@@ -4842,6 +4903,18 @@ export class AgentApi extends BaseAPI {
4842
4903
  return AgentApiFp(this.configuration).resetAgentApiKey(agentId, options).then((request) => request(this.axios, this.basePath));
4843
4904
  }
4844
4905
 
4906
+ /**
4907
+ * Unpublish an agent by setting its state back to private.
4908
+ * @summary Unpublish Agent
4909
+ * @param {string} agentId ID of the agent to unpublish
4910
+ * @param {*} [options] Override http request option.
4911
+ * @throws {RequiredError}
4912
+ * @memberof AgentApi
4913
+ */
4914
+ public unpublishAgent(agentId: string, options?: RawAxiosRequestConfig) {
4915
+ return AgentApiFp(this.configuration).unpublishAgent(agentId, options).then((request) => request(this.axios, this.basePath));
4916
+ }
4917
+
4845
4918
  /**
4846
4919
  * Validate agent configuration. **Request Body:** * `agent` - Agent configuration **Returns:** * `204 No Content` - Agent configuration is valid **Raises:** * `HTTPException`: - 400: Invalid agent configuration - 422: Invalid agent configuration from intentkit core or JSON schema validation - 500: Server error
4847
4920
  * @summary Validate Agent Create
@@ -5207,6 +5280,54 @@ export const ChatApiAxiosParamCreator = function (configuration?: Configuration)
5207
5280
 
5208
5281
 
5209
5282
 
5283
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
5284
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
5285
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
5286
+
5287
+ return {
5288
+ url: toPathString(localVarUrlObj),
5289
+ options: localVarRequestOptions,
5290
+ };
5291
+ },
5292
+ /**
5293
+ * Retrieve the message history for the draft chat session of an agent with cursor-based pagination.
5294
+ * @summary List messages in an agent draft session
5295
+ * @param {string} aid Agent ID
5296
+ * @param {string | null} [cursor] Cursor for pagination (message id)
5297
+ * @param {number} [limit] Maximum number of messages to return
5298
+ * @param {*} [options] Override http request option.
5299
+ * @throws {RequiredError}
5300
+ */
5301
+ listMessagesInDraft: async (aid: string, cursor?: string | null, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
5302
+ // verify required parameter 'aid' is not null or undefined
5303
+ assertParamExists('listMessagesInDraft', 'aid', aid)
5304
+ const localVarPath = `/agents/{aid}/draft/messages`
5305
+ .replace(`{${"aid"}}`, encodeURIComponent(String(aid)));
5306
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
5307
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
5308
+ let baseOptions;
5309
+ if (configuration) {
5310
+ baseOptions = configuration.baseOptions;
5311
+ }
5312
+
5313
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
5314
+ const localVarHeaderParameter = {} as any;
5315
+ const localVarQueryParameter = {} as any;
5316
+
5317
+ // authentication HTTPBearer required
5318
+ // http bearer authentication required
5319
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
5320
+
5321
+ if (cursor !== undefined) {
5322
+ localVarQueryParameter['cursor'] = cursor;
5323
+ }
5324
+
5325
+ if (limit !== undefined) {
5326
+ localVarQueryParameter['limit'] = limit;
5327
+ }
5328
+
5329
+
5330
+
5210
5331
  setSearchParams(localVarUrlObj, localVarQueryParameter);
5211
5332
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
5212
5333
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
@@ -5294,6 +5415,50 @@ export const ChatApiAxiosParamCreator = function (configuration?: Configuration)
5294
5415
 
5295
5416
 
5296
5417
 
5418
+ localVarHeaderParameter['Content-Type'] = 'application/json';
5419
+
5420
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
5421
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
5422
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
5423
+ localVarRequestOptions.data = serializeDataIfNeeded(chatMessageRequest, localVarRequestOptions, configuration)
5424
+
5425
+ return {
5426
+ url: toPathString(localVarUrlObj),
5427
+ options: localVarRequestOptions,
5428
+ };
5429
+ },
5430
+ /**
5431
+ * Send a message to the draft chat session of an agent. The response contains the messages generated by the agent for the draft session. If streaming is requested, the response will be a Server-Sent Events (SSE) stream with event type \'message\'.
5432
+ * @summary Send a message to an agent draft session
5433
+ * @param {string} aid Agent ID
5434
+ * @param {ChatMessageRequest} chatMessageRequest
5435
+ * @param {*} [options] Override http request option.
5436
+ * @throws {RequiredError}
5437
+ */
5438
+ sendMessageToDraft: async (aid: string, chatMessageRequest: ChatMessageRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
5439
+ // verify required parameter 'aid' is not null or undefined
5440
+ assertParamExists('sendMessageToDraft', 'aid', aid)
5441
+ // verify required parameter 'chatMessageRequest' is not null or undefined
5442
+ assertParamExists('sendMessageToDraft', 'chatMessageRequest', chatMessageRequest)
5443
+ const localVarPath = `/agents/{aid}/draft/messages`
5444
+ .replace(`{${"aid"}}`, encodeURIComponent(String(aid)));
5445
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
5446
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
5447
+ let baseOptions;
5448
+ if (configuration) {
5449
+ baseOptions = configuration.baseOptions;
5450
+ }
5451
+
5452
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
5453
+ const localVarHeaderParameter = {} as any;
5454
+ const localVarQueryParameter = {} as any;
5455
+
5456
+ // authentication HTTPBearer required
5457
+ // http bearer authentication required
5458
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
5459
+
5460
+
5461
+
5297
5462
  localVarHeaderParameter['Content-Type'] = 'application/json';
5298
5463
 
5299
5464
  setSearchParams(localVarUrlObj, localVarQueryParameter);
@@ -5476,6 +5641,21 @@ export const ChatApiFp = function(configuration?: Configuration) {
5476
5641
  const localVarOperationServerBasePath = operationServerMap['ChatApi.listMessagesInChat']?.[localVarOperationServerIndex]?.url;
5477
5642
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
5478
5643
  },
5644
+ /**
5645
+ * Retrieve the message history for the draft chat session of an agent with cursor-based pagination.
5646
+ * @summary List messages in an agent draft session
5647
+ * @param {string} aid Agent ID
5648
+ * @param {string | null} [cursor] Cursor for pagination (message id)
5649
+ * @param {number} [limit] Maximum number of messages to return
5650
+ * @param {*} [options] Override http request option.
5651
+ * @throws {RequiredError}
5652
+ */
5653
+ async listMessagesInDraft(aid: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatMessagesResponse>> {
5654
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listMessagesInDraft(aid, cursor, limit, options);
5655
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
5656
+ const localVarOperationServerBasePath = operationServerMap['ChatApi.listMessagesInDraft']?.[localVarOperationServerIndex]?.url;
5657
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
5658
+ },
5479
5659
  /**
5480
5660
  * Retry sending the last message in a specific chat thread. If the last message is from an agent/system, returns all messages after the last user message. If the last message is from a user, generates a new agent response. Only works with non-streaming mode.
5481
5661
  * @summary Retry a message in a chat thread
@@ -5505,6 +5685,20 @@ export const ChatApiFp = function(configuration?: Configuration) {
5505
5685
  const localVarOperationServerBasePath = operationServerMap['ChatApi.sendMessageToChat']?.[localVarOperationServerIndex]?.url;
5506
5686
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
5507
5687
  },
5688
+ /**
5689
+ * Send a message to the draft chat session of an agent. The response contains the messages generated by the agent for the draft session. If streaming is requested, the response will be a Server-Sent Events (SSE) stream with event type \'message\'.
5690
+ * @summary Send a message to an agent draft session
5691
+ * @param {string} aid Agent ID
5692
+ * @param {ChatMessageRequest} chatMessageRequest
5693
+ * @param {*} [options] Override http request option.
5694
+ * @throws {RequiredError}
5695
+ */
5696
+ async sendMessageToDraft(aid: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ChatMessage>>> {
5697
+ const localVarAxiosArgs = await localVarAxiosParamCreator.sendMessageToDraft(aid, chatMessageRequest, options);
5698
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
5699
+ const localVarOperationServerBasePath = operationServerMap['ChatApi.sendMessageToDraft']?.[localVarOperationServerIndex]?.url;
5700
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
5701
+ },
5508
5702
  /**
5509
5703
  * Update details of a specific chat thread. Currently only supports updating the summary.
5510
5704
  * @summary Update a chat thread
@@ -5618,6 +5812,18 @@ export const ChatApiFactory = function (configuration?: Configuration, basePath?
5618
5812
  listMessagesInChat(aid: string, chatId: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<ChatMessagesResponse> {
5619
5813
  return localVarFp.listMessagesInChat(aid, chatId, cursor, limit, options).then((request) => request(axios, basePath));
5620
5814
  },
5815
+ /**
5816
+ * Retrieve the message history for the draft chat session of an agent with cursor-based pagination.
5817
+ * @summary List messages in an agent draft session
5818
+ * @param {string} aid Agent ID
5819
+ * @param {string | null} [cursor] Cursor for pagination (message id)
5820
+ * @param {number} [limit] Maximum number of messages to return
5821
+ * @param {*} [options] Override http request option.
5822
+ * @throws {RequiredError}
5823
+ */
5824
+ listMessagesInDraft(aid: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<ChatMessagesResponse> {
5825
+ return localVarFp.listMessagesInDraft(aid, cursor, limit, options).then((request) => request(axios, basePath));
5826
+ },
5621
5827
  /**
5622
5828
  * Retry sending the last message in a specific chat thread. If the last message is from an agent/system, returns all messages after the last user message. If the last message is from a user, generates a new agent response. Only works with non-streaming mode.
5623
5829
  * @summary Retry a message in a chat thread
@@ -5641,6 +5847,17 @@ export const ChatApiFactory = function (configuration?: Configuration, basePath?
5641
5847
  sendMessageToChat(aid: string, chatId: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<ChatMessage>> {
5642
5848
  return localVarFp.sendMessageToChat(aid, chatId, chatMessageRequest, options).then((request) => request(axios, basePath));
5643
5849
  },
5850
+ /**
5851
+ * Send a message to the draft chat session of an agent. The response contains the messages generated by the agent for the draft session. If streaming is requested, the response will be a Server-Sent Events (SSE) stream with event type \'message\'.
5852
+ * @summary Send a message to an agent draft session
5853
+ * @param {string} aid Agent ID
5854
+ * @param {ChatMessageRequest} chatMessageRequest
5855
+ * @param {*} [options] Override http request option.
5856
+ * @throws {RequiredError}
5857
+ */
5858
+ sendMessageToDraft(aid: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<ChatMessage>> {
5859
+ return localVarFp.sendMessageToDraft(aid, chatMessageRequest, options).then((request) => request(axios, basePath));
5860
+ },
5644
5861
  /**
5645
5862
  * Update details of a specific chat thread. Currently only supports updating the summary.
5646
5863
  * @summary Update a chat thread
@@ -5767,6 +5984,20 @@ export class ChatApi extends BaseAPI {
5767
5984
  return ChatApiFp(this.configuration).listMessagesInChat(aid, chatId, cursor, limit, options).then((request) => request(this.axios, this.basePath));
5768
5985
  }
5769
5986
 
5987
+ /**
5988
+ * Retrieve the message history for the draft chat session of an agent with cursor-based pagination.
5989
+ * @summary List messages in an agent draft session
5990
+ * @param {string} aid Agent ID
5991
+ * @param {string | null} [cursor] Cursor for pagination (message id)
5992
+ * @param {number} [limit] Maximum number of messages to return
5993
+ * @param {*} [options] Override http request option.
5994
+ * @throws {RequiredError}
5995
+ * @memberof ChatApi
5996
+ */
5997
+ public listMessagesInDraft(aid: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig) {
5998
+ return ChatApiFp(this.configuration).listMessagesInDraft(aid, cursor, limit, options).then((request) => request(this.axios, this.basePath));
5999
+ }
6000
+
5770
6001
  /**
5771
6002
  * Retry sending the last message in a specific chat thread. If the last message is from an agent/system, returns all messages after the last user message. If the last message is from a user, generates a new agent response. Only works with non-streaming mode.
5772
6003
  * @summary Retry a message in a chat thread
@@ -5794,6 +6025,19 @@ export class ChatApi extends BaseAPI {
5794
6025
  return ChatApiFp(this.configuration).sendMessageToChat(aid, chatId, chatMessageRequest, options).then((request) => request(this.axios, this.basePath));
5795
6026
  }
5796
6027
 
6028
+ /**
6029
+ * Send a message to the draft chat session of an agent. The response contains the messages generated by the agent for the draft session. If streaming is requested, the response will be a Server-Sent Events (SSE) stream with event type \'message\'.
6030
+ * @summary Send a message to an agent draft session
6031
+ * @param {string} aid Agent ID
6032
+ * @param {ChatMessageRequest} chatMessageRequest
6033
+ * @param {*} [options] Override http request option.
6034
+ * @throws {RequiredError}
6035
+ * @memberof ChatApi
6036
+ */
6037
+ public sendMessageToDraft(aid: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig) {
6038
+ return ChatApiFp(this.configuration).sendMessageToDraft(aid, chatMessageRequest, options).then((request) => request(this.axios, this.basePath));
6039
+ }
6040
+
5797
6041
  /**
5798
6042
  * Update details of a specific chat thread. Currently only supports updating the summary.
5799
6043
  * @summary Update a chat thread
package/base.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Nation IntentKit API
5
5
  * API for Nation IntentKit services
6
6
  *
7
- * The version of the OpenAPI document: 0.7.16
7
+ * The version of the OpenAPI document: 0.7.18
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/common.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Nation IntentKit API
5
5
  * API for Nation IntentKit services
6
6
  *
7
- * The version of the OpenAPI document: 0.7.16
7
+ * The version of the OpenAPI document: 0.7.18
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/configuration.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Nation IntentKit API
5
5
  * API for Nation IntentKit services
6
6
  *
7
- * The version of the OpenAPI document: 0.7.16
7
+ * The version of the OpenAPI document: 0.7.18
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/api.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Nation IntentKit API
3
3
  * API for Nation IntentKit services
4
4
  *
5
- * The version of the OpenAPI document: 0.7.16
5
+ * The version of the OpenAPI document: 0.7.18
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -3688,6 +3688,14 @@ export declare const AgentApiAxiosParamCreator: (configuration?: Configuration)
3688
3688
  * @throws {RequiredError}
3689
3689
  */
3690
3690
  resetAgentApiKey: (agentId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
3691
+ /**
3692
+ * Unpublish an agent by setting its state back to private.
3693
+ * @summary Unpublish Agent
3694
+ * @param {string} agentId ID of the agent to unpublish
3695
+ * @param {*} [options] Override http request option.
3696
+ * @throws {RequiredError}
3697
+ */
3698
+ unpublishAgent: (agentId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
3691
3699
  /**
3692
3700
  * Validate agent configuration. **Request Body:** * `agent` - Agent configuration **Returns:** * `204 No Content` - Agent configuration is valid **Raises:** * `HTTPException`: - 400: Invalid agent configuration - 422: Invalid agent configuration from intentkit core or JSON schema validation - 500: Server error
3693
3701
  * @summary Validate Agent Create
@@ -3823,6 +3831,14 @@ export declare const AgentApiFp: (configuration?: Configuration) => {
3823
3831
  * @throws {RequiredError}
3824
3832
  */
3825
3833
  resetAgentApiKey(agentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AgentApiKeyResponse>>;
3834
+ /**
3835
+ * Unpublish an agent by setting its state back to private.
3836
+ * @summary Unpublish Agent
3837
+ * @param {string} agentId ID of the agent to unpublish
3838
+ * @param {*} [options] Override http request option.
3839
+ * @throws {RequiredError}
3840
+ */
3841
+ unpublishAgent(agentId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Agent>>;
3826
3842
  /**
3827
3843
  * Validate agent configuration. **Request Body:** * `agent` - Agent configuration **Returns:** * `204 No Content` - Agent configuration is valid **Raises:** * `HTTPException`: - 400: Invalid agent configuration - 422: Invalid agent configuration from intentkit core or JSON schema validation - 500: Server error
3828
3844
  * @summary Validate Agent Create
@@ -3958,6 +3974,14 @@ export declare const AgentApiFactory: (configuration?: Configuration, basePath?:
3958
3974
  * @throws {RequiredError}
3959
3975
  */
3960
3976
  resetAgentApiKey(agentId: string, options?: RawAxiosRequestConfig): AxiosPromise<AgentApiKeyResponse>;
3977
+ /**
3978
+ * Unpublish an agent by setting its state back to private.
3979
+ * @summary Unpublish Agent
3980
+ * @param {string} agentId ID of the agent to unpublish
3981
+ * @param {*} [options] Override http request option.
3982
+ * @throws {RequiredError}
3983
+ */
3984
+ unpublishAgent(agentId: string, options?: RawAxiosRequestConfig): AxiosPromise<Agent>;
3961
3985
  /**
3962
3986
  * Validate agent configuration. **Request Body:** * `agent` - Agent configuration **Returns:** * `204 No Content` - Agent configuration is valid **Raises:** * `HTTPException`: - 400: Invalid agent configuration - 422: Invalid agent configuration from intentkit core or JSON schema validation - 500: Server error
3963
3987
  * @summary Validate Agent Create
@@ -4108,6 +4132,15 @@ export declare class AgentApi extends BaseAPI {
4108
4132
  * @memberof AgentApi
4109
4133
  */
4110
4134
  resetAgentApiKey(agentId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AgentApiKeyResponse, any, {}>>;
4135
+ /**
4136
+ * Unpublish an agent by setting its state back to private.
4137
+ * @summary Unpublish Agent
4138
+ * @param {string} agentId ID of the agent to unpublish
4139
+ * @param {*} [options] Override http request option.
4140
+ * @throws {RequiredError}
4141
+ * @memberof AgentApi
4142
+ */
4143
+ unpublishAgent(agentId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<Agent, any, {}>>;
4111
4144
  /**
4112
4145
  * Validate agent configuration. **Request Body:** * `agent` - Agent configuration **Returns:** * `204 No Content` - Agent configuration is valid **Raises:** * `HTTPException`: - 400: Invalid agent configuration - 422: Invalid agent configuration from intentkit core or JSON schema validation - 500: Server error
4113
4146
  * @summary Validate Agent Create
@@ -4205,6 +4238,16 @@ export declare const ChatApiAxiosParamCreator: (configuration?: Configuration) =
4205
4238
  * @throws {RequiredError}
4206
4239
  */
4207
4240
  listMessagesInChat: (aid: string, chatId: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
4241
+ /**
4242
+ * Retrieve the message history for the draft chat session of an agent with cursor-based pagination.
4243
+ * @summary List messages in an agent draft session
4244
+ * @param {string} aid Agent ID
4245
+ * @param {string | null} [cursor] Cursor for pagination (message id)
4246
+ * @param {number} [limit] Maximum number of messages to return
4247
+ * @param {*} [options] Override http request option.
4248
+ * @throws {RequiredError}
4249
+ */
4250
+ listMessagesInDraft: (aid: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
4208
4251
  /**
4209
4252
  * Retry sending the last message in a specific chat thread. If the last message is from an agent/system, returns all messages after the last user message. If the last message is from a user, generates a new agent response. Only works with non-streaming mode.
4210
4253
  * @summary Retry a message in a chat thread
@@ -4224,6 +4267,15 @@ export declare const ChatApiAxiosParamCreator: (configuration?: Configuration) =
4224
4267
  * @throws {RequiredError}
4225
4268
  */
4226
4269
  sendMessageToChat: (aid: string, chatId: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
4270
+ /**
4271
+ * Send a message to the draft chat session of an agent. The response contains the messages generated by the agent for the draft session. If streaming is requested, the response will be a Server-Sent Events (SSE) stream with event type \'message\'.
4272
+ * @summary Send a message to an agent draft session
4273
+ * @param {string} aid Agent ID
4274
+ * @param {ChatMessageRequest} chatMessageRequest
4275
+ * @param {*} [options] Override http request option.
4276
+ * @throws {RequiredError}
4277
+ */
4278
+ sendMessageToDraft: (aid: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
4227
4279
  /**
4228
4280
  * Update details of a specific chat thread. Currently only supports updating the summary.
4229
4281
  * @summary Update a chat thread
@@ -4312,6 +4364,16 @@ export declare const ChatApiFp: (configuration?: Configuration) => {
4312
4364
  * @throws {RequiredError}
4313
4365
  */
4314
4366
  listMessagesInChat(aid: string, chatId: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatMessagesResponse>>;
4367
+ /**
4368
+ * Retrieve the message history for the draft chat session of an agent with cursor-based pagination.
4369
+ * @summary List messages in an agent draft session
4370
+ * @param {string} aid Agent ID
4371
+ * @param {string | null} [cursor] Cursor for pagination (message id)
4372
+ * @param {number} [limit] Maximum number of messages to return
4373
+ * @param {*} [options] Override http request option.
4374
+ * @throws {RequiredError}
4375
+ */
4376
+ listMessagesInDraft(aid: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatMessagesResponse>>;
4315
4377
  /**
4316
4378
  * Retry sending the last message in a specific chat thread. If the last message is from an agent/system, returns all messages after the last user message. If the last message is from a user, generates a new agent response. Only works with non-streaming mode.
4317
4379
  * @summary Retry a message in a chat thread
@@ -4331,6 +4393,15 @@ export declare const ChatApiFp: (configuration?: Configuration) => {
4331
4393
  * @throws {RequiredError}
4332
4394
  */
4333
4395
  sendMessageToChat(aid: string, chatId: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ChatMessage>>>;
4396
+ /**
4397
+ * Send a message to the draft chat session of an agent. The response contains the messages generated by the agent for the draft session. If streaming is requested, the response will be a Server-Sent Events (SSE) stream with event type \'message\'.
4398
+ * @summary Send a message to an agent draft session
4399
+ * @param {string} aid Agent ID
4400
+ * @param {ChatMessageRequest} chatMessageRequest
4401
+ * @param {*} [options] Override http request option.
4402
+ * @throws {RequiredError}
4403
+ */
4404
+ sendMessageToDraft(aid: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ChatMessage>>>;
4334
4405
  /**
4335
4406
  * Update details of a specific chat thread. Currently only supports updating the summary.
4336
4407
  * @summary Update a chat thread
@@ -4419,6 +4490,16 @@ export declare const ChatApiFactory: (configuration?: Configuration, basePath?:
4419
4490
  * @throws {RequiredError}
4420
4491
  */
4421
4492
  listMessagesInChat(aid: string, chatId: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<ChatMessagesResponse>;
4493
+ /**
4494
+ * Retrieve the message history for the draft chat session of an agent with cursor-based pagination.
4495
+ * @summary List messages in an agent draft session
4496
+ * @param {string} aid Agent ID
4497
+ * @param {string | null} [cursor] Cursor for pagination (message id)
4498
+ * @param {number} [limit] Maximum number of messages to return
4499
+ * @param {*} [options] Override http request option.
4500
+ * @throws {RequiredError}
4501
+ */
4502
+ listMessagesInDraft(aid: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<ChatMessagesResponse>;
4422
4503
  /**
4423
4504
  * Retry sending the last message in a specific chat thread. If the last message is from an agent/system, returns all messages after the last user message. If the last message is from a user, generates a new agent response. Only works with non-streaming mode.
4424
4505
  * @summary Retry a message in a chat thread
@@ -4438,6 +4519,15 @@ export declare const ChatApiFactory: (configuration?: Configuration, basePath?:
4438
4519
  * @throws {RequiredError}
4439
4520
  */
4440
4521
  sendMessageToChat(aid: string, chatId: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<ChatMessage>>;
4522
+ /**
4523
+ * Send a message to the draft chat session of an agent. The response contains the messages generated by the agent for the draft session. If streaming is requested, the response will be a Server-Sent Events (SSE) stream with event type \'message\'.
4524
+ * @summary Send a message to an agent draft session
4525
+ * @param {string} aid Agent ID
4526
+ * @param {ChatMessageRequest} chatMessageRequest
4527
+ * @param {*} [options] Override http request option.
4528
+ * @throws {RequiredError}
4529
+ */
4530
+ sendMessageToDraft(aid: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<ChatMessage>>;
4441
4531
  /**
4442
4532
  * Update details of a specific chat thread. Currently only supports updating the summary.
4443
4533
  * @summary Update a chat thread
@@ -4536,6 +4626,17 @@ export declare class ChatApi extends BaseAPI {
4536
4626
  * @memberof ChatApi
4537
4627
  */
4538
4628
  listMessagesInChat(aid: string, chatId: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ChatMessagesResponse, any, {}>>;
4629
+ /**
4630
+ * Retrieve the message history for the draft chat session of an agent with cursor-based pagination.
4631
+ * @summary List messages in an agent draft session
4632
+ * @param {string} aid Agent ID
4633
+ * @param {string | null} [cursor] Cursor for pagination (message id)
4634
+ * @param {number} [limit] Maximum number of messages to return
4635
+ * @param {*} [options] Override http request option.
4636
+ * @throws {RequiredError}
4637
+ * @memberof ChatApi
4638
+ */
4639
+ listMessagesInDraft(aid: string, cursor?: string | null, limit?: number, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ChatMessagesResponse, any, {}>>;
4539
4640
  /**
4540
4641
  * Retry sending the last message in a specific chat thread. If the last message is from an agent/system, returns all messages after the last user message. If the last message is from a user, generates a new agent response. Only works with non-streaming mode.
4541
4642
  * @summary Retry a message in a chat thread
@@ -4557,6 +4658,16 @@ export declare class ChatApi extends BaseAPI {
4557
4658
  * @memberof ChatApi
4558
4659
  */
4559
4660
  sendMessageToChat(aid: string, chatId: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ChatMessage[], any, {}>>;
4661
+ /**
4662
+ * Send a message to the draft chat session of an agent. The response contains the messages generated by the agent for the draft session. If streaming is requested, the response will be a Server-Sent Events (SSE) stream with event type \'message\'.
4663
+ * @summary Send a message to an agent draft session
4664
+ * @param {string} aid Agent ID
4665
+ * @param {ChatMessageRequest} chatMessageRequest
4666
+ * @param {*} [options] Override http request option.
4667
+ * @throws {RequiredError}
4668
+ * @memberof ChatApi
4669
+ */
4670
+ sendMessageToDraft(aid: string, chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ChatMessage[], any, {}>>;
4560
4671
  /**
4561
4672
  * Update details of a specific chat thread. Currently only supports updating the summary.
4562
4673
  * @summary Update a chat thread