main
1# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3from typing import Optional
4
5from ..._models import BaseModel
6from .function_parameters import FunctionParameters
7
8__all__ = ["FunctionDefinition"]
9
10
11class FunctionDefinition(BaseModel):
12 name: str
13 """The name of the function to be called.
14
15 Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length
16 of 64.
17 """
18
19 description: Optional[str] = None
20 """
21 A description of what the function does, used by the model to choose when and
22 how to call the function.
23 """
24
25 parameters: Optional[FunctionParameters] = None
26 """The parameters the functions accepts, described as a JSON Schema object.
27
28 See the [guide](https://platform.openai.com/docs/guides/function-calling) for
29 examples, and the
30 [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
31 documentation about the format.
32
33 Omitting `parameters` defines a function with an empty parameter list.
34 """
35
36 strict: Optional[bool] = None
37 """Whether to enable strict schema adherence when generating the function call.
38
39 If set to true, the model will follow the exact schema defined in the
40 `parameters` field. Only a subset of JSON Schema is supported when `strict` is
41 `true`. Learn more about Structured Outputs in the
42 [function calling guide](https://platform.openai.com/docs/guides/function-calling).
43 """