MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / ChatCompletionResponseFormatJsonSchema

Class ChatCompletionResponseFormatJsonSchema

examples/server/server.py:2827–2845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2825
2826
2827class ChatCompletionResponseFormatJsonSchema(BaseModel):
2828 model_config = ConfigDict(extra="ignore", populate_by_name=True)
2829
2830 name: Optional[str] = None
2831 description: Optional[str] = None
2832 schema_: Optional[Dict[str, Any]] = Field(default=None, alias="schema")
2833 strict: Optional[bool] = None
2834
2835 def to_template_json_schema(self) -> ChatTemplateResponseFormatJsonSchema:
2836 json_schema: ChatTemplateResponseFormatJsonSchema = {}
2837 if self.name is not None:
2838 json_schema["name"] = self.name
2839 if self.description is not None:
2840 json_schema["description"] = self.description
2841 if self.schema_ is not None:
2842 json_schema["schema"] = self.schema_
2843 if self.strict is not None:
2844 json_schema["strict"] = self.strict
2845 return json_schema
2846
2847
2848class ChatCompletionResponseFormat(BaseModel):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…