alibaba / spring-ai-alibaba
- среда, 26 марта 2025 г. в 00:00:02
Agentic AI Framework for Java Developers
An AI application framework for Java developers built on top of Spring AI that provides seamless integration with Alibaba Cloud QWen LLM services and cloud-native infrastructures.
Please refer to quick start for how to quickly add generative AI to your Spring Boot applications.
Overall, it takes only two steps to turn your Spring Boot application into an intelligent agent:
Because Spring AI Alibaba is developed based on Spring Boot 3.x, it requires JDK version 17 and above.
spring-ai-alibaba-starter
dependency to your project.<dependency>
<groupId>com.alibaba.cloud.ai</groupId>
<artifactId>spring-ai-alibaba-starter</artifactId>
<version>1.0.0-M6.1</version>
</dependency>
NOTICE: Since spring-ai related packages haven't been published to the central repo yet, it's needed to add the following maven repository to your project in order to successfully resolve artifacts like spring-ai-core.
<repositories> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>https://repo.spring.io/milestone</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories>Addendum: If the mirrorOf tag in your local Maven settings. xml is configured with the wildcard *, please modify it according to the following example.
<mirror> <id>xxxx</id> <mirrorOf>*,!spring-milestones</mirrorOf> <name>xxxx</name> <url>xxxx</url> </mirror>
ChatClient
@RestController
public class ChatController {
private final ChatClient chatClient;
public ChatController(ChatClient.Builder builder) {
this.chatClient = builder.build();
}
@GetMapping("/chat")
public String chat(String input) {
return this.chatClient.prompt()
.user(input)
.call()
.content();
}
}
Spring AI Alibaba and Spring AI usage examples
Spring AI Alibaba provides the following features, read the documentation on our website for more details of how to use these features.
Spring AI Alibaba aims to reduce the complexity of building ai native java applications, from development, evaluation to deployment and observability. In order to achieve that, we provide both open-source framework and ecosystem integrations around it, below are the features that we plan to support in the near future:
Please refer to the Contribution Guide to learn how to participate in the development of Spring AI Alibaba.
61290041831
and join.Some of this project's ideas and codes are inspired by or rewrote from the following projects. Great thanks to those who have created and open-sourced these projects.