Skip to content

Commit a222ccb

Browse files
author
Milder Hernandez Cagua
committed
Fix retry logic
1 parent 8cd72af commit a222ccb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aiservices/openai/src/main/java/com/microsoft/semantickernel/aiservices/openai/chatcompletion/OpenAIChatCompletion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ private Mono<ChatMessages> internalChatMessageContentsAsync(
526526
LOGGER.warn("Tool invocation attempt failed: ", e);
527527

528528
// If FunctionInvocationError occurred and there are still attempts left, retry, else exit
529-
if (requestIndex > 0) {
529+
if (requestIndex < MAXIMUM_INFLIGHT_AUTO_INVOKES) {
530530
ChatMessages currentMessages = messages;
531531
if (e instanceof FunctionInvocationError) {
532532
currentMessages.assertCommonHistory(

0 commit comments

Comments
 (0)