Skip to content

Commit 1780e88

Browse files
quaffilayaperumalg
authored andcommitted
Doc: Fix ZhipuAI configuration key
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
1 parent f32b122 commit 1780e88

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/zhipuai-embeddings.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ You will need to create an API with ZhiPuAI to access ZhiPu AI language models.
1010

1111
Create an account at https://open.bigmodel.cn/login[ZhiPu AI registration page] and generate the token on the https://open.bigmodel.cn/usercenter/apikeys[API Keys page].
1212

13-
The Spring AI project defines a configuration property named `spring.ai.zhipu.api-key` that you should set to the value of the `API Key` obtained from the API Keys page.
13+
The Spring AI project defines a configuration property named `spring.ai.zhipuai.api-key` that you should set to the value of the `API Key` obtained from the API Keys page.
1414

1515
You can set this configuration property in your `application.properties` file:
1616

1717
[source,properties]
1818
----
19-
spring.ai.zhipu.api-key=<your-zhipu-api-key>
19+
spring.ai.zhipuai.api-key=<your-zhipuai-api-key>
2020
----
2121

2222
For enhanced security when handling sensitive information like API keys, you can use Spring Expression Language (SpEL) to reference an environment variable:
@@ -26,22 +26,22 @@ For enhanced security when handling sensitive information like API keys, you can
2626
# In application.yml
2727
spring:
2828
ai:
29-
zhipu:
30-
api-key: ${ZHIPU_API_KEY}
29+
zhipuai:
30+
api-key: ${ZHIPUAI_API_KEY}
3131
----
3232

3333
[source,bash]
3434
----
3535
# In your environment or .env file
36-
export ZHIPU_API_KEY=<your-zhipu-api-key>
36+
export ZHIPUAI_API_KEY=<your-zhipuai-api-key>
3737
----
3838

3939
You can also set this configuration programmatically in your application code:
4040

4141
[source,java]
4242
----
4343
// Retrieve API key from a secure source or environment variable
44-
String apiKey = System.getenv("ZHIPU_API_KEY");
44+
String apiKey = System.getenv("ZHIPUAI_API_KEY");
4545
----
4646

4747
=== Add Repositories and BOM
@@ -228,7 +228,7 @@ Next, create an `ZhiPuAiEmbeddingModel` instance and use it to compute the simil
228228

229229
[source,java]
230230
----
231-
var zhiPuAiApi = new ZhiPuAiApi(System.getenv("ZHIPU_AI_API_KEY"));
231+
var zhiPuAiApi = new ZhiPuAiApi(System.getenv("ZHIPUAI_API_KEY"));
232232
233233
var embeddingModel = new ZhiPuAiEmbeddingModel(api, MetadataMode.EMBED,
234234
ZhiPuAiEmbeddingOptions.builder()

0 commit comments

Comments
 (0)