Skip to content

Commit f970f45

Browse files
committed
fix typos in VertexAiGeminiChatModel class
Signed-off-by: jitokim <[email protected]>
1 parent e5410d7 commit f970f45

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

models/spring-ai-vertex-ai-gemini/src/main/java/org/springframework/ai/vertexai/gemini/VertexAiGeminiChatModel.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
* @author Chris Turchin
9393
* @author Mark Pollack
9494
* @author Soby Chacko
95+
* @author Jihoon Kim
9596
* @since 0.8.1
9697
*/
9798
public class VertexAiGeminiChatModel extends AbstractToolCallSupport implements ChatModel, DisposableBean {
@@ -304,7 +305,7 @@ public ChatResponse call(Prompt prompt) {
304305

305306
List<Generation> generations = generateContentResponse.getCandidatesList()
306307
.stream()
307-
.map(this::responseCandiateToGeneration)
308+
.map(this::responseCandidateToGeneration)
308309
.flatMap(List::stream)
309310
.toList();
310311

@@ -352,7 +353,7 @@ public Flux<ChatResponse> stream(Prompt prompt) {
352353

353354
List<Generation> generations = response.getCandidatesList()
354355
.stream()
355-
.map(this::responseCandiateToGeneration)
356+
.map(this::responseCandidateToGeneration)
356357
.flatMap(List::stream)
357358
.toList();
358359

@@ -380,21 +381,20 @@ public Flux<ChatResponse> stream(Prompt prompt) {
380381
});
381382
}
382383

383-
protected List<Generation> responseCandiateToGeneration(Candidate candidate) {
384+
protected List<Generation> responseCandidateToGeneration(Candidate candidate) {
384385

385386
// TODO - The candidateIndex (e.g. choice must be asigned to the generation).
386387
int candidateIndex = candidate.getIndex();
387-
FinishReason candidateFinishReasonn = candidate.getFinishReason();
388+
FinishReason candidateFinishReason = candidate.getFinishReason();
388389

389390
Map<String, Object> messageMetadata = Map.of("candidateIndex", candidateIndex, "finishReason",
390-
candidateFinishReasonn);
391+
candidateFinishReason);
391392

392-
ChatGenerationMetadata chatGenerationMetadata = ChatGenerationMetadata.from(candidateFinishReasonn.name(),
393-
null);
393+
ChatGenerationMetadata chatGenerationMetadata = ChatGenerationMetadata.from(candidateFinishReason.name(), null);
394394

395-
boolean isFunctinCall = candidate.getContent().getPartsList().stream().allMatch(Part::hasFunctionCall);
395+
boolean isFunctionCall = candidate.getContent().getPartsList().stream().allMatch(Part::hasFunctionCall);
396396

397-
if (isFunctinCall) {
397+
if (isFunctionCall) {
398398
List<AssistantMessage.ToolCall> assistantToolCalls = candidate.getContent()
399399
.getPartsList()
400400
.stream()

0 commit comments

Comments
 (0)