kimi-code/docs
Kai bf35f63c5d
fix(provider): honor base_url for google-genai and vertexai providers (#1269)
* fix(provider): honor base_url for google-genai and vertexai providers

The google-genai and vertexai provider types silently ignored a configured
base_url and always hit generativelanguage.googleapis.com (e.g. a Gemini-
compatible proxy URL + key could not be used). Plumb the endpoint through to
the @google/genai SDK via httpOptions.baseUrl:

- kosong: add baseUrl to GoogleGenAIOptions and inject it into the client's
  httpOptions alongside the existing headers (the SDK merges headers and
  overrides the base host).
- agent-core: forward provider.baseUrl in the google-genai and vertexai
  branches, with GOOGLE_GEMINI_BASE_URL / GOOGLE_VERTEX_BASE_URL env
  fallback. vertexai keeps deriving location from an aiplatform host.
- docs: document base_url for both providers, noting the host root only
  must be given because the SDK appends the API version itself.

Covered by unit tests asserting the URL reaches the kosong config and the
SDK client's httpOptions.

* fix(provider): use the effective base_url for vertex location detection

The vertexai branch forwarded the endpoint from config `base_url` OR the
GOOGLE_VERTEX_BASE_URL env fallback, but service-account detection
(`hasVertexAIServiceEnv` / `vertexAILocation`) still derived the region from
`provider.baseUrl` only. Supplying the regional endpoint via the env fallback
(with a project but no explicit GOOGLE_CLOUD_LOCATION) therefore left location
undefined and silently downgraded Vertex ADC to API-key Gemini routing.

Resolve the effective base URL once and use it for both forwarding and location
derivation, so the env fallback behaves exactly like `base_url`. Add a
changeset for the kosong + agent-core patch release.
2026-07-01 19:33:35 +08:00
..
.vitepress feat: custom color themes (#484) 2026-06-09 18:55:15 +08:00
en fix(provider): honor base_url for google-genai and vertexai providers (#1269) 2026-07-01 19:33:35 +08:00
media Kimi For Coding 2026-05-22 15:54:50 +08:00
public Kimi For Coding 2026-05-22 15:54:50 +08:00
zh fix(provider): honor base_url for google-genai and vertexai providers (#1269) 2026-07-01 19:33:35 +08:00
.gitignore fix: fix bundle (#956) 2026-06-22 13:59:57 +08:00
AGENTS.md docs: expand AGENTS.md with reader personas, format decisions, and checklist (#507) 2026-06-08 21:46:01 +08:00
index.md Kimi For Coding 2026-05-22 15:54:50 +08:00
package.json feat(web): add Mermaid diagram rendering and off-thread KaTeX/Mermaid workers (#1226) 2026-07-01 02:17:34 +08:00