feat(models): add workspace starred model and processor defaults

This commit is contained in:
Hyu
2026-10-09 18:34:29 +08:00
parent 4c70977a1d
commit c5c3ec0b2c
20 changed files with 231 additions and 9 deletions
+16
View File
@@ -424,6 +424,22 @@ class LangBotMCPServer:
context = _authorized(Permission.RUNTIME_OPERATE)
return _dump(await ap.agent_service.debug_agent(context, processor_uuid, payload))
@mcp.tool(description='Get the single starred LLM model UUID for the current Workspace.')
async def get_starred_model() -> str:
context = _authorized(Permission.RESOURCE_VIEW)
return _dump({'uuid': await ap.llm_model_service.get_starred_model(context)})
@mcp.tool(description='Star one LLM model for this Workspace, replacing the previous choice. Pass null to clear.')
async def set_starred_model(model_uuid: str | None = None) -> str:
context = _authorized(Permission.PROVIDER_SECRET_MANAGE)
await ap.llm_model_service.set_starred_model(context, model_uuid)
return _dump({'uuid': model_uuid})
@mcp.tool(description='Resolve the default LLM model: starred model, then the available Space wizard recommendation.')
async def get_default_model() -> str:
context = _authorized(Permission.RESOURCE_MANAGE)
return _dump({'uuid': await ap.llm_model_service.get_default_model(context)})
@mcp.tool(description='List all configured LLM models. Secrets are redacted.')
async def list_llm_models() -> str:
context = _authorized(Permission.RESOURCE_VIEW)