Skip to content

feat: add bailian provider#375

Open
cointem wants to merge 4 commits intosipeed:mainfrom
cointem:bailian-api
Open

feat: add bailian provider#375
cointem wants to merge 4 commits intosipeed:mainfrom
cointem:bailian-api

Conversation

@cointem
Copy link

@cointem cointem commented Feb 17, 2026

📝 Description

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • [ x] ✨ New feature (non-breaking change which adds functionality)
  • [ x] 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • [ x] 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Linked Issue

📚 Technical Context (Skip for Docs)

  • Reference: [URL]
  • Reasoning: ...

🧪 Test Environment & Hardware

  • Hardware: [ PC]
  • OS: [ Ubuntu 22.04]
  • Model/Provider: [qwen-flash]
  • Channels: [Telegram]

📸 Proof of Work (Optional for Docs)

image

☑️ Checklist

  • [ x] My code/docs follow the style of this project.
  • [ x] I have performed a self-review of my own changes.
  • [ x] I have updated the documentation accordingly.

Copilot AI review requested due to automatic review settings February 17, 2026 17:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Aliyun Bailian/DashScope as a configurable LLM provider option and updates docs/examples to reflect the new provider.

Changes:

  • Add providers.bailian config block and wire it into CreateProvider with a DashScope-compatible default API base.
  • Fix Telegram channel to use the canonical senderID (including username when present) when dispatching messages.
  • Update README(s) and config example JSON to mention Bailian/DashScope.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/providers/http_provider.go Adds provider selection for Bailian/DashScope/Aliyun with a default compatible-mode API base.
pkg/config/config.go Adds Bailian provider config entry; small comment/style tweaks; uses 0o file mode literals when saving config.
pkg/channels/telegram.go Uses senderID consistently when calling HandleMessage.
config/config.example.json Adds example providers.bailian block.
README.md Mentions Bailian and adds it to provider table.
README.zh.md Mentions 百炼 / DashScope in provider list.
README.ja.md Mentions Bailian / DashScope in provider list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +283 to +287
case "bailian", "dashscope", "aliyun":
if cfg.Providers.Bailian.APIKey != "" {
apiKey = cfg.Providers.Bailian.APIKey
apiBase = cfg.Providers.Bailian.APIBase
if apiBase == "" {
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bailian is only selectable when agents.defaults.provider is explicitly set to bailian/dashscope/aliyun. The model-based fallback below doesn’t recognize Bailian/DashScope models (e.g., qwen-*), so users who only set providers.bailian.api_key will still fall through to OpenRouter or error. Consider adding a fallback branch that selects Bailian when the model indicates Qwen/DashScope (or when the model has a bailian/ or dashscope/ prefix), using the same default API base.

Copilot uses AI. Check for mistakes.
Proxy string `json:"proxy,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_PROXY"`
AuthMethod string `json:"auth_method,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_AUTH_METHOD"`
ConnectMode string `json:"connect_mode,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_CONNECT_MODE"` //only for Github Copilot, `stdio` or `grpc`
ConnectMode string `json:"connect_mode,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_CONNECT_MODE"` // only for Github Copilot, `stdio` or `grpc`
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment uses “Github”; project naming elsewhere uses “GitHub”. Please update the comment to avoid inconsistent capitalization (and to match the provider key github_copilot).

Suggested change
ConnectMode string `json:"connect_mode,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_CONNECT_MODE"` // only for Github Copilot, `stdio` or `grpc`
ConnectMode string `json:"connect_mode,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_CONNECT_MODE"` // only for GitHub Copilot, `stdio` or `grpc`

Copilot uses AI. Check for mistakes.
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