/* 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.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 { mapValues } from '../runtime';
import type { MCPFilterParams } from './MCPFilterParams';
import {
    MCPFilterParamsFromJSON,
    MCPFilterParamsFromJSONTyped,
    MCPFilterParamsToJSON,
    MCPFilterParamsToJSONTyped,
} from './MCPFilterParams';
import type { Sources2 } from './Sources2';
import {
    Sources2FromJSON,
    Sources2FromJSONTyped,
    Sources2ToJSON,
    Sources2ToJSONTyped,
} from './Sources2';
import type { DeepNewsModel } from './DeepNewsModel';
import {
    DeepNewsModelFromJSON,
    DeepNewsModelFromJSONTyped,
    DeepNewsModelToJSON,
    DeepNewsModelToJSONTyped,
} from './DeepNewsModel';

/**
 * Parameters for DeepNews alert report.
 * 
 * DeepNews performs deep research using multiple tools.
 * @export
 * @interface DeepNewsReportParams
 */
export interface DeepNewsReportParams {
    /**
     * 
     * @type {Sources2}
     * @memberof DeepNewsReportParams
     */
    sources?: Sources2;
    /**
     * 
     * @type {MCPFilterParams}
     * @memberof DeepNewsReportParams
     */
    filterParams?: MCPFilterParams | null;
    /**
     * Whether to provide extracted entities to the agent. Defaults to True.
     * @type {boolean}
     * @memberof DeepNewsReportParams
     */
    includeEntities?: boolean;
    /**
     * Whether to provide knowledge graphs to the agent. Defaults to False.
     * @type {boolean}
     * @memberof DeepNewsReportParams
     */
    includeGraphs?: boolean;
    /**
     * Whether to provide geo coordinates to the agent. Defaults to False.
     * @type {boolean}
     * @memberof DeepNewsReportParams
     */
    includeCoordinates?: boolean;
    /**
     * Legacy vs new DeepNews engine
     * @type {string}
     * @memberof DeepNewsReportParams
     */
    engine?: DeepNewsReportParamsEngineEnum;
    /**
     * The number of tool calls the agent can run in parallel.
     * @type {number}
     * @memberof DeepNewsReportParams
     */
    maxParallelToolCalls?: number;
    /**
     * Whether to enable source pruning, which removes sources that are deemed irrelevant to the final report. This can help reduce noise in the sources and improve the quality of the report, but may also remove some relevant sources if not used carefully.
     * @type {boolean}
     * @memberof DeepNewsReportParams
     */
    enableSourcePruning?: boolean;
    /**
     * 
     * @type {Date}
     * @memberof DeepNewsReportParams
     */
    cutoffDatetime?: Date | null;
    /**
     * 
     * @type {DeepNewsModel}
     * @memberof DeepNewsReportParams
     */
    model?: DeepNewsModel | null;
    /**
     * The search depth for deep research. Higher values mean more thorough research. Defaults to 2.
     * @type {number}
     * @memberof DeepNewsReportParams
     */
    searchDepth?: number;
    /**
     * The maximum research depth allowed. Defaults to 4.
     * @type {number}
     * @memberof DeepNewsReportParams
     */
    maxDepth?: number;
    /**
     * Starting number for inline citations. Offsets fetched source citation keys. Useful if you are providing the agent outside sources with numbered citation keys. Defaults to 1.
     * @type {number}
     * @memberof DeepNewsReportParams
     */
    startCitationNumber?: number;
    /**
     * Whether to use journalist mode for more factual reporting. Defaults to True.
     * @type {boolean}
     * @memberof DeepNewsReportParams
     */
    journalistMode?: boolean;
}


/**
 * @export
 */
export const DeepNewsReportParamsEngineEnum = {
    V1: 'v1',
    V15: 'v1.5'
} as const;
export type DeepNewsReportParamsEngineEnum = typeof DeepNewsReportParamsEngineEnum[keyof typeof DeepNewsReportParamsEngineEnum];


/**
 * Check if a given object implements the DeepNewsReportParams interface.
 */
export function instanceOfDeepNewsReportParams(value: object): value is DeepNewsReportParams {
    return true;
}

export function DeepNewsReportParamsFromJSON(json: any): DeepNewsReportParams {
    return DeepNewsReportParamsFromJSONTyped(json, false);
}

export function DeepNewsReportParamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeepNewsReportParams {
    if (json == null) {
        return json;
    }
    return {
        
        'sources': json['sources'] == null ? undefined : Sources2FromJSON(json['sources']),
        'filterParams': json['filter_params'] == null ? undefined : MCPFilterParamsFromJSON(json['filter_params']),
        'includeEntities': json['include_entities'] == null ? undefined : json['include_entities'],
        'includeGraphs': json['include_graphs'] == null ? undefined : json['include_graphs'],
        'includeCoordinates': json['include_coordinates'] == null ? undefined : json['include_coordinates'],
        'engine': json['engine'] == null ? undefined : json['engine'],
        'maxParallelToolCalls': json['max_parallel_tool_calls'] == null ? undefined : json['max_parallel_tool_calls'],
        'enableSourcePruning': json['enable_source_pruning'] == null ? undefined : json['enable_source_pruning'],
        'cutoffDatetime': json['cutoff_datetime'] == null ? undefined : (new Date(json['cutoff_datetime'])),
        'model': json['model'] == null ? undefined : DeepNewsModelFromJSON(json['model']),
        'searchDepth': json['search_depth'] == null ? undefined : json['search_depth'],
        'maxDepth': json['max_depth'] == null ? undefined : json['max_depth'],
        'startCitationNumber': json['start_citation_number'] == null ? undefined : json['start_citation_number'],
        'journalistMode': json['journalist_mode'] == null ? undefined : json['journalist_mode'],
    };
}

export function DeepNewsReportParamsToJSON(json: any): DeepNewsReportParams {
    return DeepNewsReportParamsToJSONTyped(json, false);
}

export function DeepNewsReportParamsToJSONTyped(value?: DeepNewsReportParams | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'sources': Sources2ToJSON(value['sources']),
        'filter_params': MCPFilterParamsToJSON(value['filterParams']),
        'include_entities': value['includeEntities'],
        'include_graphs': value['includeGraphs'],
        'include_coordinates': value['includeCoordinates'],
        'engine': value['engine'],
        'max_parallel_tool_calls': value['maxParallelToolCalls'],
        'enable_source_pruning': value['enableSourcePruning'],
        'cutoff_datetime': value['cutoffDatetime'] == null ? undefined : ((value['cutoffDatetime'] as any).toISOString()),
        'model': DeepNewsModelToJSON(value['model']),
        'search_depth': value['searchDepth'],
        'max_depth': value['maxDepth'],
        'start_citation_number': value['startCitationNumber'],
        'journalist_mode': value['journalistMode'],
    };
}

