Skip to content

Commit a76fe82

Browse files
committed
chore: Modify // @formatter label position and add a blank line to the file
Signed-off-by: shown <[email protected]>
1 parent 384478e commit a76fe82

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai/ZhiPuAiChatModel.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ public ChatResponse call(Prompt prompt) {
244244
.provider(ZhiPuApiConstants.PROVIDER_NAME)
245245
.build();
246246

247+
// @formatter:off
247248
ChatResponse response = ChatModelObservationDocumentation.CHAT_MODEL_OPERATION
248249
.observation(this.observationConvention, DEFAULT_OBSERVATION_CONVENTION, () -> observationContext,
249250
this.observationRegistry)
@@ -262,13 +263,11 @@ public ChatResponse call(Prompt prompt) {
262263
List<Choice> choices = chatCompletion.choices();
263264

264265
List<Generation> generations = choices.stream().map(choice -> {
265-
// @formatter:off
266266
Map<String, Object> metadata = Map.of(
267267
"id", chatCompletion.id(),
268268
"role", choice.message().role() != null ? choice.message().role().name() : "",
269269
"finishReason", choice.finishReason() != null ? choice.finishReason().name() : ""
270270
);
271-
// @formatter:on
272271
return buildGeneration(choice, metadata);
273272
}).toList();
274273

@@ -278,6 +277,7 @@ public ChatResponse call(Prompt prompt) {
278277

279278
return chatResponse;
280279
});
280+
// @formatter:on
281281
if (this.toolExecutionEligibilityPredicate.isToolExecutionRequired(requestPrompt.getOptions(), response)) {
282282
var toolExecutionResult = this.toolCallingManager.executeToolCalls(requestPrompt, response);
283283
if (toolExecutionResult.returnDirect()) {
@@ -326,12 +326,13 @@ public Flux<ChatResponse> stream(Prompt prompt) {
326326

327327
observation.parentObservation(contextView.getOrDefault(ObservationThreadLocalAccessor.KEY, null)).start();
328328

329+
// @formatter:off
329330
Flux<ChatResponse> chatResponse = completionChunks.map(this::chunkToChatCompletion)
330331
.switchMap(chatCompletion -> Mono.just(chatCompletion).map(chatCompletion2 -> {
331332
try {
332333
String id = chatCompletion2.id();
333334

334-
// @formatter:off
335+
335336
List<Generation> generations = chatCompletion2.choices().stream().map(choice -> {
336337
if (choice.message().role() != null) {
337338
roleMap.putIfAbsent(id, choice.message().role().name());
@@ -353,8 +354,7 @@ public Flux<ChatResponse> stream(Prompt prompt) {
353354
}
354355

355356
}));
356-
357-
// @formatter:off
357+
358358
Flux<ChatResponse> flux = chatResponse.flatMap(response -> {
359359
if (this.toolExecutionEligibilityPredicate.isToolExecutionRequired(requestPrompt.getOptions(), response)) {
360360
return Flux.defer(() -> {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
org.springframework.aot.hint.RuntimeHintsRegistrar=\
2-
org.springframework.ai.zhipuai.aot.ZhiPuAiRuntimeHints
2+
org.springframework.ai.zhipuai.aot.ZhiPuAiRuntimeHints
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
You are an AI assistant that helps people find information.
22
Your name is {name}.
3-
You should reply to the user's request with your name and also in the style of a {voice}.
3+
You should reply to the user's request with your name and also in the style of a {voice}.

0 commit comments

Comments
 (0)