Skip to content

Commit 5bd52b7

Browse files
committed
fix: implmented stub
implemented stub method Signed-off-by: youngmoneee <[email protected]>
1 parent be0f9fb commit 5bd52b7

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.ai.zhipuai;
1818

19-
import com.fasterxml.jackson.annotation.JsonIgnore;
2019
import com.fasterxml.jackson.annotation.JsonInclude;
2120
import com.fasterxml.jackson.annotation.JsonInclude.Include;
2221
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -28,6 +27,7 @@
2827
*
2928
* @author Geng Rong
3029
* @author Thomas Vitale
30+
* @author Ilayaperumal Gopinathan
3131
* @since 1.0.0 M1
3232
*/
3333
@JsonInclude(Include.NON_NULL)
@@ -38,6 +38,10 @@ public class ZhiPuAiEmbeddingOptions implements EmbeddingOptions {
3838
* ID of the model to use.
3939
*/
4040
private @JsonProperty("model") String model;
41+
/**
42+
* Dimension value of the model to use.
43+
*/
44+
private @JsonProperty("dimensions") Integer dimensions;
4145
// @formatter:on
4246

4347
public static Builder builder() {
@@ -53,10 +57,17 @@ public void setModel(String model) {
5357
this.model = model;
5458
}
5559

60+
public void setDimensions(Integer dimensions) {
61+
this.dimensions = dimensions;
62+
}
63+
5664
@Override
57-
@JsonIgnore
5865
public Integer getDimensions() {
59-
return null;
66+
return this.dimensions;
67+
}
68+
69+
public void setDimensions(Integer dimensions) {
70+
this.dimensions = dimensions;
6071
}
6172

6273
public static class Builder {
@@ -67,11 +78,16 @@ public Builder() {
6778
this.options = new ZhiPuAiEmbeddingOptions();
6879
}
6980

70-
public Builder withModel(String model) {
81+
public Builder model(String model) {
7182
this.options.setModel(model);
7283
return this;
7384
}
7485

86+
public Builder dimensions(Integer dimensions) {
87+
this.options.setDimensions(dimensions);
88+
return this;
89+
}
90+
7591
public ZhiPuAiEmbeddingOptions build() {
7692
return this.options;
7793
}

0 commit comments

Comments
 (0)