@@ -15,11 +15,6 @@ public data class Tool(
15
15
*/
16
16
@SerialName(" type" ) val type : ToolType ,
17
17
18
- /* *
19
- * Tool description.
20
- */
21
- @SerialName(" description" ) val description : String? = null ,
22
-
23
18
/* *
24
19
* A description of what the function does, used by the model to choose when and how to call the function.
25
20
*/
@@ -38,8 +33,7 @@ public data class Tool(
38
33
public fun function (name : String , description : String? = null, parameters : Parameters ): Tool =
39
34
Tool (
40
35
type = ToolType .Function ,
41
- description = description,
42
- function = FunctionTool (name = name, parameters = parameters)
36
+ function = FunctionTool (name = name, description = description, parameters = parameters)
43
37
)
44
38
}
45
39
}
@@ -56,12 +50,17 @@ public data class FunctionTool(
56
50
@SerialName(" name" ) val name : String ,
57
51
58
52
/* *
59
- * The parameters the function accepts , described as a JSON Schema object.
60
- * See the [guide](https://github. com/aallam/openai-kotlin/blob/main/ guides/ChatToolCalls.md ) for examples,
61
- * and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/ ) for documentation about
53
+ * The parameters the functions accept , described as a JSON Schema object.
54
+ * See the [guide](https://platform.openai. com/docs/ guides/text-generation/function-calling ) for examples,
55
+ * and the [JSON Schema reference](https://json-schema.org/understanding-json-schema) for documentation about
62
56
* the format.
63
57
*
64
- * To describe a function that accepts no parameters, provide [Parameters.Empty]`.
58
+ * Omitting `parameters` defines a function with an empty parameter list.
59
+ */
60
+ @SerialName(" parameters" ) val parameters : Parameters ? = null ,
61
+
62
+ /* *
63
+ * A description of what the function does, used by the model to choose when and how to call the function.
65
64
*/
66
- @SerialName(" parameters " ) val parameters : Parameters
65
+ @SerialName(" description " ) public val description : String? = null
67
66
)
0 commit comments