Repository navigation
docs(tutorial): add provider preset guide - #260
Conversation
GoDiao
left a comment
There was a problem hiding this comment.
Thanks @harshit3355, and welcome to DreamCoder! This is a solid guide. We checked it against the code at the pinned commit: the schema table, the example JSON, the presets endpoint, the POST /api/providers/test flow and the test commands are all correct, and the English and Chinese chapters say the same thing. A few fixes before we merge, mostly UI wording and the files around the chapter.
Should fix
1. Some UI labels don't match the app, and the Chinese chapter uses the English ones.
| Chapter says | English UI | Chinese UI |
|---|---|---|
| Settings → Providers → Add provider (line 74) | Providers → Add Provider | 服务商 → 添加服务商 |
| Discover models (line 76) | Fetch models | 获取模型 |
| Test Connection | correct | 测试连接 |
The strings are in desktop/src/i18n/locales/en.ts (settings.tab.providers, settings.providers.addProvider, settings.providers.fetchModels, settings.providers.testConnection) and the same keys in zh.ts. Please use the English labels in the English chapter and the Chinese labels in the Chinese chapter.
2. Say when Test Connection does nothing. The button is disabled while the base URL or the first model is empty (ProviderFormModal.tsx:989), and if the preset needs a key and none is entered, clicking it returns without any message (ProviderFormModal.tsx:715). One sentence covering both would save a reader from thinking the button is broken.
3. Say where the new entry goes. The tests require the last three presets to be lmstudio, ollama, custom in that order (provider-presets.test.ts:56-60), and the form uses the last preset as the custom fallback (ProviderFormModal.tsx:384). Please tell readers to insert the new preset before lmstudio, with that reason.
4. authStrategy isn't tied to the API format. Line 24 describes it as the authentication mapping "for the selected API format". The values (api_key, auth_token, auth_token_empty_api_key, dual_same_token, dual_dummy, in src/server/types/provider.ts:10-16) choose how the key is sent, independently of the format. Please reword it, and listing the values would help.
5. Add the language switch line at the top of both files, like the other chapters: English | [简体中文](./07-provider-presets.zh.md) in the English file and [English](./07-provider-presets.en.md) | 简体中文 in the Chinese one.
6. The series is no longer seven parts. README.md:49 and :183, README_zh.md:49 and :186, and website/src/App.tsx:44 and :100 all say seven (七篇). With this chapter it's eight.
7. Point CONTRIBUTING at the chapter. docs/general/CONTRIBUTING_en.md:120 and CONTRIBUTING_zh.md:121 already mention a website guide called "Adding Provider Presets", but don't link to it, and the title doesn't match. Please link them to the new chapter under its real title; #14 asks for that cross-link too.
Notes
- The CHANGELOG entry is fine; please add
(#260)at the end, like the entries around it. - #168 (a codebase tour) also uses the number
07. Whichever merges second will need to renumber; nothing to do here for now.
- Use the app's own labels: the English UI strings in the English chapter and the Chinese UI strings in the Chinese chapter. - Say when Test Connection is disabled or does nothing. - Tell readers to insert a new preset before lmstudio, and why. - Describe authStrategy as how the key is sent, separate from the API format, and list its values. - Add the language switch line to both chapters. - Count eight parts in the READMEs and on the website. - Link CONTRIBUTING to the chapter under its real title. - Move the changelog entry under Unreleased and add (GoDiao#260).
GoDiao
left a comment
There was a problem hiding this comment.
Thanks @harshit3355, all seven points are in. The labels match the app in both languages, the Test Connection behaviour and the insertion point are explained, and the new authStrategy table is a nice addition: I checked each row against buildAnthropicAuthHeaders in upstream/client.ts and the env mapping in providerRuntimeEnv.ts, and they match. The README, website and CONTRIBUTING updates are right, and the CHANGELOG entry sits under [Unreleased] after the 0.9.0 cut. CI is green.
We'll be opening more features and issues soon, and you're very welcome to keep contributing. If you find DreamCoder useful, a star on the repo would be much appreciated.
Summary
Part of #14.
Checks
bun test ./src/server/__tests__/provider-presets.test.ts— passed.cd website && bun run lint— passed.cd website && bun run build— passed; both tutorial pages were included.git diff --check— passed.The full
bun testrun did not complete cleanly on this Windows checkout: unrelated tests timed out and one Git worktree assertion compared Windows backslashes with Git's slash-formatted output. Desktop checks were not run; installing its dependencies hit DNS resolution failures.