Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

docs: update the providers page for openai-compatible, registerProvider and provider imports

已关闭
#291 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@prakashNalla 已经在做这个了。

开始于 2026年10月21日。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
76/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
markdown, typescript
领域
documentation

调研方向

Read website/src/content/docs/core/providers.mdx alongside packages/core/src/types.ts and ProviderConfig to check the options table. Use packages/core/tests/providers/openai-compatible.test.ts and registry.test.ts for working examples, and review packages/core/src/providers/registry.ts, base.ts, and packages/server/src/config.ts for registration and custom provider behavior. Update the listed sections and examples, then verify them with the website build and add the empty changeset described in the issue.

由索引模型根据 Issue 内容生成。

描述

documentation good first issue hacktoberfest website

Three provider changes landed this week and the providers page doesn't know about any of them yet: the openai-compatible type and registerProvider() (#289), the provider classes moving to their own import paths (#288), and the server taking a provider object you built yourself. This issue brings website/src/content/docs/core/providers.mdx up to date.

What to do

  • "Provider configuration" (lines 8 to 31): add an openai-compatible block. Note that apiKey is required for claude, openai and gemini, and setup fails with a clear error without it.
  • "Options" table (lines 43 to 53): add headers (OpenAI and openai-compatible, sent on every request) and supportsTools (same providers, default true, tools aren't sent when false and one warning is logged). Change the maxTokensParam row: the default is 'max_completion_tokens' for openai and 'max_tokens' for openai-compatible.
  • "OpenAI-compatible servers" (lines 61 to 83): switch the Ollama and OpenRouter examples to type: 'openai-compatible'. Ollama needs no apiKey now, so drop the 'ollama' placeholder line. Add one example with headers (OpenRouter's HTTP-Referer is a good one) and one with supportsTools: false for a model that can't call tools. baseURL and model are required for this type.
  • New section "Custom providers", after "AIProvider interface":
    • registerProvider('my-llm', async (config) => new MyProvider(config)), then provider: { type: 'my-llm', ... }. The factory gets the whole provider config. Registering a built-in name throws, and registering the same name again replaces it.
    • The other way: pass the provider object itself as the server's provider (packages/server/src/config.ts, lines 17 to 20). Anything with step() or chat() works.
  • "Direct provider usage" (lines 112 to 138): add a short note that ClaudeProvider, OpenAIProvider and GeminiProvider are imported from @chatcops/core/providers/claude, /openai and /gemini, not from @chatcops/core, so importing core doesn't load all three SDKs.

Where to look

  • packages/core/src/types.ts, ProviderConfig
  • packages/core/src/providers/registry.ts and base.ts (createProvider)
  • packages/core/tests/providers/openai-compatible.test.ts and registry.test.ts for working configs

Acceptance criteria

  • Every option in ProviderConfig is in the Options table, and nothing that isn't
  • Every code sample on the page matches the current types (copy them into a scratch .ts file in packages/core and run pnpm --filter @chatcops/core typecheck, then delete it)
  • pnpm --filter @chatcops/website build succeeds
  • Changeset: pnpm changeset --empty (docs only)

Please get this merged by Dec 8, since the v0.6 release notes link to it.


Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.

主要语言
TypeScript
星标
13
派生
7
平均合并
3 小时 33 分钟
30 天内合并 PR
176

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codercops/chatcops 的其他 Issue

查看 codercops/chatcops 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。