diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/aimetadata.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/aimetadata.adoc index 817ab1d2f..6ab4d105f 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/aimetadata.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/aimetadata.adoc @@ -42,7 +42,7 @@ class MyService { Prompt prompt = createPrompt(request); - ChatResponse response = chatClient.generate(prompt); + ChatResponse response = chatClient.call(prompt); // Process the chat response diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/openai-chat-functions.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/openai-chat-functions.adoc index 4eb5cdb01..2c54d7190 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/openai-chat-functions.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/functions/openai-chat-functions.adoc @@ -152,7 +152,7 @@ OpenAiChatClient chatClient = ... UserMessage userMessage = new UserMessage("What's the weather like in San Francisco, Tokyo, and Paris?"); ChatResponse response = chatClient.call(new Prompt(List.of(userMessage), - OpenAiChatOptions.builder().withEnabledFunction("CurrentWeather").build())); // (1) Enable the function + OpenAiChatOptions.builder().withFunction("CurrentWeather").build())); // (1) Enable the function logger.info("Response: {}", response); ---- @@ -218,7 +218,7 @@ The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-spring-boot // UserMessage userMessage = new UserMessage("What's the weather like in San Francisco, Tokyo, and Paris?"); // // ChatResponse response = chatClient.call(new Prompt(List.of(userMessage), -// OpenAiChatOptions.builder().withEnabledFunction("CurrentWeather").build())); // Enable the function +// OpenAiChatOptions.builder().withFunction("CurrentWeather").build())); // Enable the function // ---- // // NOTE: Functions are registered when OpenAiChatClient is created, by you must enable in the Prompt the functions to be used in the request. diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/huggingface.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/huggingface.adoc index 0783365d6..3d07d1a28 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/huggingface.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/clients/huggingface.adoc @@ -37,7 +37,7 @@ You can find this on the Inference Endpoint's UI link:https://ui.endpoints.huggi ---- HuggingfaceChatClient client = new HuggingfaceChatClient(apiKey, basePath); Prompt prompt = new Prompt("Your text here..."); -ChatResponse response = client.generate(prompt); +ChatResponse response = client.call(prompt); System.out.println(response.getGeneration().getText()); ---- @@ -55,7 +55,7 @@ String mistral7bInstruct = """ Just generate the JSON object without explanations: [/INST]"""; Prompt prompt = new Prompt(mistral7bInstruct); -ChatResponse aiResponse = huggingfaceChatClient.generate(prompt); +ChatResponse aiResponse = huggingfaceChatClient.call(prompt); System.out.println(response.getGeneration().getText()); ---- Will produce the output