@@ -19,20 +19,24 @@ object CreateChatToolCompletion extends Example {
19
19
FunctionTool (
20
20
name = " get_current_weather" ,
21
21
description = Some (" Get the current weather in a given location" ),
22
- parameters = Json .toJson(
23
- JsonSchema .Object (
24
- properties = Seq (
25
- " location" -> JsonSchema .String (
26
- description = Some (" The city and state, e.g. San Francisco, CA" )
22
+ parameters = Json
23
+ .toJson(
24
+ JsonSchema .Object (
25
+ properties = Seq (
26
+ " location" -> JsonSchema .String (
27
+ description = Some (" The city and state, e.g. San Francisco, CA" )
28
+ ),
29
+ " unit" -> JsonSchema .String (
30
+ description = Some (" The unit of temperature" ),
31
+ `enum` = Seq (" celsius" , " fahrenheit" )
32
+ )
27
33
),
28
- " unit" -> JsonSchema .String (
29
- description = Some (" The unit of temperature" ),
30
- `enum` = Seq (" celsius" , " fahrenheit" )
31
- )
32
- ),
33
- required = Seq (" location" )
34
- ): JsonSchema
35
- ).as[JsObject ].value.toMap
34
+ required = Seq (" location" )
35
+ ): JsonSchema
36
+ )
37
+ .as[JsObject ]
38
+ .value
39
+ .toMap
36
40
)
37
41
)
38
42
@@ -45,7 +49,7 @@ object CreateChatToolCompletion extends Example {
45
49
settings = CreateChatCompletionSettings (
46
50
ModelId .gpt_3_5_turbo_1106,
47
51
parallel_tool_calls = Some (true )
48
- ),
52
+ )
49
53
)
50
54
.map { response =>
51
55
val chatFunCompletionMessage = response.choices.head.message
0 commit comments