dify icon indicating copy to clipboard operation
dify copied to clipboard

feat: add models for gitee.ai

Open fchange opened this issue 1 year ago • 4 comments

Checklist:

[!IMPORTANT]
Please review the checklist below before submitting your pull request.

  • [X] Please open an issue before creating a PR or link to an existing issue
  • [X] I have performed a self-review of my own code
  • [X] I have commented my code, particularly in hard-to-understand areas
  • [X] I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Description

This pull request introduces support for Gitee AI as a new model provider.

Close https://github.com/langgenius/dify/issues/9243

Type of Change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [X] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update, included: Dify Document
  • [ ] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • [ ] Dependency upgrade

Testing Instructions

The changes were tested using manually filled credentials. img_v3_02f3_41d4fba0-ccad-4750-80ee-9f55ddec38bg

fchange avatar Oct 18 '24 08:10 fchange

validate_credentials has been implemented and self-tested.

fchange avatar Oct 21 '24 03:10 fchange

validate_credentials has been implemented and self-tested.

I mean you need to add tests here like this one https://github.com/langgenius/dify/blob/7c0b159a81f099c5089c96ba77b32d592e5787b8/api/tests/integration_tests/model_runtime/openai/test_llm.py

crazywoola avatar Oct 22 '24 14:10 crazywoola

Added tests,because they use the real Gitee AI service, which requires a correctly filled access_token to run successfully. Therefore, the test command was not added to pytest_model_runtime.sh @crazywoola

fchange avatar Oct 24 '24 02:10 fchange

@crazywoola you can sign up Gitee AI, and use the free token(100 requests limit per day) to run the tests: https://ai.gitee.com/dashboard/settings/tokens

image

bluishoul avatar Oct 24 '24 02:10 bluishoul