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

Method _parse_json_string

app/utils/config.py:66–72  ·  view source on GitHub ↗
(cls, v: Any)

Source from the content-addressed store, hash-verified

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

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected