Skip to main content
Production Status

Overview

Spring AI QianFan provides integration with Baidu’s QianFan AI platform, offering a comprehensive suite of AI capabilities including chat models, embedding models, and image generation.

Features

Chat Models

Access to QianFan’s conversational AI models for building intelligent chatbots and assistants

Embedding Models

Generate text embeddings for semantic search and text similarity analysis

Image Generation

Create AI-generated images using QianFan’s CogView model

Requirements

  • Java 17 or later
  • Maven 3.6+
  • QianFan API credentials (API Key and Secret Key)

Quick Start

Add Dependency

  • Maven
  • Gradle
<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-qianfan</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

Configuration

Set your QianFan credentials via environment variables:
export SPRING_AI_QIANFAN_API_KEY=<INSERT API KEY HERE>
export SPRING_AI_QIANFAN_SECRET_KEY=<INSERT SECRET KEY HERE>
Or configure in application.properties:
spring.ai.qianfan.api-key=YOUR_API_KEY
spring.ai.qianfan.secret-key=YOUR_SECRET_KEY

Building from Source

# Using Maven
mvn clean install

# Using Maven wrapper
./mvnw clean install

Building Documentation

To build the documentation site:
./mvnw -pl docs antora
This will generate the documentation site in /docs/target/antora/site.

Resources

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
I