Add ability to manually run Review Descriptions from the UI / API (#24222)

* Add ability to manually run Review Descriptions from the UI / API

* Fix not handling None type for call
This commit is contained in:
Nicolas Mowen
2026-09-12 07:30:04 -06:00
parent 82be9fff5e
commit f9347967eb
11 changed files with 409 additions and 39 deletions
+22
View File
@@ -110,6 +110,28 @@ class GenAIClientManager:
name = self._role_map.get(GenAIRoleEnum.embeddings)
return self._get_client(name) if name else None
def role_info(self) -> dict[str, dict[str, Any]]:
"""Return the model selected for each configured role and its context size.
Only reads state the client saved when it initialized, so unlike
list_models() this does not ask the provider for its catalog.
"""
result: dict[str, dict[str, Any]] = {}
for role, name in self._role_map.items():
client = self._get_client(name)
if not client:
continue
result[role.value] = {
"name": name,
"model": self._configs[name].model,
"context_size": client.get_context_size(),
}
return result
def list_models(self) -> dict[str, dict[str, Any]]:
"""Return per-entry model lists and capabilities, keyed by config entry name."""
result: dict[str, dict[str, Any]] = {}