Skip to content

Commit a56aa1b

Browse files
Add Gemini target from bundled IR v2.1.1 (#18)
* Update bundled IR to v2.1.1 and regenerate SDK Bump the bundled Web Scraping API IR from v2.0.1 to v2.1.1 and re-run codegen. The new IR adds the `gemini` target (AI Tools), so regeneration adds the GeminiParams type, target enum/list entry, target metadata, and request JSON/Zod schemas. SCR-3264 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Add gemini target example and README entry Add an example file and AI tools table row for the new gemini target, matching the existing chatgpt and perplexity targets. SCR-3264 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Bump version to 2.2.0 Minor bump for the additive gemini target introduced by IR v2.1.1. SCR-3264 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ede9dec commit a56aa1b

5 files changed

Lines changed: 63 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ Each target accepts one primary input parameter (`url`, `query`, `product_id`, o
466466
| --- | --- | --- |
467467
| `Target.Chatgpt` | ChatGPT response for a prompt | `{ target: Target.Chatgpt, prompt: "What are the top three dog breeds?" }` |
468468
| `Target.Perplexity` | Perplexity response for a prompt | `{ target: Target.Perplexity, prompt: "What causes seasonal allergies?" }` |
469+
| `Target.Gemini` | Gemini response for a prompt | `{ target: Target.Gemini, prompt: "What are the top three dog breeds?" }` |
469470
| `Target.GoogleAiMode` | Google AI Mode response | `{ target: Target.GoogleAiMode, query: "What are the top three dog breeds?" }` |
470471

471472
### Universal scraping
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { DecodoClient, Target } from '@decodo/sdk-ts';
2+
3+
const client = new DecodoClient({
4+
webScrapingApi: {
5+
token: '<web_auth_token>',
6+
},
7+
});
8+
9+
const res = await client.webScrapingApi.scrape({
10+
target: Target.Gemini,
11+
prompt: 'What are the top three dog breeds?',
12+
parse: true,
13+
geo: 'United States',
14+
});
15+
16+
console.log(JSON.stringify(res, null, 2));

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@decodo/sdk-ts",
3-
"version": "2.1.2",
3+
"version": "2.2.0",
44
"description": "Official TypeScript SDK for the Decodo APIs",
55
"type": "module",
66
"main": "./build/cjs/index.cjs",

src/generated/request-schemas.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,34 @@ export const requestJsonSchemas = {
15141514
],
15151515
"additionalProperties": false
15161516
},
1517+
[Target.Gemini]: {
1518+
"type": "object",
1519+
"properties": {
1520+
"target": {
1521+
"const": "gemini"
1522+
},
1523+
"prompt": {
1524+
"type": "string",
1525+
"maxLength": 8192
1526+
},
1527+
"parse": {
1528+
"type": "boolean"
1529+
},
1530+
"geo": {
1531+
"type": "string"
1532+
},
1533+
"xhr": {
1534+
"type": "boolean"
1535+
},
1536+
"callback_url": {
1537+
"type": "string"
1538+
}
1539+
},
1540+
"required": [
1541+
"target"
1542+
],
1543+
"additionalProperties": false
1544+
},
15171545
[Target.Bbb]: {
15181546
"type": "object",
15191547
"properties": {
@@ -2186,6 +2214,7 @@ export const requestSchemas: Record<Target, z.ZodType> = {
21862214
[Target.Universal]: z.fromJSONSchema(requestJsonSchemas[Target.Universal] as unknown as z.core.JSONSchema.JSONSchema),
21872215
[Target.Chatgpt]: z.fromJSONSchema(requestJsonSchemas[Target.Chatgpt] as unknown as z.core.JSONSchema.JSONSchema),
21882216
[Target.Perplexity]: z.fromJSONSchema(requestJsonSchemas[Target.Perplexity] as unknown as z.core.JSONSchema.JSONSchema),
2217+
[Target.Gemini]: z.fromJSONSchema(requestJsonSchemas[Target.Gemini] as unknown as z.core.JSONSchema.JSONSchema),
21892218
[Target.Bbb]: z.fromJSONSchema(requestJsonSchemas[Target.Bbb] as unknown as z.core.JSONSchema.JSONSchema),
21902219
[Target.Autotrader]: z.fromJSONSchema(requestJsonSchemas[Target.Autotrader] as unknown as z.core.JSONSchema.JSONSchema),
21912220
[Target.Mobile]: z.fromJSONSchema(requestJsonSchemas[Target.Mobile] as unknown as z.core.JSONSchema.JSONSchema),

src/generated/targets.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export enum Target {
3636
Universal = 'universal',
3737
Chatgpt = 'chatgpt',
3838
Perplexity = 'perplexity',
39+
Gemini = 'gemini',
3940
Bbb = 'bbb',
4041
Autotrader = 'autotrader',
4142
Mobile = 'mobile',
@@ -60,7 +61,7 @@ export enum Target {
6061
/** API discriminator string literals (same values as {@link Target}). */
6162
export type TargetString = (typeof Target)[keyof typeof Target];
6263

63-
export const targets = [Target.UniversalEcommerce, Target.GoogleSearch, Target.GoogleTravelHotels, Target.GoogleTrendsExplore, Target.GoogleShoppingSearch, Target.GoogleShoppingProduct, Target.Google, Target.GoogleSuggest, Target.GoogleMaps, Target.GoogleAiMode, Target.GoogleAds, Target.GoogleLens, Target.BingSearch, Target.Bing, Target.YoutubeTranscript, Target.AmazonProduct, Target.AmazonPricing, Target.AmazonSearch, Target.AmazonSellers, Target.AmazonBestsellers, Target.Amazon, Target.Ecommerce, Target.WalmartProduct, Target.WalmartSearch, Target.Walmart, Target.TargetProduct, Target.TargetSearch, Target.Target, Target.LowesSearch, Target.Universal, Target.Chatgpt, Target.Perplexity, Target.Bbb, Target.Autotrader, Target.Mobile, Target.Airbnb, Target.AppleAppStore, Target.InstagramGraphqlProfile, Target.TiktokPost, Target.TiktokShopSearch, Target.TiktokShopProduct, Target.Tiktok, Target.RedditPost, Target.RedditSubreddit, Target.RedditUser, Target.YoutubeVideo, Target.YoutubeMetadata, Target.YoutubeSearch, Target.YoutubeSearchMax, Target.YoutubeSubtitles, Target.YoutubeChannel] as const;
64+
export const targets = [Target.UniversalEcommerce, Target.GoogleSearch, Target.GoogleTravelHotels, Target.GoogleTrendsExplore, Target.GoogleShoppingSearch, Target.GoogleShoppingProduct, Target.Google, Target.GoogleSuggest, Target.GoogleMaps, Target.GoogleAiMode, Target.GoogleAds, Target.GoogleLens, Target.BingSearch, Target.Bing, Target.YoutubeTranscript, Target.AmazonProduct, Target.AmazonPricing, Target.AmazonSearch, Target.AmazonSellers, Target.AmazonBestsellers, Target.Amazon, Target.Ecommerce, Target.WalmartProduct, Target.WalmartSearch, Target.Walmart, Target.TargetProduct, Target.TargetSearch, Target.Target, Target.LowesSearch, Target.Universal, Target.Chatgpt, Target.Perplexity, Target.Gemini, Target.Bbb, Target.Autotrader, Target.Mobile, Target.Airbnb, Target.AppleAppStore, Target.InstagramGraphqlProfile, Target.TiktokPost, Target.TiktokShopSearch, Target.TiktokShopProduct, Target.Tiktok, Target.RedditPost, Target.RedditSubreddit, Target.RedditUser, Target.YoutubeVideo, Target.YoutubeMetadata, Target.YoutubeSearch, Target.YoutubeSearchMax, Target.YoutubeSubtitles, Target.YoutubeChannel] as const;
6465

6566
export interface UniversalEcommerceParams {
6667
callback_url?: string;
@@ -482,6 +483,14 @@ export interface PerplexityParams {
482483
callback_url?: string;
483484
}
484485

486+
export interface GeminiParams {
487+
prompt?: string;
488+
parse?: boolean;
489+
geo?: string;
490+
xhr?: boolean;
491+
callback_url?: string;
492+
}
493+
485494
export interface BbbParams {
486495
url?: string;
487496
headless?: 'html' | 'png';
@@ -691,6 +700,7 @@ export type TargetParamsMap = {
691700
[Target.Universal]: UniversalParams;
692701
[Target.Chatgpt]: ChatgptParams;
693702
[Target.Perplexity]: PerplexityParams;
703+
[Target.Gemini]: GeminiParams;
694704
[Target.Bbb]: BbbParams;
695705
[Target.Autotrader]: AutotraderParams;
696706
[Target.Mobile]: MobileParams;
@@ -887,6 +897,11 @@ export const targetMeta: Record<Target, TargetMeta> = {
887897
response_format: "json",
888898
parameters: ["prompt", "parse", "geo", "device_type", "markdown", "xhr", "callback_url"],
889899
},
900+
[Target.Gemini]: {
901+
group: "AI Tools",
902+
response_format: "json",
903+
parameters: ["prompt", "parse", "geo", "xhr", "callback_url"],
904+
},
890905
[Target.Bbb]: {
891906
group: "Business Reviews",
892907
response_format: "html",

0 commit comments

Comments
 (0)