Add custom provider docs#241
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughREADME.md now documents how to add custom providers, register them, wire them into ChangesCustom Provider Documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related issues
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da21673b33
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| Run `commit-echo init` to configure your provider and model. Configuration is stored in `~/.config/commit-echo/config.json`. | ||
|
|
||
| To add a custom provider, create a file in the `src/providers` directory (e.g., `src/providers/my-provider.ts`) and add it to the `BUILTIN_PROVIDERS` list. Then, wire it into the `createProvider()` function. You can also use the `__custom__` provider key and set the `CUSTOM_API_KEY` environment variable to point to your custom endpoint. |
There was a problem hiding this comment.
Document the custom endpoint setting separately
For the __custom__ provider, CUSTOM_API_KEY is only used as the API key; the endpoint still has to come from baseUrl in config or COMMIT_ECHO_BASE_URL. In the code, getBaseUrl() throws when a custom provider has no base URL, so users following this sentence by setting only CUSTOM_API_KEY will still fail before any request is made.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 89-90: Update the custom provider documentation near the
__custom__ provider instructions to distinguish CUSTOM_API_KEY as the credential
from the required base URL. Document that the base URL must be configured
through config.json, commit-echo init, or COMMIT_ECHO_BASE_URL, while preserving
the existing custom endpoint setup guidance.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| To add a custom provider, create a file in the `src/providers` directory (e.g., `src/providers/my-provider.ts`) and add it to the `BUILTIN_PROVIDERS` list. Then, wire it into the `createProvider()` function. You can also use the `__custom__` provider key and set the `CUSTOM_API_KEY` environment variable to point to your custom endpoint. | ||
|
|
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Document the custom base URL separately from the API key.
CUSTOM_API_KEY supplies the credential; it does not point to the endpoint. The __custom__ flow also requires a base URL via config.json, commit-echo init, or COMMIT_ECHO_BASE_URL. As written, users may configure only the API key and hit Custom provider requires a base URL.
Suggested wording
-You can also use the `__custom__` provider key and set the `CUSTOM_API_KEY` environment variable to point to your custom endpoint.
+You can also use the `__custom__` provider key, configure the endpoint base URL with `commit-echo init` (or `COMMIT_ECHO_BASE_URL`), and set `CUSTOM_API_KEY` to the endpoint's API key.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| To add a custom provider, create a file in the `src/providers` directory (e.g., `src/providers/my-provider.ts`) and add it to the `BUILTIN_PROVIDERS` list. Then, wire it into the `createProvider()` function. You can also use the `__custom__` provider key and set the `CUSTOM_API_KEY` environment variable to point to your custom endpoint. | |
| To add a custom provider, create a file in the `src/providers` directory (e.g., `src/providers/my-provider.ts`) and add it to the `BUILTIN_PROVIDERS` list. Then, wire it into the `createProvider()` function. You can also use the `__custom__` provider key, configure the endpoint base URL with `commit-echo init` (or `COMMIT_ECHO_BASE_URL`), and set `CUSTOM_API_KEY` to the endpoint's API key. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@README.md` around lines 89 - 90, Update the custom provider documentation
near the __custom__ provider instructions to distinguish CUSTOM_API_KEY as the
credential from the required base URL. Document that the base URL must be
configured through config.json, commit-echo init, or COMMIT_ECHO_BASE_URL, while
preserving the existing custom endpoint setup guidance.
404-Page-Found
left a comment
There was a problem hiding this comment.
Patch the findings above
What was broken
Users had no clear documentation on adding a custom provider.
What changed
Added instructions to README on how to add a custom provider.
How to test
Verify that the instructions are clear and accurate.
Opened by autonomous agent. Human review required before merge.
Summary by CodeRabbit
__custom__provider key andCUSTOM_API_KEYenvironment variable.