UNPKG

@cotofe/service-of-model

Version:

OpenAPI client for @cotofe/service-of-model

229 lines (228 loc) 10.4 kB
"use strict"; /* tslint:disable */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ModelAiAgentApi = void 0; const runtime = require("../runtime"); /** * */ class ModelAiAgentApi extends runtime.BaseAPI { /** * agent brief list * agent brief list */ briefListUsingGETRaw(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters.authorization = yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication } const response = yield this.request({ path: `/api/v1/aiagent/brief-list`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * agent brief list * agent brief list */ briefListUsingGET(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.briefListUsingGETRaw(initOverrides); return yield response.value(); }); } /** * agent detail * agent detail */ detailUsingGET1Raw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.assistantId == null) { throw new runtime.RequiredError('assistantId', 'Required parameter "assistantId" was null or undefined when calling detailUsingGET1().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters.authorization = yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication } const response = yield this.request({ path: `/api/v1/aiagent/detail/{assistantId}`.replace(`{${'assistantId'}}`, encodeURIComponent(String(requestParameters.assistantId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * agent detail * agent detail */ detailUsingGET1(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.detailUsingGET1Raw(requestParameters, initOverrides); return yield response.value(); }); } /** * get the list of chat(thread) in the agent * get the list of chat(thread) in the agent */ getAssistantThreadListUsingGETRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.assistantId == null) { throw new runtime.RequiredError('assistantId', 'Required parameter "assistantId" was null or undefined when calling getAssistantThreadListUsingGET().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters.authorization = yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication } const response = yield this.request({ path: `/api/v1/aiagent/threads/{assistantId}`.replace(`{${'assistantId'}}`, encodeURIComponent(String(requestParameters.assistantId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * get the list of chat(thread) in the agent * get the list of chat(thread) in the agent */ getAssistantThreadListUsingGET(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getAssistantThreadListUsingGETRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * * getThreadMessages */ getThreadMessagesUsingGETRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.threadId == null) { throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling getThreadMessagesUsingGET().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters.authorization = yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication } const response = yield this.request({ path: `/api/v1/aiagent/threads/{threadId}/messages`.replace(`{${'threadId'}}`, encodeURIComponent(String(requestParameters.threadId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * * getThreadMessages */ getThreadMessagesUsingGET(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getThreadMessagesUsingGETRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * update the visibility of agent * update the visibility of agent */ updateVisibilityUsingPUTRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.id == null) { throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateVisibilityUsingPUT().'); } if (requestParameters.visibility == null) { throw new runtime.RequiredError('visibility', 'Required parameter "visibility" was null or undefined when calling updateVisibilityUsingPUT().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters.authorization = yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication } const response = yield this.request({ path: `/api/v1/aiagent/visibility/{id}/{visibility}` .replace(`{${'id'}}`, encodeURIComponent(String(requestParameters.id))) .replace(`{${'visibility'}}`, encodeURIComponent(String(requestParameters.visibility))), method: 'PUT', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * update the visibility of agent * update the visibility of agent */ updateVisibilityUsingPUT(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.updateVisibilityUsingPUTRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * create a new chat(thread) in the agent * create a new chat(thread) in the agent */ upsertThreadUsingPUTRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.threadId == null) { throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling upsertThreadUsingPUT().'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters.authorization = yield this.configuration.apiKey('authorization'); // apikey-header-authorization authentication } const response = yield this.request({ path: `/api/v1/aiagent/threads/{threadId}`.replace(`{${'threadId'}}`, encodeURIComponent(String(requestParameters.threadId))), method: 'PUT', headers: headerParameters, query: queryParameters, body: requestParameters.theRequestOfWhenCreateANewChatThreadInTheAgent, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * create a new chat(thread) in the agent * create a new chat(thread) in the agent */ upsertThreadUsingPUT(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.upsertThreadUsingPUTRaw(requestParameters, initOverrides); return yield response.value(); }); } } exports.ModelAiAgentApi = ModelAiAgentApi;