[pull] main from Milkdown:main#206
Merged
Merged
Conversation
* docs(crepe): document built-in OpenAI / Anthropic LLM providers Adds a "Built-in Providers" subsection under the AI feature docs covering the new factories that shipped in #2355: - minimal usage (`createOpenAIProvider`, `createAnthropicProvider`) - the three deployment modes (desktop BYOK, browser BYOK with `dangerouslyAllowBrowser`, backend proxy via `baseURL` + `headers`) - shared `BaseProviderConfig` shape, including the `systemPrompt` contract (`undefined` → default, `null` → omit, string → as-is) - per-provider extras (OpenAI `body` / `buildMessages`, Anthropic `maxTokens` / `anthropicVersion` / top-level `system` field) - CORS note for direct browser calls * docs(crepe): fix OpenAI buildMessages example to honor systemPrompt: null The previous example used `defaults.systemPrompt ?? ''`, which turned a deliberate `null` (the documented "omit" sentinel) into an empty string and still sent a system message. The new example spreads the system message conditionally so `null` truly omits it, matching the behavior the prose above documents. * docs(crepe): clarify env-var usage and spell out ACAO acronym - Replace `process.env.*` in the minimal-usage snippet with a placeholder string and add a short paragraph explaining how to source the API key in browser builds (BYOK input, bundler env vars like Vite's `import.meta.env`, or omit entirely and proxy through a backend). `process.env` is Node-only. - Spell out `Access-Control-Allow-Origin` on first use in the CORS note before falling back to the ACAO shorthand. * docs(crepe): clarify browser key handling and shared-config note - Re-label the minimal-usage snippet as a server-side shape and point readers at the "Deployment modes" section before they try to copy-paste it into a browser. - Drop the misleading "build-time injected env vars are somewhere safe" wording. Vite-style `import.meta.env.VITE_*` substitutions end up as plain strings in the shipped JS — no different from a hard-coded key. Replace with an explicit note: the only safe options are BYOK (each user supplies their own key + opt-in) or routing through a backend proxy. - Annotate the `BaseProviderConfig` block as illustrative since it isn't a public export, and direct TS users to the actual exported types (`OpenAIProviderConfig` / `AnthropicProviderConfig`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )