File size: 999 Bytes
7a38b33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
EXTRACT_INFO_HUMAN_MESSAGE = \
"Output properties of the product in the image."

EXTRACT_INFO_SYSTEM_MESSAGE = \
"You are an expert at structured data extraction. You will be given an image of a product and should output the its properties into the given structure."

FOLLOW_SCHEMA_HUMAN_MESSAGE = \
"""Convert following attributes to structured schema. Keep all the keys and number of values. Only replace the values themselves. :

{json_info}"""

FOLLOW_SCHEMA_SYSTEM_MESSAGE = \
"You are an expert at structured data extraction. You will be given an dictionary of attributes of a product and should output the its properties into the given structure."


if __name__ == '__main__':
    print('Run test cases...')
    print(FOLLOW_SCHEMA_HUMAN_MESSAGE.format(json_info='{"color": "red"}'))
    print(FOLLOW_SCHEMA_HUMAN_MESSAGE.format(json_info='{"color": "red", "size": "small"}'))
    print(FOLLOW_SCHEMA_HUMAN_MESSAGE.format(json_info='{"color": "red", "size": "small", "material": "cotton"}'))