Skip to content

Commit b032246

Browse files
committed
Formatting
1 parent da4c09e commit b032246

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

openai-core/src/main/scala/io/cequence/openaiscala/OpenAIScalaClientException.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ object Retryable {
1515
case _: OpenAIScalaUnauthorizedException => false
1616

1717
// we retry on these
18-
case _: OpenAIScalaClientTimeoutException => true
19-
case _: OpenAIScalaRateLimitException => true
20-
case _: OpenAIScalaServerErrorException => true
21-
case _: OpenAIScalaEngineOverloadedException => true
18+
case _: OpenAIScalaClientTimeoutException => true
19+
case _: OpenAIScalaRateLimitException => true
20+
case _: OpenAIScalaServerErrorException => true
21+
case _: OpenAIScalaEngineOverloadedException => true
2222
// generic case
23-
case _: OpenAIScalaClientException => true
23+
case _: OpenAIScalaClientException => true
2424
}
2525
}
2626

openai-core/src/main/scala/io/cequence/openaiscala/service/OpenAIChatCompletionExtra.scala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ object OpenAIChatCompletionExtra {
4545
)(
4646
implicit ec: ExecutionContext,
4747
scheduler: Scheduler
48-
): Future[ChatCompletionResponse] =
48+
): Future[ChatCompletionResponse] =
4949
createChatCompletionWithFailoverSettings(
5050
messages,
5151
settings,
@@ -172,11 +172,13 @@ object OpenAIChatCompletionExtra {
172172
s"${taskNameForLoggingFinal.capitalize} finished in " + (new java.util.Date().getTime - start.getTime) + " ms."
173173
)
174174

175-
json.asOpt[T].getOrElse(
176-
throw new OpenAIScalaClientException(
177-
s"Failed to parse JSON response into the expected type. Response: $contentJson"
175+
json
176+
.asOpt[T]
177+
.getOrElse(
178+
throw new OpenAIScalaClientException(
179+
s"Failed to parse JSON response into the expected type. Response: $contentJson"
180+
)
178181
)
179-
)
180182
}
181183
}
182184

0 commit comments

Comments
 (0)