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

Method normalize_role

app/models/models.py:34–38  ·  view source on GitHub ↗

Normalize 'developer' role to 'system' for Gemini compatibility.

(self)

Source from the content-addressed store, hash-verified

32
33 @model_validator(mode="after")
34 def normalize_role(self) -> Message:
35 """Normalize 'developer' role to 'system' for Gemini compatibility."""
36 if self.role == "developer":
37 self.role = "system"
38 return self
39
40
41class Choice(BaseModel):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected