UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
81 lines (80 loc) 3.88 kB
/* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API [![status](https://status.asknews.app/api/badge/2/status?style=for-the-badge)](https://status.asknews.app/status/prod) * * The version of the OpenAPI document: 0.24.22 * Contact: contact@emergentmethods.ai * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ 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()); }); }; import * as runtime from '../runtime'; import { WikiSearchResponseFromJSON, } from '../models/index'; /** * */ export class WikiApi extends runtime.BaseAPI { /** * Search on Wikipedia content with natural language. Find exactly relevant chunks, with contextual neighbor chunks, and the full articles they came from. * Search for Wikipedia context with natural language */ searchWikiRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters['query'] != null) { queryParameters['query'] = requestParameters['query']; } if (requestParameters['neighborChunks'] != null) { queryParameters['neighbor_chunks'] = requestParameters['neighborChunks']; } if (requestParameters['nDocuments'] != null) { queryParameters['n_documents'] = requestParameters['nDocuments']; } if (requestParameters['fullArticles'] != null) { queryParameters['full_articles'] = requestParameters['fullArticles']; } if (requestParameters['hybridSearch'] != null) { queryParameters['hybrid_search'] = requestParameters['hybridSearch']; } if (requestParameters['stringGuarantee'] != null) { queryParameters['string_guarantee'] = requestParameters['stringGuarantee']; } if (requestParameters['diversify'] != null) { queryParameters['diversify'] = requestParameters['diversify']; } if (requestParameters['includeMainSection'] != null) { queryParameters['include_main_section'] = requestParameters['includeMainSection']; } const headerParameters = {}; const response = yield this.request({ path: `/v1/wiki/search`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => WikiSearchResponseFromJSON(jsonValue)); }); } /** * Search on Wikipedia content with natural language. Find exactly relevant chunks, with contextual neighbor chunks, and the full articles they came from. * Search for Wikipedia context with natural language */ searchWiki(requestParameters = {}, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.searchWikiRaw(requestParameters, initOverrides); return yield response.value(); }); } }