langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
51.5k stars 7.44k forks source link

[Model Provider] Support both domestic and international site of Tongyi models #9867

Open native98Mu opened 2 weeks ago

native98Mu commented 2 weeks ago

Self Checks

Dify version

0.10.1

Cloud or Self Hosted

Cloud

Steps to reproduce

Alibaba Cloud Tongyi model has different API Base for domestic and international sites. Currently, Dify does not provide URL configuration like OpenAI or Anthropic when configuring the Tongyi model provider. iShot_2024-10-25_17 14 29

✔️ Expected Behavior

Dify could provide URL configuration like OpenAI or Anthropic when configuring the Tongyi model provider. So Dify can support both domestic and international site of Tongyi models.

❌ Actual Behavior

Users cannot call Tongyi on Dify using the API key of the international site

crazywoola commented 2 weeks ago

You could add links according to en_US and zh_Hans

https://github.com/langgenius/dify/blob/5c76131d3dc1e4a5719cc828ba5a485e97024d90/api/core/model_runtime/model_providers/tongyi/tongyi.yaml#L16

Feel free to open a pull request for this :)