mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	Fix genai labels (#14330)
* Publish model state and embeddings reindex in dispatcher onConnect * remove unneeded from explore * add embeddings reindex progress to statusbar * don't allow right click or show similar button if semantic search is disabled * fix status bar * Convert peewee model to dict before formatting for genai description * add embeddings reindex progress to statusbar * fix status bar * Convert peewee model to dict before formatting for genai description
This commit is contained in:
		
							parent
							
								
									9adffa1ef5
								
							
						
					
					
						commit
						72aa68cedc
					
				@ -4,6 +4,8 @@ import importlib
 | 
			
		||||
import os
 | 
			
		||||
from typing import Optional
 | 
			
		||||
 | 
			
		||||
from playhouse.shortcuts import model_to_dict
 | 
			
		||||
 | 
			
		||||
from frigate.config import CameraConfig, GenAIConfig, GenAIProviderEnum
 | 
			
		||||
from frigate.models import Event
 | 
			
		||||
 | 
			
		||||
@ -36,8 +38,9 @@ class GenAIClient:
 | 
			
		||||
    ) -> Optional[str]:
 | 
			
		||||
        """Generate a description for the frame."""
 | 
			
		||||
        prompt = camera_config.genai.object_prompts.get(
 | 
			
		||||
            event.label, camera_config.genai.prompt
 | 
			
		||||
        ).format(**event)
 | 
			
		||||
            event.label,
 | 
			
		||||
            camera_config.genai.prompt,
 | 
			
		||||
        ).format(**model_to_dict(event))
 | 
			
		||||
        return self._send(prompt, thumbnails)
 | 
			
		||||
 | 
			
		||||
    def _init_provider(self):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user