Skip to content

feat: Add Deepseek & Zhipu API support with code quality improvements#147

Open
Alenryuichi wants to merge 1 commit intoj4wg:mainfrom
Alenryuichi:feature/deepseek-zhipu
Open

feat: Add Deepseek & Zhipu API support with code quality improvements#147
Alenryuichi wants to merge 1 commit intoj4wg:mainfrom
Alenryuichi:feature/deepseek-zhipu

Conversation

@Alenryuichi
Copy link

Summary

Add support for Deepseek and Zhipu/GLM API providers, expanding the available AI backends for Chinese users.

Features

  • ✅ Add Deepseek API provider
  • ✅ Add Zhipu/GLM API provider (GLM-4.5, GLM-5 models)
  • ✅ Implement per-provider API key storage (each provider has its own key field)
  • ✅ Add collapsible \解题思路\ (solution explanation) section with Markdown rendering
  • ✅ Fix malformed JSON from GLM API (Chinese quotes, single-quoted values)

Security

  • ✅ Add DOMPurify to sanitize AI-generated HTML content (XSS prevention)

Code Quality

  • ✅ Extract API URLs to constants
  • ✅ Refactor Zhipu API calls into reusable method
  • ✅ Remove unused variables and debug statements

Dependencies Added

  • \ - for fixing malformed JSON
  • \ - for HTML sanitization

Features:
- Add Deepseek and Zhipu/GLM API providers alongside OpenAI, Gemini, Anthropic
- Implement per-provider API key storage
- Add GLM-4.5 and GLM-5 model options to Settings UI
- Add collapsible "解题思路" section with markdown rendering
- Fix malformed JSON from GLM API (Chinese quotes, single-quoted values)

Security:
- Add DOMPurify to sanitize AI-generated HTML content (XSS prevention)

Code Quality:
- Extract API URLs to constants (API_URLS)
- Refactor Zhipu API calls into reusable callZhipuAPI() method
- Remove unused variable (stringStart)
- Remove debug console.log statements
- Delete temporary test file (test-detect-quotes.js)

Dependencies:
- Add jsonrepair for JSON fixing
- Add dompurify for HTML sanitization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant