Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

alexcheng1982/spring-ai-dashscope-client

Repository files navigation

Aliyun Dashscope Spring AI Model

English | 中文

Aliyun Dashscope Model for Spring AI

build

Maven Central Version

Versions

Client/Model version Spring AI version
1.1.x 0.8.1
>= 1.3.x 1.0.0

An Aliyun Dashscope API key is required. The key is set as environment variable DASHSCOPE_API_KEY.

Quick start

Add Maven dependency:

<dependency>
 <groupId>io.github.alexcheng1982</groupId>
 <artifactId>spring-ai-dashscope-client</artifactId>
 <version>VERSION</version>
</dependency>

Usage:

var model = DashscopeChatModel.createDefault();
var response = model.call("hello");

Features

  • ChatModel
  • StreamingChatModel
  • EmbeddingModel
  • Function calling
  • Multimodal input with images and audios

Spring Boot Starter

Add Spring Boot starter:

<dependency>
 <groupId>io.github.alexcheng1982</groupId>
 <artifactId>spring-ai-dashscope-spring-boot-starter</artifactId>
 <version>VERSION</version>
</dependency>

This will create a ChatModel bean and an EmbeddingModel bean. Default ChatOptions can be configured with the configuration key spring.ai.dashscope.chat.options. Default EmbeddingOptions can be configured with the configuration key spring.ai.dashscope.embedding.options.

spring:
 ai:
 dashscope:
 chat:
 options:
 model: qwen-plus
 temperature: 0.2
 embedding:
 options:
 model: text-embedding-v2

See example for reference.

About

Aliyun Dashscope Spring AI Model

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /