@crestal/nation-sdk 0.8.54 → 0.8.56
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/.openapi-generator/FILES +2 -0
- package/README.md +4 -2
- package/api.ts +125 -1
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +1 -1
- package/dist/api.d.ts +71 -1
- package/dist/api.js +129 -2
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/LLMModelInfoWithProviderName.md +2 -2
- package/docs/X402Api.md +64 -0
- package/docs/X402MessageRequest.md +31 -0
- package/index.ts +1 -1
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @crestal/nation-sdk@0.8.
|
|
1
|
+
## @crestal/nation-sdk@0.8.56
|
|
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.8.
|
|
39
|
+
npm install @crestal/nation-sdk@0.8.56 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -113,6 +113,7 @@ Class | Method | HTTP request | Description
|
|
|
113
113
|
*UserApi* | [**getUserAgentById**](docs/UserApi.md#getuseragentbyid) | **GET** /user/agents/{agent_id} | Get User Agent By Id
|
|
114
114
|
*UserApi* | [**getUserAgents**](docs/UserApi.md#getuseragents) | **GET** /user/agents | Get User Agents
|
|
115
115
|
*UserApi* | [**uploadUserFile**](docs/UserApi.md#uploaduserfile) | **POST** /user/upload | Upload User File
|
|
116
|
+
*X402Api* | [**chatByX402**](docs/X402Api.md#chatbyx402) | **POST** /x/{aid} | Chat by x402
|
|
116
117
|
|
|
117
118
|
|
|
118
119
|
### Documentation For Models
|
|
@@ -172,6 +173,7 @@ Class | Method | HTTP request | Description
|
|
|
172
173
|
- [UserAgentListResponse](docs/UserAgentListResponse.md)
|
|
173
174
|
- [ValidationError](docs/ValidationError.md)
|
|
174
175
|
- [ValidationErrorLocInner](docs/ValidationErrorLocInner.md)
|
|
176
|
+
- [X402MessageRequest](docs/X402MessageRequest.md)
|
|
175
177
|
|
|
176
178
|
|
|
177
179
|
<a id="documentation-for-authorization"></a>
|
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.8.
|
|
7
|
+
* The version of the OpenAPI document: 0.8.56
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -1564,6 +1564,20 @@ export interface ValidationError {
|
|
|
1564
1564
|
}
|
|
1565
1565
|
export interface ValidationErrorLocInner {
|
|
1566
1566
|
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Request agent for chat response.
|
|
1569
|
+
*/
|
|
1570
|
+
export interface X402MessageRequest {
|
|
1571
|
+
'chat_id'?: string | null;
|
|
1572
|
+
'app_id'?: string | null;
|
|
1573
|
+
/**
|
|
1574
|
+
* Content of the message
|
|
1575
|
+
*/
|
|
1576
|
+
'message': string;
|
|
1577
|
+
'search_mode'?: boolean | null;
|
|
1578
|
+
'super_mode'?: boolean | null;
|
|
1579
|
+
'attachments'?: Array<ChatMessageAttachment> | null;
|
|
1580
|
+
}
|
|
1567
1581
|
|
|
1568
1582
|
/**
|
|
1569
1583
|
* AgentApi - axios parameter creator
|
|
@@ -6633,3 +6647,113 @@ export class UserApi extends BaseAPI {
|
|
|
6633
6647
|
|
|
6634
6648
|
|
|
6635
6649
|
|
|
6650
|
+
/**
|
|
6651
|
+
* X402Api - axios parameter creator
|
|
6652
|
+
*/
|
|
6653
|
+
export const X402ApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
6654
|
+
return {
|
|
6655
|
+
/**
|
|
6656
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
6657
|
+
* @summary Chat by x402
|
|
6658
|
+
* @param {string} aid Agent ID
|
|
6659
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
6660
|
+
* @param {*} [options] Override http request option.
|
|
6661
|
+
* @throws {RequiredError}
|
|
6662
|
+
*/
|
|
6663
|
+
chatByX402: async (aid: string, x402MessageRequest: X402MessageRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
6664
|
+
// verify required parameter 'aid' is not null or undefined
|
|
6665
|
+
assertParamExists('chatByX402', 'aid', aid)
|
|
6666
|
+
// verify required parameter 'x402MessageRequest' is not null or undefined
|
|
6667
|
+
assertParamExists('chatByX402', 'x402MessageRequest', x402MessageRequest)
|
|
6668
|
+
const localVarPath = `/x/{aid}`
|
|
6669
|
+
.replace(`{${"aid"}}`, encodeURIComponent(String(aid)));
|
|
6670
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
6671
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
6672
|
+
let baseOptions;
|
|
6673
|
+
if (configuration) {
|
|
6674
|
+
baseOptions = configuration.baseOptions;
|
|
6675
|
+
}
|
|
6676
|
+
|
|
6677
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
6678
|
+
const localVarHeaderParameter = {} as any;
|
|
6679
|
+
const localVarQueryParameter = {} as any;
|
|
6680
|
+
|
|
6681
|
+
|
|
6682
|
+
|
|
6683
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
6684
|
+
|
|
6685
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
6686
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6687
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
6688
|
+
localVarRequestOptions.data = serializeDataIfNeeded(x402MessageRequest, localVarRequestOptions, configuration)
|
|
6689
|
+
|
|
6690
|
+
return {
|
|
6691
|
+
url: toPathString(localVarUrlObj),
|
|
6692
|
+
options: localVarRequestOptions,
|
|
6693
|
+
};
|
|
6694
|
+
},
|
|
6695
|
+
}
|
|
6696
|
+
};
|
|
6697
|
+
|
|
6698
|
+
/**
|
|
6699
|
+
* X402Api - functional programming interface
|
|
6700
|
+
*/
|
|
6701
|
+
export const X402ApiFp = function(configuration?: Configuration) {
|
|
6702
|
+
const localVarAxiosParamCreator = X402ApiAxiosParamCreator(configuration)
|
|
6703
|
+
return {
|
|
6704
|
+
/**
|
|
6705
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
6706
|
+
* @summary Chat by x402
|
|
6707
|
+
* @param {string} aid Agent ID
|
|
6708
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
6709
|
+
* @param {*} [options] Override http request option.
|
|
6710
|
+
* @throws {RequiredError}
|
|
6711
|
+
*/
|
|
6712
|
+
async chatByX402(aid: string, x402MessageRequest: X402MessageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ChatMessage>>> {
|
|
6713
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.chatByX402(aid, x402MessageRequest, options);
|
|
6714
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
6715
|
+
const localVarOperationServerBasePath = operationServerMap['X402Api.chatByX402']?.[localVarOperationServerIndex]?.url;
|
|
6716
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
6717
|
+
},
|
|
6718
|
+
}
|
|
6719
|
+
};
|
|
6720
|
+
|
|
6721
|
+
/**
|
|
6722
|
+
* X402Api - factory interface
|
|
6723
|
+
*/
|
|
6724
|
+
export const X402ApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
6725
|
+
const localVarFp = X402ApiFp(configuration)
|
|
6726
|
+
return {
|
|
6727
|
+
/**
|
|
6728
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
6729
|
+
* @summary Chat by x402
|
|
6730
|
+
* @param {string} aid Agent ID
|
|
6731
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
6732
|
+
* @param {*} [options] Override http request option.
|
|
6733
|
+
* @throws {RequiredError}
|
|
6734
|
+
*/
|
|
6735
|
+
chatByX402(aid: string, x402MessageRequest: X402MessageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<ChatMessage>> {
|
|
6736
|
+
return localVarFp.chatByX402(aid, x402MessageRequest, options).then((request) => request(axios, basePath));
|
|
6737
|
+
},
|
|
6738
|
+
};
|
|
6739
|
+
};
|
|
6740
|
+
|
|
6741
|
+
/**
|
|
6742
|
+
* X402Api - object-oriented interface
|
|
6743
|
+
*/
|
|
6744
|
+
export class X402Api extends BaseAPI {
|
|
6745
|
+
/**
|
|
6746
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
6747
|
+
* @summary Chat by x402
|
|
6748
|
+
* @param {string} aid Agent ID
|
|
6749
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
6750
|
+
* @param {*} [options] Override http request option.
|
|
6751
|
+
* @throws {RequiredError}
|
|
6752
|
+
*/
|
|
6753
|
+
public chatByX402(aid: string, x402MessageRequest: X402MessageRequest, options?: RawAxiosRequestConfig) {
|
|
6754
|
+
return X402ApiFp(this.configuration).chatByX402(aid, x402MessageRequest, options).then((request) => request(this.axios, this.basePath));
|
|
6755
|
+
}
|
|
6756
|
+
}
|
|
6757
|
+
|
|
6758
|
+
|
|
6759
|
+
|
package/base.ts
CHANGED
package/common.ts
CHANGED
package/configuration.ts
CHANGED
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.8.
|
|
5
|
+
* The version of the OpenAPI document: 0.8.56
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -1521,6 +1521,20 @@ export interface ValidationError {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
export interface ValidationErrorLocInner {
|
|
1523
1523
|
}
|
|
1524
|
+
/**
|
|
1525
|
+
* Request agent for chat response.
|
|
1526
|
+
*/
|
|
1527
|
+
export interface X402MessageRequest {
|
|
1528
|
+
'chat_id'?: string | null;
|
|
1529
|
+
'app_id'?: string | null;
|
|
1530
|
+
/**
|
|
1531
|
+
* Content of the message
|
|
1532
|
+
*/
|
|
1533
|
+
'message': string;
|
|
1534
|
+
'search_mode'?: boolean | null;
|
|
1535
|
+
'super_mode'?: boolean | null;
|
|
1536
|
+
'attachments'?: Array<ChatMessageAttachment> | null;
|
|
1537
|
+
}
|
|
1524
1538
|
/**
|
|
1525
1539
|
* AgentApi - axios parameter creator
|
|
1526
1540
|
*/
|
|
@@ -3841,3 +3855,59 @@ export declare class UserApi extends BaseAPI {
|
|
|
3841
3855
|
*/
|
|
3842
3856
|
uploadUserFile(file: File, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<FileUploadResponse, any, {}>>;
|
|
3843
3857
|
}
|
|
3858
|
+
/**
|
|
3859
|
+
* X402Api - axios parameter creator
|
|
3860
|
+
*/
|
|
3861
|
+
export declare const X402ApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
3862
|
+
/**
|
|
3863
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
3864
|
+
* @summary Chat by x402
|
|
3865
|
+
* @param {string} aid Agent ID
|
|
3866
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
3867
|
+
* @param {*} [options] Override http request option.
|
|
3868
|
+
* @throws {RequiredError}
|
|
3869
|
+
*/
|
|
3870
|
+
chatByX402: (aid: string, x402MessageRequest: X402MessageRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
3871
|
+
};
|
|
3872
|
+
/**
|
|
3873
|
+
* X402Api - functional programming interface
|
|
3874
|
+
*/
|
|
3875
|
+
export declare const X402ApiFp: (configuration?: Configuration) => {
|
|
3876
|
+
/**
|
|
3877
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
3878
|
+
* @summary Chat by x402
|
|
3879
|
+
* @param {string} aid Agent ID
|
|
3880
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
3881
|
+
* @param {*} [options] Override http request option.
|
|
3882
|
+
* @throws {RequiredError}
|
|
3883
|
+
*/
|
|
3884
|
+
chatByX402(aid: string, x402MessageRequest: X402MessageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ChatMessage>>>;
|
|
3885
|
+
};
|
|
3886
|
+
/**
|
|
3887
|
+
* X402Api - factory interface
|
|
3888
|
+
*/
|
|
3889
|
+
export declare const X402ApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
3890
|
+
/**
|
|
3891
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
3892
|
+
* @summary Chat by x402
|
|
3893
|
+
* @param {string} aid Agent ID
|
|
3894
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
3895
|
+
* @param {*} [options] Override http request option.
|
|
3896
|
+
* @throws {RequiredError}
|
|
3897
|
+
*/
|
|
3898
|
+
chatByX402(aid: string, x402MessageRequest: X402MessageRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<ChatMessage>>;
|
|
3899
|
+
};
|
|
3900
|
+
/**
|
|
3901
|
+
* X402Api - object-oriented interface
|
|
3902
|
+
*/
|
|
3903
|
+
export declare class X402Api extends BaseAPI {
|
|
3904
|
+
/**
|
|
3905
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
3906
|
+
* @summary Chat by x402
|
|
3907
|
+
* @param {string} aid Agent ID
|
|
3908
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
3909
|
+
* @param {*} [options] Override http request option.
|
|
3910
|
+
* @throws {RequiredError}
|
|
3911
|
+
*/
|
|
3912
|
+
chatByX402(aid: string, x402MessageRequest: X402MessageRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ChatMessage[], any, {}>>;
|
|
3913
|
+
}
|
package/dist/api.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.8.
|
|
8
|
+
* The version of the OpenAPI document: 0.8.56
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -85,7 +85,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
85
85
|
};
|
|
86
86
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
87
87
|
exports.ManagerApiFp = exports.ManagerApiAxiosParamCreator = exports.HealthApi = exports.HealthApiFactory = exports.HealthApiFp = exports.HealthApiAxiosParamCreator = exports.DraftApi = exports.DraftApiFactory = exports.DraftApiFp = exports.DraftApiAxiosParamCreator = exports.CreditApi = exports.CreditApiFactory = exports.CreditApiFp = exports.CreditApiAxiosParamCreator = exports.ChatApi = exports.ChatApiFactory = exports.ChatApiFp = exports.ChatApiAxiosParamCreator = exports.AgentApi = exports.AgentApiFactory = exports.AgentApiFp = exports.AgentApiAxiosParamCreator = exports.UpstreamType = exports.TransactionType = exports.SystemMessageType = exports.OwnerType = exports.LLMProvider = exports.EventType = exports.Direction = exports.CreditType = exports.CreditDebit = exports.ChatMessageAttachmentType = exports.AuthorType = exports.AgentUserInputShortTermMemoryStrategyEnum = exports.AgentUserInputNetworkIdEnum = exports.AgentUserInputWalletProviderEnum = exports.AgentUpdateShortTermMemoryStrategyEnum = exports.AgentUpdateNetworkIdEnum = exports.AgentUpdateWalletProviderEnum = exports.AgentState = exports.AgentSortOption = exports.AgentResponseShortTermMemoryStrategyEnum = exports.AgentResponseNetworkIdEnum = exports.AgentResponseWalletProviderEnum = exports.AgentDraftShortTermMemoryStrategyEnum = exports.AgentDraftNetworkIdEnum = exports.AgentDraftWalletProviderEnum = exports.AgentShortTermMemoryStrategyEnum = exports.AgentNetworkIdEnum = exports.AgentWalletProviderEnum = void 0;
|
|
88
|
-
exports.UserApi = exports.UserApiFactory = exports.UserApiFp = exports.UserApiAxiosParamCreator = exports.OAuthApi = exports.OAuthApiFactory = exports.OAuthApiFp = exports.OAuthApiAxiosParamCreator = exports.MetadataApi = exports.MetadataApiFactory = exports.MetadataApiFp = exports.MetadataApiAxiosParamCreator = exports.ManagerApi = exports.ManagerApiFactory = void 0;
|
|
88
|
+
exports.X402Api = exports.X402ApiFactory = exports.X402ApiFp = exports.X402ApiAxiosParamCreator = exports.UserApi = exports.UserApiFactory = exports.UserApiFp = exports.UserApiAxiosParamCreator = exports.OAuthApi = exports.OAuthApiFactory = exports.OAuthApiFp = exports.OAuthApiAxiosParamCreator = exports.MetadataApi = exports.MetadataApiFactory = exports.MetadataApiFp = exports.MetadataApiAxiosParamCreator = exports.ManagerApi = exports.ManagerApiFactory = void 0;
|
|
89
89
|
var axios_1 = require("axios");
|
|
90
90
|
// Some imports not used depending on template conditions
|
|
91
91
|
// @ts-ignore
|
|
@@ -6498,3 +6498,130 @@ var UserApi = /** @class */ (function (_super) {
|
|
|
6498
6498
|
return UserApi;
|
|
6499
6499
|
}(base_1.BaseAPI));
|
|
6500
6500
|
exports.UserApi = UserApi;
|
|
6501
|
+
/**
|
|
6502
|
+
* X402Api - axios parameter creator
|
|
6503
|
+
*/
|
|
6504
|
+
var X402ApiAxiosParamCreator = function (configuration) {
|
|
6505
|
+
var _this = this;
|
|
6506
|
+
return {
|
|
6507
|
+
/**
|
|
6508
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
6509
|
+
* @summary Chat by x402
|
|
6510
|
+
* @param {string} aid Agent ID
|
|
6511
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
6512
|
+
* @param {*} [options] Override http request option.
|
|
6513
|
+
* @throws {RequiredError}
|
|
6514
|
+
*/
|
|
6515
|
+
chatByX402: function (aid_1, x402MessageRequest_1) {
|
|
6516
|
+
var args_1 = [];
|
|
6517
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
6518
|
+
args_1[_i - 2] = arguments[_i];
|
|
6519
|
+
}
|
|
6520
|
+
return __awaiter(_this, __spreadArray([aid_1, x402MessageRequest_1], args_1, true), void 0, function (aid, x402MessageRequest, options) {
|
|
6521
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
6522
|
+
if (options === void 0) { options = {}; }
|
|
6523
|
+
return __generator(this, function (_a) {
|
|
6524
|
+
// verify required parameter 'aid' is not null or undefined
|
|
6525
|
+
(0, common_1.assertParamExists)('chatByX402', 'aid', aid);
|
|
6526
|
+
// verify required parameter 'x402MessageRequest' is not null or undefined
|
|
6527
|
+
(0, common_1.assertParamExists)('chatByX402', 'x402MessageRequest', x402MessageRequest);
|
|
6528
|
+
localVarPath = "/x/{aid}"
|
|
6529
|
+
.replace("{".concat("aid", "}"), encodeURIComponent(String(aid)));
|
|
6530
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
6531
|
+
if (configuration) {
|
|
6532
|
+
baseOptions = configuration.baseOptions;
|
|
6533
|
+
}
|
|
6534
|
+
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
6535
|
+
localVarHeaderParameter = {};
|
|
6536
|
+
localVarQueryParameter = {};
|
|
6537
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
6538
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
6539
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6540
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
6541
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(x402MessageRequest, localVarRequestOptions, configuration);
|
|
6542
|
+
return [2 /*return*/, {
|
|
6543
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
6544
|
+
options: localVarRequestOptions,
|
|
6545
|
+
}];
|
|
6546
|
+
});
|
|
6547
|
+
});
|
|
6548
|
+
},
|
|
6549
|
+
};
|
|
6550
|
+
};
|
|
6551
|
+
exports.X402ApiAxiosParamCreator = X402ApiAxiosParamCreator;
|
|
6552
|
+
/**
|
|
6553
|
+
* X402Api - functional programming interface
|
|
6554
|
+
*/
|
|
6555
|
+
var X402ApiFp = function (configuration) {
|
|
6556
|
+
var localVarAxiosParamCreator = (0, exports.X402ApiAxiosParamCreator)(configuration);
|
|
6557
|
+
return {
|
|
6558
|
+
/**
|
|
6559
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
6560
|
+
* @summary Chat by x402
|
|
6561
|
+
* @param {string} aid Agent ID
|
|
6562
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
6563
|
+
* @param {*} [options] Override http request option.
|
|
6564
|
+
* @throws {RequiredError}
|
|
6565
|
+
*/
|
|
6566
|
+
chatByX402: function (aid, x402MessageRequest, options) {
|
|
6567
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6568
|
+
var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
|
|
6569
|
+
var _a, _b, _c;
|
|
6570
|
+
return __generator(this, function (_d) {
|
|
6571
|
+
switch (_d.label) {
|
|
6572
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.chatByX402(aid, x402MessageRequest, options)];
|
|
6573
|
+
case 1:
|
|
6574
|
+
localVarAxiosArgs = _d.sent();
|
|
6575
|
+
localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
6576
|
+
localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['X402Api.chatByX402']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
6577
|
+
return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
|
|
6578
|
+
}
|
|
6579
|
+
});
|
|
6580
|
+
});
|
|
6581
|
+
},
|
|
6582
|
+
};
|
|
6583
|
+
};
|
|
6584
|
+
exports.X402ApiFp = X402ApiFp;
|
|
6585
|
+
/**
|
|
6586
|
+
* X402Api - factory interface
|
|
6587
|
+
*/
|
|
6588
|
+
var X402ApiFactory = function (configuration, basePath, axios) {
|
|
6589
|
+
var localVarFp = (0, exports.X402ApiFp)(configuration);
|
|
6590
|
+
return {
|
|
6591
|
+
/**
|
|
6592
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
6593
|
+
* @summary Chat by x402
|
|
6594
|
+
* @param {string} aid Agent ID
|
|
6595
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
6596
|
+
* @param {*} [options] Override http request option.
|
|
6597
|
+
* @throws {RequiredError}
|
|
6598
|
+
*/
|
|
6599
|
+
chatByX402: function (aid, x402MessageRequest, options) {
|
|
6600
|
+
return localVarFp.chatByX402(aid, x402MessageRequest, options).then(function (request) { return request(axios, basePath); });
|
|
6601
|
+
},
|
|
6602
|
+
};
|
|
6603
|
+
};
|
|
6604
|
+
exports.X402ApiFactory = X402ApiFactory;
|
|
6605
|
+
/**
|
|
6606
|
+
* X402Api - object-oriented interface
|
|
6607
|
+
*/
|
|
6608
|
+
var X402Api = /** @class */ (function (_super) {
|
|
6609
|
+
__extends(X402Api, _super);
|
|
6610
|
+
function X402Api() {
|
|
6611
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
6612
|
+
}
|
|
6613
|
+
/**
|
|
6614
|
+
* Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
6615
|
+
* @summary Chat by x402
|
|
6616
|
+
* @param {string} aid Agent ID
|
|
6617
|
+
* @param {X402MessageRequest} x402MessageRequest
|
|
6618
|
+
* @param {*} [options] Override http request option.
|
|
6619
|
+
* @throws {RequiredError}
|
|
6620
|
+
*/
|
|
6621
|
+
X402Api.prototype.chatByX402 = function (aid, x402MessageRequest, options) {
|
|
6622
|
+
var _this = this;
|
|
6623
|
+
return (0, exports.X402ApiFp)(this.configuration).chatByX402(aid, x402MessageRequest, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
6624
|
+
};
|
|
6625
|
+
return X402Api;
|
|
6626
|
+
}(base_1.BaseAPI));
|
|
6627
|
+
exports.X402Api = X402Api;
|
package/dist/base.d.ts
CHANGED
package/dist/base.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.8.
|
|
8
|
+
* The version of the OpenAPI document: 0.8.56
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/common.d.ts
CHANGED
package/dist/common.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.8.
|
|
8
|
+
* The version of the OpenAPI document: 0.8.56
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/configuration.d.ts
CHANGED
package/dist/configuration.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.8.
|
|
8
|
+
* The version of the OpenAPI document: 0.8.56
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -27,8 +27,8 @@ Name | Type | Description | Notes
|
|
|
27
27
|
**supports_presence_penalty** | **boolean** | | [optional] [default to true]
|
|
28
28
|
**api_base** | **string** | | [optional] [default to undefined]
|
|
29
29
|
**timeout** | **number** | | [optional] [default to 180]
|
|
30
|
-
**created_at** | **string** | Timestamp when this data was created | [optional] [default to 2025-11-
|
|
31
|
-
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-11-
|
|
30
|
+
**created_at** | **string** | Timestamp when this data was created | [optional] [default to 2025-11-05T15:49:17.183+00:00]
|
|
31
|
+
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-11-05T15:49:17.183+00:00]
|
|
32
32
|
**provider_name** | **string** | | [default to undefined]
|
|
33
33
|
|
|
34
34
|
## Example
|
package/docs/X402Api.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# X402Api
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**chatByX402**](#chatbyx402) | **POST** /x/{aid} | Chat by x402|
|
|
8
|
+
|
|
9
|
+
# **chatByX402**
|
|
10
|
+
> Array<ChatMessage> chatByX402(x402MessageRequest)
|
|
11
|
+
|
|
12
|
+
Send a new message to a specific chat thread. The response is a list of messages generated by the agent. The response does not include the original user message. It could be skill calls, agent messages, or system error messages. The last message is the agent\'s final response.
|
|
13
|
+
|
|
14
|
+
### Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import {
|
|
18
|
+
X402Api,
|
|
19
|
+
Configuration,
|
|
20
|
+
X402MessageRequest
|
|
21
|
+
} from '@crestal/nation-sdk';
|
|
22
|
+
|
|
23
|
+
const configuration = new Configuration();
|
|
24
|
+
const apiInstance = new X402Api(configuration);
|
|
25
|
+
|
|
26
|
+
let aid: string; //Agent ID (default to undefined)
|
|
27
|
+
let x402MessageRequest: X402MessageRequest; //
|
|
28
|
+
|
|
29
|
+
const { status, data } = await apiInstance.chatByX402(
|
|
30
|
+
aid,
|
|
31
|
+
x402MessageRequest
|
|
32
|
+
);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Parameters
|
|
36
|
+
|
|
37
|
+
|Name | Type | Description | Notes|
|
|
38
|
+
|------------- | ------------- | ------------- | -------------|
|
|
39
|
+
| **x402MessageRequest** | **X402MessageRequest**| | |
|
|
40
|
+
| **aid** | [**string**] | Agent ID | defaults to undefined|
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Return type
|
|
44
|
+
|
|
45
|
+
**Array<ChatMessage>**
|
|
46
|
+
|
|
47
|
+
### Authorization
|
|
48
|
+
|
|
49
|
+
No authorization required
|
|
50
|
+
|
|
51
|
+
### HTTP request headers
|
|
52
|
+
|
|
53
|
+
- **Content-Type**: application/json
|
|
54
|
+
- **Accept**: application/json
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### HTTP response details
|
|
58
|
+
| Status code | Description | Response headers |
|
|
59
|
+
|-------------|-------------|------------------|
|
|
60
|
+
|**200** | Successful Response | - |
|
|
61
|
+
|**422** | Validation Error | - |
|
|
62
|
+
|
|
63
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
64
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# X402MessageRequest
|
|
2
|
+
|
|
3
|
+
Request agent for chat response.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**chat_id** | **string** | | [optional] [default to undefined]
|
|
10
|
+
**app_id** | **string** | | [optional] [default to undefined]
|
|
11
|
+
**message** | **string** | Content of the message | [default to undefined]
|
|
12
|
+
**search_mode** | **boolean** | | [optional] [default to undefined]
|
|
13
|
+
**super_mode** | **boolean** | | [optional] [default to undefined]
|
|
14
|
+
**attachments** | [**Array<ChatMessageAttachment>**](ChatMessageAttachment.md) | | [optional] [default to undefined]
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { X402MessageRequest } from '@crestal/nation-sdk';
|
|
20
|
+
|
|
21
|
+
const instance: X402MessageRequest = {
|
|
22
|
+
chat_id,
|
|
23
|
+
app_id,
|
|
24
|
+
message,
|
|
25
|
+
search_mode,
|
|
26
|
+
super_mode,
|
|
27
|
+
attachments,
|
|
28
|
+
};
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
package/index.ts
CHANGED