@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
240 lines (239 loc) • 8.62 kB
TypeScript
/**
* AskNews API
* AskNews API [](https://status.asknews.app/status/prod)
*
* The version of the OpenAPI document: 0.24.66
* 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 type { CreateDeepNewsRequestMessage } from './CreateDeepNewsRequestMessage';
import type { User1 } from './User1';
import type { FilterParams1 } from './FilterParams1';
import type { CreateDeepNewsRequestModel } from './CreateDeepNewsRequestModel';
import type { Stop1 } from './Stop1';
import type { Sources1 } from './Sources1';
import type { CutoffDatetime } from './CutoffDatetime';
import type { ThreadId1 } from './ThreadId1';
/**
*
* @export
* @interface CreateDeepNewsRequest
*/
export interface CreateDeepNewsRequest {
[key: string]: any | any;
/**
* The messages to send to DeepNews. Each message should have 'role' and 'content' keys. Use this to specify what research/monitoring task DeepNews should perform. The 'content' for the final 'user' message should be your Alert query.
* @type {Array<CreateDeepNewsRequestMessage>}
* @memberof CreateDeepNewsRequest
*/
messages: Array<CreateDeepNewsRequestMessage>;
/**
*
* @type {CreateDeepNewsRequestModel}
* @memberof CreateDeepNewsRequest
*/
model?: CreateDeepNewsRequestModel;
/**
*
* @type {FilterParams1}
* @memberof CreateDeepNewsRequest
*/
filterParams?: FilterParams1;
/**
* The search depth for deep research. Higher values mean more thorough research.
* @type {number}
* @memberof CreateDeepNewsRequest
*/
searchDepth?: number;
/**
* The maximum research depth allowed.
* @type {number}
* @memberof CreateDeepNewsRequest
*/
maxDepth?: number;
/**
*
* @type {Sources1}
* @memberof CreateDeepNewsRequest
*/
sources?: Sources1;
/**
* How to format inline citations in the response. Defaults to: markdown_link. Available options: markdown_link, numbered, none
* @type {string}
* @memberof CreateDeepNewsRequest
*/
inlineCitations?: CreateDeepNewsRequestInlineCitationsEnum;
/**
* Starting number for inline citations. Offsets fetched source citation keys. Useful if you are providing the agent outside sources with numbered citation keys.
* @type {number}
* @memberof CreateDeepNewsRequest
*/
startCitationNumber?: number;
/**
* Whether return a list of sources used by the agent.
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
returnSources?: boolean;
/**
* Whether to return only of sources that are cited/referenced in the generated response content.
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
onlyCitedSources?: boolean;
/**
* Whether to append a 'Cited Articles' section at the end of the response.
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
appendReferences?: boolean;
/**
* Whether to use journalist mode for more factual reporting.
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
journalistMode?: boolean;
/**
* Whether to use conversational awareness.
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
conversationalAwareness?: boolean;
/**
* Whether to provide extracted entities to the agent.
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
includeEntities?: boolean;
/**
* Whether to provide knowledge graphs to the agent
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
includeGraphs?: boolean;
/**
* Whether to provide geo coordinates to the agent.
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
includeCoordinates?: boolean;
/**
* Append 'Generated by AskNews AI' watermark
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
asknewsWatermark?: boolean;
/**
* Whether to stream the response as server-sent events.
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
stream?: boolean;
/**
*
* @type {Stop1}
* @memberof CreateDeepNewsRequest
*/
stop?: Stop1;
/**
* The temperature of the DeepNews agent model. Controls randomness in the output. Higher values (e.g., 1.0) make output more random, lower values (e.g., 0.1) make it more deterministic.
* @type {number}
* @memberof CreateDeepNewsRequest
*/
temperature?: number;
/**
* Nucleus sampling parameter. Only tokens with cumulative probability up to top_p are considered.
* @type {number}
* @memberof CreateDeepNewsRequest
*/
topP?: number;
/**
* Number of completions to generate.
* @type {number}
* @memberof CreateDeepNewsRequest
*/
n?: number;
/**
* Maximum number of tokens to generate in the response.
* @type {number}
* @memberof CreateDeepNewsRequest
*/
maxTokens?: number;
/**
* Penalizes new tokens based on whether they appear in the text so far, encouraging new topics.
* @type {number}
* @memberof CreateDeepNewsRequest
*/
presencePenalty?: number;
/**
* Penalizes new tokens based on their frequency in the text so far, reducing repetition.
* @type {number}
* @memberof CreateDeepNewsRequest
*/
frequencyPenalty?: number;
/**
*
* @type {User1}
* @memberof CreateDeepNewsRequest
*/
user?: User1;
/**
*
* @type {ThreadId1}
* @memberof CreateDeepNewsRequest
*/
threadId?: ThreadId1;
/**
* Maximum number of parallel tool calls (e.g., searches) the agent can make during generation. Higher values may speed up responses, but may reduce on-the-fly adaptivity.
* @type {number}
* @memberof CreateDeepNewsRequest
*/
maxParallelToolCalls?: number;
/**
* The engine to use for the DeepNews agent. 'v1' is deprecated while 'v1.5' is our next-generation research agent with access to more tools, better contextual understanding, and improved reasoning capabilities.'v1.5' streams thinking and tool use using tags <think> </think>, <tool_a> </tool_a> Meanwhile, 'v2.0' is the same underlying agent as 'v1.5', but the thinking and tool use chunks are typed content_block_delta's streamed between content_block_start and content_block_stop events, mimicking Anthropic's approach to streaming tool use/thinking events.
* @type {string}
* @memberof CreateDeepNewsRequest
*/
engine?: CreateDeepNewsRequestEngineEnum;
/**
* Whether to enable source pruning, which removes sources that are deemed irrelevant to the final response. This can help reduce noise in the sources and improve the quality of the response, but may also remove some relevant sources if not used carefully.
* @type {boolean}
* @memberof CreateDeepNewsRequest
*/
enableSourcePruning?: boolean;
/**
*
* @type {CutoffDatetime}
* @memberof CreateDeepNewsRequest
*/
cutoffDatetime?: CutoffDatetime;
}
/**
* @export
*/
export declare const CreateDeepNewsRequestInlineCitationsEnum: {
readonly MarkdownLink: "markdown_link";
readonly Numbered: "numbered";
readonly None: "none";
};
export type CreateDeepNewsRequestInlineCitationsEnum = typeof CreateDeepNewsRequestInlineCitationsEnum[keyof typeof CreateDeepNewsRequestInlineCitationsEnum];
/**
* @export
*/
export declare const CreateDeepNewsRequestEngineEnum: {
readonly V1: "v1";
readonly V15: "v1.5";
readonly V20: "v2.0";
};
export type CreateDeepNewsRequestEngineEnum = typeof CreateDeepNewsRequestEngineEnum[keyof typeof CreateDeepNewsRequestEngineEnum];
/**
* Check if a given object implements the CreateDeepNewsRequest interface.
*/
export declare function instanceOfCreateDeepNewsRequest(value: object): value is CreateDeepNewsRequest;
export declare function CreateDeepNewsRequestFromJSON(json: any): CreateDeepNewsRequest;
export declare function CreateDeepNewsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDeepNewsRequest;
export declare function CreateDeepNewsRequestToJSON(json: any): CreateDeepNewsRequest;
export declare function CreateDeepNewsRequestToJSONTyped(value?: CreateDeepNewsRequest | null, ignoreDiscriminator?: boolean): any;