Skip to content

Commit 84cae93

Browse files
committed
update to latest Spring AI implementation
1 parent 1f65921 commit 84cae93

File tree

9 files changed

+155
-190
lines changed

9 files changed

+155
-190
lines changed

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.github.alexcheng1982</groupId>
99
<artifactId>spring-ai-dashscope-client-parent</artifactId>
10-
<version>1.2.0</version>
10+
<version>1.2.1</version>
1111
</parent>
1212
<artifactId>spring-ai-dashscope-client</artifactId>
1313
<packaging>jar</packaging>

client/src/main/java/io/github/alexcheng1982/springai/dashscope/DashscopeChatModel.java

Lines changed: 123 additions & 148 deletions
Large diffs are not rendered by default.

client/src/main/java/io/github/alexcheng1982/springai/dashscope/DashscopeChatOptions.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public String getModel() {
4646
return model;
4747
}
4848

49+
@Override
50+
public Float getFrequencyPenalty() {
51+
return repetitionPenalty;
52+
}
53+
4954
public void setModel(String model) {
5055
this.model = model;
5156
}
@@ -98,6 +103,16 @@ public Integer getMaxTokens() {
98103
return maxTokens;
99104
}
100105

106+
@Override
107+
public Float getPresencePenalty() {
108+
return null;
109+
}
110+
111+
@Override
112+
public List<String> getStopSequences() {
113+
return stops;
114+
}
115+
101116
public void setMaxTokens(Integer maxTokens) {
102117
this.maxTokens = maxTokens;
103118
}
@@ -120,6 +135,11 @@ public Float getTopP() {
120135
return this.topP;
121136
}
122137

138+
@Override
139+
public ChatOptions copy() {
140+
return createCopy();
141+
}
142+
123143
@Override
124144
public Integer getTopK() {
125145
return this.topK;

client/src/main/java/io/github/alexcheng1982/springai/dashscope/DashscopeEmbeddingOptions.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ public String getModel() {
1616
return model;
1717
}
1818

19+
@Override
20+
public Integer getDimensions() {
21+
return null;
22+
}
23+
1924
public void setModel(String model) {
2025
this.model = model;
2126
}

client/src/main/java/io/github/alexcheng1982/springai/dashscope/metadata/DashscopeChatResponseMetadata.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

client/src/test/java/io/github/alexcheng1982/springai/dashscope/DashscopeChatModelTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import java.net.URI;
99
import java.util.List;
1010
import org.junit.jupiter.api.Test;
11-
import org.springframework.ai.chat.messages.Media;
1211
import org.springframework.ai.chat.messages.UserMessage;
1312
import org.springframework.ai.chat.prompt.Prompt;
13+
import org.springframework.ai.model.Media;
1414
import org.springframework.util.MimeType;
1515

1616
/**
@@ -24,6 +24,7 @@ void smokeTest() {
2424
var model = DashscopeChatModel.createDefault();
2525
var response = model.call("hello");
2626
assertNotNull(response);
27+
System.out.println(response);
2728
}
2829

2930
@Test

pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.alexcheng1982</groupId>
88
<artifactId>spring-ai-dashscope-client-parent</artifactId>
9-
<version>1.2.0</version>
9+
<version>1.2.1</version>
1010
<packaging>pom</packaging>
1111

1212
<name>Aliyun Dashscope Spring AI Client :: Parent</name>
@@ -29,7 +29,6 @@
2929
<module>client</module>
3030
<module>spring-boot-autoconfigure</module>
3131
<module>spring-boot-starter</module>
32-
<module>example</module>
3332
</modules>
3433

3534
<scm>
@@ -46,7 +45,7 @@
4645
<maven.compiler.source>17</maven.compiler.source>
4746
<maven.compiler.target>17</maven.compiler.target>
4847
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
49-
<dashscope-sdk.version>2.13.0</dashscope-sdk.version>
48+
<dashscope-sdk.version>2.16.2</dashscope-sdk.version>
5049
<spring-ai.version>1.0.0-SNAPSHOT</spring-ai.version>
5150
<jackson.version>2.14.2</jackson.version>
5251
<spring-boot.version>3.2.4</spring-boot.version>

spring-boot-autoconfigure/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.github.alexcheng1982</groupId>
88
<artifactId>spring-ai-dashscope-client-parent</artifactId>
9-
<version>1.2.0</version>
9+
<version>1.2.1</version>
1010
</parent>
1111

1212
<artifactId>spring-ai-dashscope-spring-boot-autoconfigure</artifactId>

spring-boot-starter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.github.alexcheng1982</groupId>
88
<artifactId>spring-ai-dashscope-client-parent</artifactId>
9-
<version>1.2.0</version>
9+
<version>1.2.1</version>
1010
</parent>
1111

1212
<artifactId>spring-ai-dashscope-spring-boot-starter</artifactId>

0 commit comments

Comments
 (0)