Generate response for a single prompt. Args: prompt: Input prompt, can be: - str: Simple text prompt - Dict: Multimodal prompt with format: { "text": "question text",
(
self, prompt: Union[str, Dict[str, Any]], max_out_len: int = 512
)
| 11 | |
| 12 | @abstractmethod |
| 13 | def generate( |
| 14 | self, prompt: Union[str, Dict[str, Any]], max_out_len: int = 512 |
| 15 | ) -> str: |
| 16 | """ |
| 17 | Generate response for a single prompt. |
| 18 | |
| 19 | Args: |
| 20 | prompt: Input prompt, can be: |
| 21 | - str: Simple text prompt |
| 22 | - Dict: Multimodal prompt with format: |
| 23 | { |
| 24 | "text": "question text", |
| 25 | "images": [{"type": "image_url", "image_url": {"url": "data:..."}}] |
| 26 | } |
| 27 | max_out_len: Maximum output length |
| 28 | |
| 29 | Returns: |
| 30 | Generated response string |
| 31 | """ |
| 32 | pass |
no outgoing calls
no test coverage detected