MCPcopy Index your code
hub / github.com/InternScience/SpectrumLab / generate

Method generate

spectrumlab/models/base.py:13–32  ·  view source on GitHub ↗

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
    )

Source from the content-addressed store, hash-verified

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

Callers 3

evaluateMethod · 0.45
evaluateMethod · 0.45
process_batchMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected