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

Function _prepare_text_inputs

mllm_tools/utils.py:10–29  ·  view source on GitHub ↗

Converts a list of text strings into the input format for the Agent model. Args: texts (List[str]): The list of text strings to be processed. Returns: List[Dict[str, str]]: A list of dictionaries formatted for the Agent model.

(texts: List[str])

Source from the content-addressed store, hash-verified

8
9
10def _prepare_text_inputs(texts: List[str]) -> List[Dict[str, str]]:
11 """
12 Converts a list of text strings into the input format for the Agent model.
13
14 Args:
15 texts (List[str]): The list of text strings to be processed.
16
17 Returns:
18 List[Dict[str, str]]: A list of dictionaries formatted for the Agent model.
19 """
20 inputs = []
21 # Add each text string to the inputs
22 if isinstance(texts, str):
23 texts = [texts]
24 for text in texts:
25 inputs.append({
26 "type": "text",
27 "content": text
28 })
29 return inputs
30
31def _prepare_text_image_inputs(texts: Union[str, List[str]], images: Union[str, Image.Image, List[Union[str, Image.Image]]]) -> List[Dict[str, str]]:
32 """

Calls

no outgoing calls

Tested by

no test coverage detected