Skip to content

Commit cb6229f

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

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

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

Lines changed: 15 additions & 3 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() {
@@ -54,9 +58,12 @@ public void setModel(String model) {
5458
}
5559

5660
@Override
57-
@JsonIgnore
5861
public Integer getDimensions() {
59-
return null;
62+
return this.dimensions;
63+
}
64+
65+
public void setDimensions(Integer dimensions) {
66+
this.dimensions = dimensions;
6067
}
6168

6269
public static class Builder {
@@ -72,6 +79,11 @@ public Builder withModel(String model) {
7279
return this;
7380
}
7481

82+
public Builder dimensions(Integer dimensions) {
83+
this.options.setDimensions(dimensions);
84+
return this;
85+
}
86+
7587
public ZhiPuAiEmbeddingOptions build() {
7688
return this.options;
7789
}

0 commit comments

Comments
 (0)