Skip to main content

DashScope Integration

This page explains how to connect Bytedesk to Alibaba Cloud DashScope models and use DashScope as the default model provider.

Prerequisites
  • Bytedesk has been deployed
  • You have created a DashScope API key in Alibaba Cloud Bailian

Configuration Steps

1. Create an API Key

  1. Open the DashScope console: https://bailian.console.aliyun.com/?apiKey=1#/api-key
  2. Sign in to your Alibaba Cloud account
  3. Create an API key
  4. Save the generated key securely

2. Configure Bytedesk Admin

  1. Sign in to the Bytedesk admin console
  2. Open the provider or API key configuration page
  3. Enter the DashScope API key

provider

3. Select the Model Provider

  1. Open the AI model settings page
  2. Choose DashScope as the default provider
  3. Save the configuration

provider provider-choose

4. Embed the Chat Code

  1. Find the Get Chat Code option in the admin console
  2. Copy the generated embed code
  3. Add it to your website or application

provider-code

Example Result

After the configuration is complete, the website chat widget can call DashScope-backed AI capabilities.

DashScope chat effect

Optional Configuration

Docker Environment Variables

SPRING_AI_DASHSCOPE_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode
SPRING_AI_DASHSCOPE_API_KEY=sk-xxx
SPRING_AI_DASHSCOPE_CHAT_ENABLED=true
SPRING_AI_DASHSCOPE_CHAT_OPTIONS_MODEL=deepseek-r1
SPRING_AI_DASHSCOPE_CHAT_OPTIONS_TEMPERATURE=0.7
SPRING_AI_DASHSCOPE_AUDIO_TRANSCRIPTION_ENABLED=false
SPRING_AI_DASHSCOPE_IMAGE_ENABLED=false
SPRING_AI_DASHSCOPE_EMBEDDING_ENABLED=true
SPRING_AI_DASHSCOPE_AUDIO_SYNTHESIS_ENABLED=false

Source Configuration

spring.ai.dashscope.base-url=https://dashscope.aliyuncs.com/compatible-mode
spring.ai.dashscope.api-key=sk-xxx
spring.ai.dashscope.chat.enabled=true
spring.ai.dashscope.chat.options.model=deepseek-r1
spring.ai.dashscope.chat.options.temperature=0.7
spring.ai.dashscope.chat.options.topP=3
spring.ai.dashscope.audio.transcription.enabled=false
spring.ai.dashscope.image.enabled=false
spring.ai.dashscope.embedding.enabled=true
spring.ai.dashscope.audio.synthesis.enabled=false

Common Issues

  1. Invalid API key: confirm the key is correct and enabled.
  2. Slow responses: check network latency and tune model parameters.
  3. Feature errors: verify the related switches are enabled.

这页文档对您有帮助吗?