File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
models/spring-ai-zhipuai/src/main/java/org/springframework/ai/zhipuai Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 1616
1717package org .springframework .ai .zhipuai ;
1818
19- import com .fasterxml .jackson .annotation .JsonIgnore ;
2019import com .fasterxml .jackson .annotation .JsonInclude ;
2120import com .fasterxml .jackson .annotation .JsonInclude .Include ;
2221import com .fasterxml .jackson .annotation .JsonProperty ;
@@ -38,6 +37,11 @@ public class ZhiPuAiEmbeddingOptions implements EmbeddingOptions {
3837 * ID of the model to use.
3938 */
4039 private @ JsonProperty ("model" ) String model ;
40+
41+ /**
42+ * Dimensions 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 withDimensions (Integer dimensions ) {
83+ this .options .setDimensions (dimensions );
84+ return this ;
85+ }
86+
7587 public ZhiPuAiEmbeddingOptions build () {
7688 return this .options ;
7789 }
You can’t perform that action at this time.
0 commit comments