Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/validate/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface NSFWValidationResponse {
gore: boolean;
nsfw_score: number;
nudity_score: number;
gore_score: number;
gore_score: number;
}

export interface ProfanityParams {
Expand Down
74 changes: 74 additions & 0 deletions src/web/interfaces/deep_research.ts
Original file line number Diff line number Diff line change
@@ -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;
}
5 changes: 5 additions & 0 deletions src/web/web.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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<DeepResearchResponse> => {
return await this.client.fetchJSS("/web/deep_research", "POST", params);
};
}

export default Web;