MCPcopy Create free account
hub / github.com/Nativu5/Gemini-FastAPI / GeminiModelConfig

Class GeminiModelConfig

app/utils/config.py:56–72  ·  view source on GitHub ↗

Configuration for a custom Gemini model.

Source from the content-addressed store, hash-verified

54
55
56class GeminiModelConfig(BaseModel):
57 """Configuration for a custom Gemini model."""
58
59 model_name: str | None = Field(default=None, description="Name of the model")
60 model_header: dict[str, str | None] | None = Field(
61 default=None, description="Header for the model"
62 )
63
64 @field_validator("model_header", mode="before")
65 @classmethod
66 def _parse_json_string(cls, v: Any) -> Any:
67 if isinstance(v, str) and v.strip().startswith("{"):
68 try:
69 return orjson.loads(v)
70 except orjson.JSONDecodeError:
71 return v
72 return v
73
74
75class OversizedContextStrategy(StrEnum):

Callers 1

_merge_models_with_envFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected