mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-04-28 03:30:10 +00:00
Fix Gemini flex PayGo header and add OpenAI GPT-5-nano/GPT-5.4 flex routers (#5511)
This commit is contained in:
parent
0e72bdabd7
commit
f7f9cf96b2
10 changed files with 76 additions and 7 deletions
|
|
@ -252,13 +252,14 @@ export const PROXY_LOCATIONS = [
|
|||
{ code: "IN", name: "India", value: "RESIDENTIAL_IN", timezone: "Asia/Kolkata", flag: "🇮🇳" },
|
||||
{ code: "PH", name: "Philippines", value: "RESIDENTIAL_PH", timezone: "Asia/Manila", flag: "🇵🇭" },
|
||||
{ code: "KR", name: "South Korea", value: "RESIDENTIAL_KR", timezone: "Asia/Seoul", flag: "🇰🇷" },
|
||||
{ code: "SA", name: "Saudi Arabia", value: "RESIDENTIAL_SA", timezone: "Asia/Riyadh", flag: "🇸🇦" },
|
||||
{ code: "JP", name: "Japan", value: "RESIDENTIAL_JP", timezone: "Asia/Tokyo", flag: "🇯🇵" },
|
||||
{ code: "AU", name: "Australia", value: "RESIDENTIAL_AU", timezone: "Australia/Sydney", flag: "🇦🇺" },
|
||||
{ code: "NZ", name: "New Zealand", value: "RESIDENTIAL_NZ", timezone: "Pacific/Auckland", flag: "🇳🇿" },
|
||||
{ code: "NONE", name: "No Proxy", value: "NONE", timezone: "—", flag: "🚫" },
|
||||
]
|
||||
|
||||
export const AVAILABLE_COUNTRIES = ["US", "CA", "MX", "AR", "BR", "GB", "IE", "NL", "DE", "FR", "ES", "IT", "TR", "ZA", "IN", "PH", "KR", "JP", "AU", "NZ"]
|
||||
export const AVAILABLE_COUNTRIES = ["US", "CA", "MX", "AR", "BR", "GB", "IE", "NL", "DE", "FR", "ES", "IT", "TR", "ZA", "IN", "PH", "KR", "SA", "JP", "AU", "NZ"]
|
||||
|
||||
export const ProxyMapSelector = () => {
|
||||
const [selected, setSelected] = useState("US")
|
||||
|
|
@ -597,6 +598,7 @@ Use these enum values for country-level targeting. Each routes through a residen
|
|||
| `RESIDENTIAL_NZ` | New Zealand | Pacific/Auckland |
|
||||
| `RESIDENTIAL_PH` | Philippines | Asia/Manila |
|
||||
| `RESIDENTIAL_KR` | South Korea | Asia/Seoul |
|
||||
| `RESIDENTIAL_SA` | Saudi Arabia | Asia/Riyadh |
|
||||
| `RESIDENTIAL_TR` | Türkiye | Europe/Istanbul |
|
||||
| `RESIDENTIAL_ZA` | South Africa | Africa/Johannesburg |
|
||||
| `NONE` | No proxy | — |
|
||||
|
|
|
|||
|
|
@ -600,6 +600,7 @@ curl -X POST "https://api.skyvern.com/v1/run/workflows" \
|
|||
| `RESIDENTIAL_NZ` | New Zealand |
|
||||
| `RESIDENTIAL_PH` | Philippines |
|
||||
| `RESIDENTIAL_KR` | South Korea |
|
||||
| `RESIDENTIAL_SA` | Saudi Arabia |
|
||||
| `RESIDENTIAL_TR` | Türkiye |
|
||||
| `RESIDENTIAL_ZA` | South Africa |
|
||||
| `NONE` | No proxy |
|
||||
|
|
|
|||
|
|
@ -308,6 +308,7 @@ Use this for geo-restricted content or to reduce bot detection.
|
|||
| `RESIDENTIAL_NL` | Netherlands |
|
||||
| `RESIDENTIAL_PH` | Philippines |
|
||||
| `RESIDENTIAL_KR` | South Korea |
|
||||
| `RESIDENTIAL_SA` | Saudi Arabia |
|
||||
| `RESIDENTIAL_TR` | Turkey |
|
||||
| `RESIDENTIAL_ISP` | ISP proxy |
|
||||
| `US-CA` | California, US |
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ Pass any of the following enum values to `proxy_location`. Each value pins the r
|
|||
| `RESIDENTIAL_NZ` | New Zealand |
|
||||
| `RESIDENTIAL_PH` | Philippines |
|
||||
| `RESIDENTIAL_KR` | South Korea |
|
||||
| `RESIDENTIAL_SA` | Saudi Arabia |
|
||||
| `RESIDENTIAL_TR` | Türkiye |
|
||||
| `RESIDENTIAL_ZA` | South Africa |
|
||||
| `NONE` | Disable proxy routing (traffic originates from Skyvern’s US datacenters) |
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ export const ProxyLocation = {
|
|||
ResidentialNL: "RESIDENTIAL_NL",
|
||||
ResidentialPH: "RESIDENTIAL_PH",
|
||||
ResidentialKR: "RESIDENTIAL_KR",
|
||||
ResidentialSA: "RESIDENTIAL_SA",
|
||||
ResidentialISP: "RESIDENTIAL_ISP",
|
||||
None: "NONE",
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ export const SUPPORTED_COUNTRY_CODES = [
|
|||
"NZ",
|
||||
"PH",
|
||||
"KR",
|
||||
"SA",
|
||||
"TR",
|
||||
"ZA",
|
||||
] as const;
|
||||
|
|
@ -44,6 +45,7 @@ export const COUNTRY_NAMES: Record<SupportedCountryCode, string> = {
|
|||
NZ: "New Zealand",
|
||||
PH: "Philippines",
|
||||
KR: "South Korea",
|
||||
SA: "Saudi Arabia",
|
||||
TR: "Turkey",
|
||||
ZA: "South Africa",
|
||||
};
|
||||
|
|
@ -67,6 +69,7 @@ export const COUNTRY_FLAGS: Record<SupportedCountryCode, string> = {
|
|||
NZ: "🇳🇿",
|
||||
PH: "🇵🇭",
|
||||
KR: "🇰🇷",
|
||||
SA: "🇸🇦",
|
||||
TR: "🇹🇷",
|
||||
ZA: "🇿🇦",
|
||||
};
|
||||
|
|
@ -92,6 +95,7 @@ const PROXY_LOCATION_TO_COUNTRY: Record<string, string> = {
|
|||
[ProxyLocation.ResidentialNZ]: "NZ",
|
||||
[ProxyLocation.ResidentialPH]: "PH",
|
||||
[ProxyLocation.ResidentialKR]: "KR",
|
||||
[ProxyLocation.ResidentialSA]: "SA",
|
||||
[ProxyLocation.ResidentialTR]: "TR",
|
||||
[ProxyLocation.ResidentialZA]: "ZA",
|
||||
};
|
||||
|
|
@ -116,6 +120,7 @@ const COUNTRY_TO_PROXY_LOCATION: Record<string, ProxyLocation> = {
|
|||
NZ: ProxyLocation.ResidentialNZ,
|
||||
PH: ProxyLocation.ResidentialPH,
|
||||
KR: ProxyLocation.ResidentialKR,
|
||||
SA: ProxyLocation.ResidentialSA,
|
||||
TR: ProxyLocation.ResidentialTR,
|
||||
ZA: ProxyLocation.ResidentialZA,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ ProxyLocation = typing.Union[
|
|||
"RESIDENTIAL_NL",
|
||||
"RESIDENTIAL_PH",
|
||||
"RESIDENTIAL_KR",
|
||||
"RESIDENTIAL_SA",
|
||||
"RESIDENTIAL_ISP",
|
||||
"NONE",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -131,6 +131,24 @@ if settings.ENABLE_OPENAI:
|
|||
reasoning_effort=settings.GPT5_REASONING_EFFORT,
|
||||
),
|
||||
)
|
||||
LLMConfigRegistry.register_config(
|
||||
"OPENAI_GPT5_NANO_FLEX",
|
||||
LLMConfig(
|
||||
"gpt-5-nano-2025-08-07",
|
||||
["OPENAI_API_KEY"],
|
||||
supports_vision=True,
|
||||
add_assistant_prefix=False,
|
||||
max_completion_tokens=128000,
|
||||
temperature=1, # GPT-5 only supports temperature=1
|
||||
reasoning_effort=settings.GPT5_REASONING_EFFORT,
|
||||
litellm_params=LiteLLMParams(
|
||||
api_key=settings.OPENAI_API_KEY,
|
||||
model_info={"model_name": "gpt-5-nano-2025-08-07"},
|
||||
service_tier="flex",
|
||||
timeout=900.0,
|
||||
),
|
||||
),
|
||||
)
|
||||
LLMConfigRegistry.register_config(
|
||||
"OPENAI_GPT5_1",
|
||||
LLMConfig(
|
||||
|
|
@ -167,6 +185,36 @@ if settings.ENABLE_OPENAI:
|
|||
reasoning_effort=settings.GPT5_REASONING_EFFORT,
|
||||
),
|
||||
)
|
||||
LLMConfigRegistry.register_config(
|
||||
"OPENAI_GPT5_4_NANO",
|
||||
LLMConfig(
|
||||
"gpt-5.4-nano",
|
||||
["OPENAI_API_KEY"],
|
||||
supports_vision=True,
|
||||
add_assistant_prefix=False,
|
||||
max_completion_tokens=128000,
|
||||
temperature=1, # GPT-5 only supports temperature=1
|
||||
reasoning_effort=settings.GPT5_REASONING_EFFORT,
|
||||
),
|
||||
)
|
||||
LLMConfigRegistry.register_config(
|
||||
"OPENAI_GPT5_4_NANO_FLEX",
|
||||
LLMConfig(
|
||||
"gpt-5.4-nano",
|
||||
["OPENAI_API_KEY"],
|
||||
supports_vision=True,
|
||||
add_assistant_prefix=False,
|
||||
max_completion_tokens=128000,
|
||||
temperature=1, # GPT-5 only supports temperature=1
|
||||
reasoning_effort=settings.GPT5_REASONING_EFFORT,
|
||||
litellm_params=LiteLLMParams(
|
||||
api_key=settings.OPENAI_API_KEY,
|
||||
model_info={"model_name": "gpt-5.4-nano"},
|
||||
service_tier="flex",
|
||||
timeout=900.0,
|
||||
),
|
||||
),
|
||||
)
|
||||
LLMConfigRegistry.register_config(
|
||||
"OPENAI_GPT4_TURBO",
|
||||
LLMConfig(
|
||||
|
|
@ -1609,7 +1657,7 @@ if settings.ENABLE_VERTEX_AI:
|
|||
},
|
||||
vertex_credentials=settings.VERTEX_CREDENTIALS,
|
||||
service_tier="SERVICE_TIER_FLEX",
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex"},
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex", "X-Vertex-AI-LLM-Request-Type": "shared"},
|
||||
timeout=900.0, # Vertex flex best-effort SLA upper bound (15 min)
|
||||
),
|
||||
),
|
||||
|
|
@ -1631,7 +1679,7 @@ if settings.ENABLE_VERTEX_AI:
|
|||
},
|
||||
vertex_credentials=settings.VERTEX_CREDENTIALS,
|
||||
service_tier="SERVICE_TIER_FLEX",
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex"},
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex", "X-Vertex-AI-LLM-Request-Type": "shared"},
|
||||
timeout=900.0, # Vertex flex best-effort SLA upper bound (15 min)
|
||||
),
|
||||
),
|
||||
|
|
@ -1653,7 +1701,7 @@ if settings.ENABLE_VERTEX_AI:
|
|||
},
|
||||
vertex_credentials=settings.VERTEX_CREDENTIALS,
|
||||
service_tier="SERVICE_TIER_FLEX",
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex"},
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex", "X-Vertex-AI-LLM-Request-Type": "shared"},
|
||||
timeout=900.0, # Vertex flex best-effort SLA upper bound (15 min)
|
||||
),
|
||||
),
|
||||
|
|
@ -1673,7 +1721,7 @@ if settings.ENABLE_VERTEX_AI:
|
|||
thinking_level="medium" if settings.GEMINI_INCLUDE_THOUGHT else "minimal",
|
||||
vertex_credentials=settings.VERTEX_CREDENTIALS,
|
||||
service_tier="SERVICE_TIER_FLEX",
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex"},
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex", "X-Vertex-AI-LLM-Request-Type": "shared"},
|
||||
timeout=900.0,
|
||||
),
|
||||
),
|
||||
|
|
@ -1692,7 +1740,7 @@ if settings.ENABLE_VERTEX_AI:
|
|||
thinking_level="medium" if settings.GEMINI_INCLUDE_THOUGHT else "minimal",
|
||||
vertex_credentials=settings.VERTEX_CREDENTIALS,
|
||||
service_tier="SERVICE_TIER_FLEX",
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex"},
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex", "X-Vertex-AI-LLM-Request-Type": "shared"},
|
||||
timeout=900.0,
|
||||
),
|
||||
),
|
||||
|
|
@ -1711,7 +1759,7 @@ if settings.ENABLE_VERTEX_AI:
|
|||
thinking_level="medium" if settings.GEMINI_INCLUDE_THOUGHT else "minimal",
|
||||
vertex_credentials=settings.VERTEX_CREDENTIALS,
|
||||
service_tier="SERVICE_TIER_FLEX",
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex"},
|
||||
extra_headers={"X-Vertex-AI-LLM-Shared-Request-Type": "flex", "X-Vertex-AI-LLM-Request-Type": "shared"},
|
||||
timeout=900.0,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ Available geotargeting options:
|
|||
- RESIDENTIAL_NZ: New Zealand
|
||||
- RESIDENTIAL_PH: Philippines
|
||||
- RESIDENTIAL_KR: South Korea
|
||||
- RESIDENTIAL_SA: Saudi Arabia
|
||||
- RESIDENTIAL_ZA: South Africa
|
||||
- RESIDENTIAL_AR: Argentina
|
||||
- RESIDENTIAL_AU: Australia
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class ProxyLocation(StrEnum):
|
|||
RESIDENTIAL_NL = "RESIDENTIAL_NL"
|
||||
RESIDENTIAL_PH = "RESIDENTIAL_PH"
|
||||
RESIDENTIAL_KR = "RESIDENTIAL_KR"
|
||||
RESIDENTIAL_SA = "RESIDENTIAL_SA"
|
||||
RESIDENTIAL_ISP = "RESIDENTIAL_ISP"
|
||||
NONE = "NONE"
|
||||
|
||||
|
|
@ -100,6 +101,7 @@ class ProxyLocation(StrEnum):
|
|||
cls.RESIDENTIAL_NL,
|
||||
cls.RESIDENTIAL_PH,
|
||||
cls.RESIDENTIAL_KR,
|
||||
cls.RESIDENTIAL_SA,
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
|
|
@ -125,6 +127,7 @@ class ProxyLocation(StrEnum):
|
|||
ProxyLocation.RESIDENTIAL_NL: 2000,
|
||||
ProxyLocation.RESIDENTIAL_PH: 2000,
|
||||
ProxyLocation.RESIDENTIAL_KR: 2000,
|
||||
ProxyLocation.RESIDENTIAL_SA: 2000,
|
||||
}
|
||||
return counts.get(proxy_location, 10000)
|
||||
|
||||
|
|
@ -151,6 +154,7 @@ class ProxyLocation(StrEnum):
|
|||
ProxyLocation.RESIDENTIAL_NL: "NL",
|
||||
ProxyLocation.RESIDENTIAL_PH: "PH",
|
||||
ProxyLocation.RESIDENTIAL_KR: "KR",
|
||||
ProxyLocation.RESIDENTIAL_SA: "SA",
|
||||
}
|
||||
return mapping.get(proxy_location, "US")
|
||||
|
||||
|
|
@ -176,6 +180,7 @@ SUPPORTED_GEO_COUNTRIES = frozenset(
|
|||
"NZ",
|
||||
"PH",
|
||||
"KR",
|
||||
"SA",
|
||||
"TR",
|
||||
"ZA",
|
||||
}
|
||||
|
|
@ -324,6 +329,9 @@ def get_tzinfo_from_proxy(proxy_location: ProxyLocation) -> ZoneInfo | None:
|
|||
if proxy_location == ProxyLocation.RESIDENTIAL_KR:
|
||||
return ZoneInfo("Asia/Seoul")
|
||||
|
||||
if proxy_location == ProxyLocation.RESIDENTIAL_SA:
|
||||
return ZoneInfo("Asia/Riyadh")
|
||||
|
||||
if proxy_location == ProxyLocation.RESIDENTIAL_ISP:
|
||||
return ZoneInfo("America/New_York")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue