3434import org .springframework .ai .chat .model .Generation ;
3535import org .springframework .ai .chat .model .StreamingChatModel ;
3636import org .springframework .ai .chat .prompt .Prompt ;
37+ import org .springframework .ai .model .tool .ToolCallingManager ;
3738import org .springframework .ai .openai .OpenAiChatModel ;
3839import org .springframework .ai .openai .OpenAiChatOptions ;
3940import org .springframework .ai .openai .api .OpenAiApi ;
41+ import org .springframework .retry .support .RetryTemplate ;
42+ import org .springframework .retry .support .RetryTemplateBuilder ;
4043
4144import static org .assertj .core .api .Assertions .assertThat ;
4245
@@ -60,13 +63,15 @@ static Stream<ChatModel> openAiCompatibleApis() {
6063 .defaultOptions (forModelName ("gpt-3.5-turbo" ))
6164 .build ());
6265
63- // (26.01.2025) Disable because the Groq API is down. TODO: Re-enable when the API
64- // is back up.
65- // if (System.getenv("GROQ_API_KEY") != null) {
66- // builder.add(new OpenAiChatModel(new OpenAiApi("https://api.groq.com/openai",
67- // System.getenv("GROQ_API_KEY")),
68- // forModelName("llama3-8b-8192")));
69- // }
66+ if (System .getenv ("GROQ_API_KEY" ) != null ) {
67+ builder .add (OpenAiChatModel .builder ()
68+ .openAiApi (OpenAiApi .builder ()
69+ .baseUrl ("https://api.groq.com/openai" )
70+ .apiKey (System .getenv ("GROQ_API_KEY" ))
71+ .build ())
72+ .defaultOptions (forModelName ("llama3-8b-8192" ))
73+ .build ());
74+ }
7075
7176 if (System .getenv ("OPEN_ROUTER_API_KEY" ) != null ) {
7277 builder .add (OpenAiChatModel .builder ()
0 commit comments