diff --git a/src/validate/interfaces.ts b/src/validate/interfaces.ts index ab2ef3d..4eaa84a 100644 --- a/src/validate/interfaces.ts +++ b/src/validate/interfaces.ts @@ -16,7 +16,7 @@ export interface NSFWValidationResponse { gore: boolean; nsfw_score: number; nudity_score: number; - gore_score: number; + gore_score: number; } export interface ProfanityParams { diff --git a/src/web/interfaces/deep_research.ts b/src/web/interfaces/deep_research.ts new file mode 100644 index 0000000..8d69030 --- /dev/null +++ b/src/web/interfaces/deep_research.ts @@ -0,0 +1,74 @@ +// Input parameters interface for reference +export interface DeepResearchParams { + query: string; + spell_check?: boolean; + safe_search?: "strict" | "moderate" | "off"; + country_code?: string; + max_depth?: number; + max_breadth?: number; + max_output_tokens?: number; + target_output_tokens?: number; +} + +export interface DeepResearchResponse { + success: boolean; + query: string; + results: string; + sources: SearchResult[]; + geo_results: GeoResult[]; + image_urls: string[]; + links: string[]; +} + +interface SearchResult { + title?: string; + url?: string; + description?: string; + content: string | null; + site_name?: string; + site_long_name?: string; + age?: string; // ISO date string + language?: string; + image_urls: string[]; + links: string[]; + is_safe?: boolean; + favicon: string; + thumbnail?: string; + snippets?: any[]; + related_index?: RelatedResult[]; +} + +interface RelatedResult { + title?: string; + url?: string; + description?: string; + is_safe?: boolean; +} + +interface GeoResult { + type: string; + full_address: string; + name: string; + name_preferred?: string; + place_formatted?: string; + postcode?: string; + district?: string; + place?: string; + region?: { + name: string; + region_code?: string; + region_code_full?: string; + }; + country?: { + name: string; + country_code?: string; + country_code_alpha_3?: string; + }; + language: string; + geoloc: { + type: string; + coordinates: [number, number]; // [longitude, latitude] + }; + poi_category?: string[]; + additional_properties?: any; +} diff --git a/src/web/web.ts b/src/web/web.ts index 0a83123..fe9cdfe 100644 --- a/src/web/web.ts +++ b/src/web/web.ts @@ -1,5 +1,6 @@ import { respToFileChoice } from "../helpers"; import { RequestClient } from "../request"; +import { DeepResearchParams, DeepResearchResponse } from "./interfaces/deep_research"; import { HTMLAnyParams } from "./interfaces/html_to_any"; import { AIScrapeParams, AIScrapeResponse } from "./interfaces/scrape"; class Web { @@ -13,6 +14,10 @@ class Web { const resp = await this.client.fetchJSS("/web/html_to_any", "POST", params); return respToFileChoice(resp); }; + + deep_research = async (params: DeepResearchParams): Promise => { + return await this.client.fetchJSS("/web/deep_research", "POST", params); + }; } export default Web;