File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chat Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ ChatResponse response = chatModel.call(
8787 new Prompt(
8888 "Generate the names of 5 famous pirates.",
8989 WatsonxAiChatOptions.builder()
90- .withTemperature (0.4)
90+ .temperature (0.4)
9191 .build()
9292 ));
9393----
@@ -112,10 +112,11 @@ public class MyClass {
112112
113113 public String generate(String userInput) {
114114
115- WatsonxAiOptions options = WatsonxAiOptions.create()
116- .withModel(MODEL)
117- .withDecodingMethod("sample")
118- .withRandomSeed(1);
115+ WatsonxAiChatOptions options = WatsonxAiChatOptions.builder()
116+ .model(MODEL)
117+ .decodingMethod("sample")
118+ .randomSeed(1)
119+ .build();
119120
120121 Prompt prompt = new Prompt(new SystemMessage(userInput), options);
121122
@@ -128,10 +129,11 @@ public class MyClass {
128129
129130 public String generateStream(String userInput) {
130131
131- WatsonxAiOptions options = WatsonxAiOptions.create()
132- .withModel(MODEL)
133- .withDecodingMethod("greedy")
134- .withRandomSeed(2);
132+ WatsonxAiChatOptions options = WatsonxAiChatOptions.builder()
133+ .model(MODEL)
134+ .decodingMethod("greedy")
135+ .randomSeed(2)
136+ .build();
135137
136138 Prompt prompt = new Prompt(new SystemMessage(userInput), options);
137139
You can’t perform that action at this time.
0 commit comments