Fix tools test configuration

This commit is contained in:
Christian Tzolov
2025-01-26 07:28:51 +01:00
parent e7d6413411
commit 39be9aeba2
2 changed files with 12 additions and 5 deletions

View File

@@ -57,10 +57,13 @@ public class OpenAiCompatibleChatModelIT {
builder.add(new OpenAiChatModel(new OpenAiApi(System.getenv("OPENAI_API_KEY")), forModelName("gpt-3.5-turbo")));
if (System.getenv("GROQ_API_KEY") != null) {
builder.add(new OpenAiChatModel(new OpenAiApi("https://api.groq.com/openai", System.getenv("GROQ_API_KEY")),
forModelName("llama3-8b-8192")));
}
// (26.01.2025) Disable because the Groq API is down. TODO: Re-enable when the API
// is back up.
// if (System.getenv("GROQ_API_KEY") != null) {
// builder.add(new OpenAiChatModel(new OpenAiApi("https://api.groq.com/openai",
// System.getenv("GROQ_API_KEY")),
// forModelName("llama3-8b-8192")));
// }
if (System.getenv("OPEN_ROUTER_API_KEY") != null) {
builder.add(new OpenAiChatModel(

View File

@@ -138,7 +138,11 @@ public class FunctionCallbackInPrompt2IT {
// @formatter:off
String content = ChatClient.builder(chatModel).build().prompt()
.user("What's the weather like in San Francisco, Tokyo, and Paris?")
.functions(FunctionCallback.builder().function("CurrentWeatherService", new MockWeatherService()).description("Get the weather in location").build())
.functions(FunctionCallback.builder()
.function("CurrentWeatherService", new MockWeatherService())
.description("Get the weather in location")
.inputType(MockWeatherService.Request.class)
.build())
.stream().content()
.collectList().block().stream().collect(Collectors.joining());
// @formatter:on