Skip to content

Commit 2b61a69

Browse files
committed
GH-4213: Re-enable Groq API integration tests
Fixes GH-4213 (#4213) * re-enable Groq API tests in OpenAiCompatibleChatModelIT * update comment to reflect current API status * confirm API is operational via HTTP 401 response Signed-off-by: Hyeri1ee <[email protected]>
1 parent e71da4e commit 2b61a69

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

models/spring-ai-openai/src/test/java/org/springframework/ai/openai/chat/OpenAiCompatibleChatModelIT.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@
3434
import org.springframework.ai.chat.model.Generation;
3535
import org.springframework.ai.chat.model.StreamingChatModel;
3636
import org.springframework.ai.chat.prompt.Prompt;
37+
import org.springframework.ai.model.tool.ToolCallingManager;
3738
import org.springframework.ai.openai.OpenAiChatModel;
3839
import org.springframework.ai.openai.OpenAiChatOptions;
3940
import org.springframework.ai.openai.api.OpenAiApi;
41+
import org.springframework.retry.support.RetryTemplate;
42+
import org.springframework.retry.support.RetryTemplateBuilder;
4043

4144
import 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

Comments
 (0)