跳至主要內容

智谱清言接入

起凡小于 1 分钟

智谱清言接入

通用配置

请参考通用配置

依赖配置

<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-zhipuai-spring-boot-starter</artifactId>
</dependency>

密钥配置

智谱清言 api-key申请open in new window

spring:
  ai:
    # 智谱
    zhipuai:
      api-key: xxx
      chat:
        enabled: true
        options:
          model: GLM-4

使用

private final ZhiPuAiChatModel zhiPuAiChatModel;

消息发送案例

请参考消息发送