V 2.0.0 - Universal api #15 - Imagen
This commit is contained in:
@@ -19,11 +19,11 @@ def _canonical_param_name(name: str) -> str:
|
||||
def _default_value(name: str) -> Any:
|
||||
k = name.lower()
|
||||
if "prompt" in k:
|
||||
return "default prompt"
|
||||
return "cute cat walking in the futuristic metropolis"
|
||||
if "response_modalities" in k:
|
||||
return "IMAGE"
|
||||
if "model" in k:
|
||||
return "gemini-3-pro-image-preview"
|
||||
return "valid-model-name"
|
||||
if "aspect_ratio" in k:
|
||||
return "1:1"
|
||||
if "resolution" in k:
|
||||
|
||||
@@ -9,14 +9,6 @@ def _is_service_schema(node: Any) -> bool:
|
||||
|
||||
|
||||
def normalize_registry(raw: dict[str, Any] | None) -> dict[str, dict[str, dict[str, Any]]]:
|
||||
"""Normalize API schema JSON to provider->service->schema mapping.
|
||||
|
||||
Supports legacy single-schema format:
|
||||
{"provider": "Gemini", "request": {...}}
|
||||
|
||||
And new grouped format:
|
||||
{"Gemini": {"Text2Image Nanobanana": {"provider": "Gemini", "service": "...", "request": {...}}}}
|
||||
"""
|
||||
if not isinstance(raw, dict):
|
||||
return {}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"provider": "Gemini",
|
||||
"service": "Nanobanana",
|
||||
"possible_parameters": {
|
||||
"aspect_ratio": ["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"],
|
||||
"resolution": [
|
||||
"1K",
|
||||
"2K",
|
||||
@@ -50,6 +51,7 @@
|
||||
"provider": "Gemini",
|
||||
"service": "VEO",
|
||||
"possible_parameters": {
|
||||
"aspectRatio": ["9:16", "16:9"],
|
||||
"durationSeconds": [
|
||||
"4",
|
||||
"6",
|
||||
@@ -103,6 +105,7 @@
|
||||
"provider": "Gemini",
|
||||
"service": "Imagen",
|
||||
"possible_parameters": {
|
||||
"aspect_ratio": ["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"],
|
||||
"resolution": [
|
||||
"1K",
|
||||
"2K"
|
||||
|
||||
@@ -23,7 +23,7 @@ DEFAULT_SERVICE = ""
|
||||
PLACEHOLDER_RE = re.compile(r"\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}")
|
||||
|
||||
KNOWN_PARAM_OPTIONS: dict[str, list[str]] = {
|
||||
"model": ["gemini-3-pro-image-preview", "gemini-2.5-flash-image"],
|
||||
"model": ["example-model-1", "example-model-2"],
|
||||
"resolution": ["1K", "2K", "4K"],
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user