mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-26 18:35:38 +08:00
feat(models): add workspace starred model and processor defaults
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user