Steps to reproduce
Run this test in the https://github.com/rd-1-2022/ai-openai-helloworld project. To try out the behavior in presence of an error, you may provide the wrong api key.
@SpringBootTest(classes = OpenAiAutoConfiguration.class)
public class OpenAiCallTest {
@Autowired
OpenAiChatModel openAiChatModel;
@Test
public void test(){
System.out.println(openAiChatModel.stream(
new Prompt(
"Generate the names of 5 famous pirates.",
OpenAiChatOptions.builder()
.withModel("gpt-3.5-turbo")
.withTemperature(0.4F)
.build()
)).collectList().block());
}
}
Expected behavior
There should be a working retry mechanism for calls to the WebClient
Bug description The OpenAiChatModel method stream calls the chatCompletionStream inside the execute of the RetryTemplate:
However, the retry template does nothing, as the return object is a FluxMap: no error ever arises at this point
Environment I tried this out on the https://github.com/rd-1-2022/ai-openai-helloworld project
Steps to reproduce Run this test in the https://github.com/rd-1-2022/ai-openai-helloworld project. To try out the behavior in presence of an error, you may provide the wrong api key. @SpringBootTest(classes = OpenAiAutoConfiguration.class) public class OpenAiCallTest {
}
Expected behavior There should be a working retry mechanism for calls to the WebClient