UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
259 lines (258 loc) 10.7 kB
/** * AskNews API * AskNews API * * The version of the OpenAPI document: 0.19.10 * 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. */ import * as runtime from '../runtime'; import type { BadDomainUrl, DomainUrl, Offset, ReportingVoice, SearchResponse, SearchResponseDictItem, SourceReportItem } from '../models/index'; export interface GetArticleRequest { articleId: string; } export interface GetArticlesRequest { articleIds: Array<string>; } export interface GetSourcesReportRequest { nPoints?: number; startTimestamp?: number; endTimestamp?: number; metric?: GetSourcesReportMetricEnum; sampling?: GetSourcesReportSamplingEnum; } export interface SearchNewsRequest { query?: string; nArticles?: number; startTimestamp?: number; endTimestamp?: number; timeFilter?: SearchNewsTimeFilterEnum; returnType?: SearchNewsReturnTypeEnum; historical?: boolean; method?: SearchNewsMethodEnum; similarityScoreThreshold?: number; offset?: Offset; categories?: Array<SearchNewsCategoriesEnum>; docStartDelimiter?: string; docEndDelimiter?: string; provocative?: SearchNewsProvocativeEnum; reportingVoice?: ReportingVoice; domainUrl?: DomainUrl; badDomainUrl?: BadDomainUrl; pageRank?: number; diversifySources?: boolean; strategy?: SearchNewsStrategyEnum; hoursBack?: number; stringGuarantee?: Array<string>; stringGuaranteeOp?: SearchNewsStringGuaranteeOpEnum; reverseStringGuarantee?: Array<string>; entityGuarantee?: Array<string>; entityGuaranteeOp?: SearchNewsEntityGuaranteeOpEnum; returnGraphs?: boolean; returnGeo?: boolean; languages?: Array<SearchNewsLanguagesEnum>; countries?: Array<string>; countriesBlacklist?: Array<string>; continents?: Array<SearchNewsContinentsEnum>; sentiment?: SearchNewsSentimentEnum; premium?: boolean; } /** * */ export declare class NewsApi extends runtime.BaseAPI { /** * Get a single article given a UUID. * Get an article by its UUID */ getArticleRaw(requestParameters: GetArticleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchResponseDictItem>>; /** * Get a single article given a UUID. * Get an article by its UUID */ getArticle(requestParameters: GetArticleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchResponseDictItem>; /** * Get articles given a list of UUIDs. * Get multiple articles by UUID */ getArticlesRaw(requestParameters: GetArticlesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SearchResponseDictItem>>>; /** * Get articles given a list of UUIDs. * Get multiple articles by UUID */ getArticles(requestParameters: GetArticlesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SearchResponseDictItem>>; /** * This endpoint is primarly used for transparency and monitoring the diversity of the data. Visualized at `https://asknews.app/transparency`. Get the distribution of sources/languages/countries underlying AskNews content. * Get the sources underlying AskNews */ getSourcesReportRaw(requestParameters: GetSourcesReportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SourceReportItem>>>; /** * This endpoint is primarly used for transparency and monitoring the diversity of the data. Visualized at `https://asknews.app/transparency`. Get the distribution of sources/languages/countries underlying AskNews content. * Get the sources underlying AskNews */ getSourcesReport(requestParameters?: GetSourcesReportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SourceReportItem>>; /** * Search for any news, up to the last 5 minutes or in our extensive historical archive filled with 100s of millions of articles. Geared toward low-latency applications, where time is of the essence. For example, this endpoint is commonly used for quickly getting news context for an LLM. This endpoint is also commonly used for synthetic data curation. For example, say you are fine-tuning a model for sports. You could filter with `classification=\"Sports\"` and build a dataset of sports articles. News articles come with an abundance of valuable metadata, including full summaries, sentiment, entities, reporting voice, page rank, language, and much much more. An example of this data in action can be found and interacted with at `https://asknews.app/chat` * Search for enriched real-time news context */ searchNewsRaw(requestParameters: SearchNewsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchResponse>>; /** * Search for any news, up to the last 5 minutes or in our extensive historical archive filled with 100s of millions of articles. Geared toward low-latency applications, where time is of the essence. For example, this endpoint is commonly used for quickly getting news context for an LLM. This endpoint is also commonly used for synthetic data curation. For example, say you are fine-tuning a model for sports. You could filter with `classification=\"Sports\"` and build a dataset of sports articles. News articles come with an abundance of valuable metadata, including full summaries, sentiment, entities, reporting voice, page rank, language, and much much more. An example of this data in action can be found and interacted with at `https://asknews.app/chat` * Search for enriched real-time news context */ searchNews(requestParameters?: SearchNewsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchResponse>; } /** * @export */ export declare const GetSourcesReportMetricEnum: { readonly Duplication: "duplication"; readonly CountriesDiversity: "countries_diversity"; readonly LanguagesDiversity: "languages_diversity"; readonly SourcesDiversity: "sources_diversity"; readonly BucketLoss: "bucket_loss"; }; export type GetSourcesReportMetricEnum = typeof GetSourcesReportMetricEnum[keyof typeof GetSourcesReportMetricEnum]; /** * @export */ export declare const GetSourcesReportSamplingEnum: { readonly _5m: "5m"; readonly _1h: "1h"; readonly _4h: "4h"; readonly _1d: "1d"; }; export type GetSourcesReportSamplingEnum = typeof GetSourcesReportSamplingEnum[keyof typeof GetSourcesReportSamplingEnum]; /** * @export */ export declare const SearchNewsTimeFilterEnum: { readonly CrawlDate: "crawl_date"; readonly PubDate: "pub_date"; }; export type SearchNewsTimeFilterEnum = typeof SearchNewsTimeFilterEnum[keyof typeof SearchNewsTimeFilterEnum]; /** * @export */ export declare const SearchNewsReturnTypeEnum: { readonly String: "string"; readonly Dicts: "dicts"; readonly Both: "both"; }; export type SearchNewsReturnTypeEnum = typeof SearchNewsReturnTypeEnum[keyof typeof SearchNewsReturnTypeEnum]; /** * @export */ export declare const SearchNewsMethodEnum: { readonly Nl: "nl"; readonly Kw: "kw"; readonly Both: "both"; }; export type SearchNewsMethodEnum = typeof SearchNewsMethodEnum[keyof typeof SearchNewsMethodEnum]; /** * @export */ export declare const SearchNewsCategoriesEnum: { readonly All: "All"; readonly Business: "Business"; readonly Crime: "Crime"; readonly Politics: "Politics"; readonly Science: "Science"; readonly Sports: "Sports"; readonly Technology: "Technology"; readonly Military: "Military"; readonly Health: "Health"; readonly Entertainment: "Entertainment"; readonly Finance: "Finance"; readonly Culture: "Culture"; readonly Climate: "Climate"; readonly Environment: "Environment"; readonly World: "World"; }; export type SearchNewsCategoriesEnum = typeof SearchNewsCategoriesEnum[keyof typeof SearchNewsCategoriesEnum]; /** * @export */ export declare const SearchNewsProvocativeEnum: { readonly Unknown: "unknown"; readonly Low: "low"; readonly Medium: "medium"; readonly High: "high"; readonly All: "all"; }; export type SearchNewsProvocativeEnum = typeof SearchNewsProvocativeEnum[keyof typeof SearchNewsProvocativeEnum]; /** * @export */ export declare const SearchNewsStrategyEnum: { readonly LatestNews: "latest news"; readonly NewsKnowledge: "news knowledge"; readonly Default: "default"; }; export type SearchNewsStrategyEnum = typeof SearchNewsStrategyEnum[keyof typeof SearchNewsStrategyEnum]; /** * @export */ export declare const SearchNewsStringGuaranteeOpEnum: { readonly And: "AND"; readonly Or: "OR"; }; export type SearchNewsStringGuaranteeOpEnum = typeof SearchNewsStringGuaranteeOpEnum[keyof typeof SearchNewsStringGuaranteeOpEnum]; /** * @export */ export declare const SearchNewsEntityGuaranteeOpEnum: { readonly And: "AND"; readonly Or: "OR"; }; export type SearchNewsEntityGuaranteeOpEnum = typeof SearchNewsEntityGuaranteeOpEnum[keyof typeof SearchNewsEntityGuaranteeOpEnum]; /** * @export */ export declare const SearchNewsLanguagesEnum: { readonly En: "en"; readonly De: "de"; readonly Es: "es"; readonly Fr: "fr"; readonly It: "it"; readonly Pt: "pt"; readonly Ru: "ru"; readonly Ar: "ar"; readonly Tr: "tr"; readonly Zh: "zh"; readonly Jp: "jp"; readonly Ko: "ko"; readonly Sv: "sv"; readonly Nl: "nl"; readonly No: "no"; readonly Da: "da"; readonly Uk: "uk"; readonly Pl: "pl"; readonly Hi: "hi"; }; export type SearchNewsLanguagesEnum = typeof SearchNewsLanguagesEnum[keyof typeof SearchNewsLanguagesEnum]; /** * @export */ export declare const SearchNewsContinentsEnum: { readonly Africa: "Africa"; readonly Asia: "Asia"; readonly Oceania: "Oceania"; readonly Europe: "Europe"; readonly MiddleEast: "Middle East"; readonly NorthAmerica: "North America"; readonly SouthAmerica: "South America"; }; export type SearchNewsContinentsEnum = typeof SearchNewsContinentsEnum[keyof typeof SearchNewsContinentsEnum]; /** * @export */ export declare const SearchNewsSentimentEnum: { readonly Negative: "negative"; readonly Neutral: "neutral"; readonly Positive: "positive"; }; export type SearchNewsSentimentEnum = typeof SearchNewsSentimentEnum[keyof typeof SearchNewsSentimentEnum];