| 2755 | |
| 2756 | |
| 2757 | class 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 | |
| 2773 | class ChatCompletionToolFunction(BaseModel): |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…