WeKnora/website-docs/04-api
Ochan Kwon 31c6055687
feat(agent): name the turn's chat model on the completion event (#4252)
The agent completion event carries the turn's aggregated token usage
but not the chat model that produced it. A relay or gateway that meters
agent chat cannot price that usage: unit prices, and the discounts for
cache reads, cache writes and uncached input, differ per model, and
changing an agent's model blends the old and the new numbers in one
total.

The completion event's data now carries model_id, taken from the
engine's chat model. The turn's usage is aggregated only from calls
made through that model (each round and the final answer), so it names
the model the usage belongs to. A consumer resolves the model's name
and settings through the model API with its own credentials. The
message row's model_id keeps the requested binding and can differ when
a request override is invalid and the turn falls back to the agent's
model; the event names the model that actually ran. The key is omitted
when no model is known. The quick-answer path is not changed.

The model name is left out on purpose. The completion event reaches
everyone who chats with the agent, including shared-agent users and
embed visitors, and an operator may not want to reveal which model
serves an agent; the provider-facing string can also be a deployment
override that the model API hides from non-admin callers. The message
history already returns the same ID to these users.
2026-10-13 23:07:32 +08:00
..
01-api-overview.md docs(api): clarify knowledge-search scope union of knowledge_base_ids and knowledge_ids (#4191) 2026-10-12 17:40:56 +08:00
02-api-agent-mcp.md feat(mcp): let callers without a browser obtain MCP OAuth tokens (#4229) 2026-10-13 16:37:24 +08:00
02-api-auth.md feat(auth): 新增仅限邀请注册档位 (#3900) 2026-09-30 13:32:55 +08:00
02-api-channels.md revert: take the plugin system back out of main 2026-09-26 14:58:18 +08:00
02-api-chat.md feat(agent): name the turn's chat model on the completion event (#4252) 2026-10-13 23:07:32 +08:00
02-api-chunks.md feat(chat): open cited documents at the cited passage (#3700) 2026-09-25 13:26:16 +08:00
02-api-faq-wiki.md fix(wiki): resolve titles for unloaded backlinks (#3931) 2026-10-09 10:50:52 +08:00
02-api-infra.md revert: take the plugin system back out of main 2026-09-26 14:58:18 +08:00
02-api-knowledge.md docs: explain knowledge upload folder paths (#4177) 2026-10-12 14:30:07 +08:00
02-api-memory.md docs: sync website-docs, homepage and changelog for v0.8.2 (#3632) 2026-09-24 11:26:34 +08:00
02-api-model-system.md perf(embedding): batch Qwen3-VL message inputs (#4126) 2026-10-10 16:07:29 +08:00
02-api-org.md docs: sync website-docs, homepage and changelog for v0.8.2 (#3632) 2026-09-24 11:26:34 +08:00
02-api-sandbox-skills.md feat(sandbox): Docker 后端支持交互式终端 (#4023) 2026-10-10 21:38:03 +08:00
02-api-system.md feat(models): add system admin model catalog console (#3662) 2026-09-24 16:31:45 +08:00
02-api-tenant.md docs: sync website-docs, homepage and changelog for v0.8.2 (#3632) 2026-09-24 11:26:34 +08:00