Get appropriate wrapper for media handling based on model name
(model_name: str)
| 146 | return file |
| 147 | |
| 148 | def get_media_wrapper(model_name: str) -> Optional[Union[GeminiWrapper, VertexAIWrapper]]: |
| 149 | """Get appropriate wrapper for media handling based on model name""" |
| 150 | if model_name.startswith('gemini/'): |
| 151 | return GeminiWrapper(model_name=model_name.split('/')[-1]) |
| 152 | elif model_name.startswith('vertex_ai/'): |
| 153 | return VertexAIWrapper(model_name=model_name.split('/')[-1]) |
| 154 | return None |
| 155 | |
| 156 | def prepare_media_messages(prompt: str, media_path: Union[str, Image.Image], model_name: str) -> List[Dict[str, Any]]: |
| 157 | """Prepare messages for media input based on model type""" |
nothing calls this directly
no test coverage detected