feat(qwen): Alibaba Qwen built-in over Model Studio's OpenAI-compatible mode #27
@@ -26,8 +26,9 @@ var ErrUnknownProvider = errors.New("unknown provider")
|
|||||||
// authenticated with the bearer token "test-token".
|
// authenticated with the bearer token "test-token".
|
||||||
type DSN struct {
|
type DSN struct {
|
||||||
// Scheme selects the provider implementation: "foreman", "ollama",
|
// Scheme selects the provider implementation: "foreman", "ollama",
|
||||||
// "ollama-cloud", "openai", "kimi", "anthropic", "google"/"gemini", or
|
// "ollama-cloud", "openai", "kimi", "qwen", "anthropic",
|
||||||
// any custom scheme registered with RegisterScheme.
|
// "google"/"gemini", "llama-swap"/"llama-swaps", or any custom scheme
|
||||||
|
// registered with RegisterScheme.
|
||||||
Scheme string
|
Scheme string
|
||||||
// Token is the provider secret (bearer token or API key); empty = none.
|
// Token is the provider secret (bearer token or API key); empty = none.
|
||||||
Token string
|
Token string
|
||||||
@@ -41,7 +42,7 @@ type DSN struct {
|
|||||||
func (d DSN) BaseURL() string { return "https://" + d.Host }
|
func (d DSN) BaseURL() string { return "https://" + d.Host }
|
||||||
|
|
||||||
// envKeyForProvider returns the LLM_* variable that defines the provider named
|
// envKeyForProvider returns the LLM_* variable that defines the provider named
|
||||||
|
|
|||||||
// name (LLM_M1 → "m1", so "my-prov" → LLM_MY_PROV).
|
// name: "m1" → LLM_M1, "my-prov" → LLM_MY_PROV.
|
||||||
//
|
//
|
||||||
// This is the single definition on purpose. Two call sites need byte-identical
|
// This is the single definition on purpose. Two call sites need byte-identical
|
||||||
// output and would drift apart in silence: lazy resolution reads this variable
|
// output and would drift apart in silence: lazy resolution reads this variable
|
||||||
|
|||||||
Reference in New Issue
Block a user
⚪ envKeyForProvider doc-comment example inverts the function's direction (LLM_M1 → "m1" is name → var backwards)
maintainability · flagged by 1 model
builtin.go:20isProviderKimi = "kimi"(padding stripped), whilebuiltin.go:26isProviderQwen = "qwen"(padding retained) — inconsistent spacing within the same const block. Confirmed. -env.go:44reads// name (LLM_M1 → "m1", so "my-prov" → LLM_MY_PROV).while the function (line 52) returns the LLM_ variable for a given name, so the first arrowLLM_M1 → "m1"inverts the actual direction. Confirmed.🪰 Gadfly · advisory