Skip to content

Commit 253c167

Browse files
committed
Formatting
1 parent dcb109c commit 253c167

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

openai-examples/src/main/scala/io/cequence/openaiscala/examples/CreateChatToolCompletion.scala

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,24 @@ object CreateChatToolCompletion extends Example {
1919
FunctionTool(
2020
name = "get_current_weather",
2121
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+
)
2733
),
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
3640
)
3741
)
3842

@@ -45,7 +49,7 @@ object CreateChatToolCompletion extends Example {
4549
settings = CreateChatCompletionSettings(
4650
ModelId.gpt_3_5_turbo_1106,
4751
parallel_tool_calls = Some(true)
48-
),
52+
)
4953
)
5054
.map { response =>
5155
val chatFunCompletionMessage = response.choices.head.message

0 commit comments

Comments
 (0)