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

Class ChatCompletionFunctionDefinition

examples/server/server.py:2757–2770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2755
2756
2757class ChatCompletionFunctionDefinition(BaseModel):
2758 model_config = ConfigDict(extra="ignore")
2759
2760 name: str
2761 description: Optional[str] = None
2762 parameters: Optional[Dict[str, Any]] = None
2763
2764 def to_template_function(self) -> ChatTemplateFunctionDefinition:
2765 function: ChatTemplateFunctionDefinition = {"name": self.name}
2766 if self.description is not None:
2767 function["description"] = self.description
2768 if self.parameters is not None:
2769 function["parameters"] = self.parameters
2770 return function
2771
2772
2773class ChatCompletionToolFunction(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…