Refactor: completion -> completions (#14584)

### What problem does this PR solve?

Keep only /completions, deprecated /completion

### Type of change

- [x] Refactoring
This commit is contained in:
Wang Qi
2026-05-06 17:19:22 +08:00
committed by GitHub
parent a190a6d67f
commit f32034e83e
10 changed files with 24 additions and 22 deletions

View File

@@ -403,14 +403,14 @@ async def deprecated_file_upload_info():
@add_tenant_id_to_kwargs
async def deprecated_agent_completions(agent_id, tenant_id=None):
"""
Deprecated: Use POST /api/v1/agents/chat/completion instead.
Deprecated: Use POST /api/v1/agents/chat/completions instead.
Old path: POST /api/v1/agents/{agent_id}/completions
New path: POST /api/v1/agents/chat/completion
New path: POST /api/v1/agents/chat/completions
"""
logging.warning(
"API endpoint /api/v1/agents/%s/completions is deprecated. "
"Please use /api/v1/agents/chat/completion instead.",
"Please use /api/v1/agents/chat/completions instead.",
agent_id,
)
return await agent_api.agent_chat_completion(tenant_id=tenant_id, agent_id=agent_id)