mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-08 15:52:48 +03:00
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:
@@ -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]] = {}
|
||||
|
||||
Reference in New Issue
Block a user