MCPcopy Create free account
hub / github.com/TIGER-AI-Lab/TheoremExplainAgent / get_media_wrapper

Function get_media_wrapper

mllm_tools/utils.py:148–154  ·  view source on GitHub ↗

Get appropriate wrapper for media handling based on model name

(model_name: str)

Source from the content-addressed store, hash-verified

146 return file
147
148def 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
156def 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"""

Callers

nothing calls this directly

Calls 2

GeminiWrapperClass · 0.85
VertexAIWrapperClass · 0.85

Tested by

no test coverage detected