Spaces:
Sleeping
Sleeping
chips commited on
Commit ·
e3195a7
1
Parent(s): 5a3318a
format changed to replace
Browse files
app/services/service_openai.py
CHANGED
|
@@ -74,12 +74,12 @@ class OpenAIService(BaseAttributionService):
|
|
| 74 |
) -> Dict[str, Any]:
|
| 75 |
|
| 76 |
print("Prompt: ")
|
| 77 |
-
print(prompts.EXTRACT_INFO_HUMAN_MESSAGE
|
| 78 |
|
| 79 |
text_content = [
|
| 80 |
{
|
| 81 |
"type": "text",
|
| 82 |
-
"text": prompts.EXTRACT_INFO_HUMAN_MESSAGE.
|
| 83 |
},
|
| 84 |
]
|
| 85 |
if img_urls is not None:
|
|
@@ -156,7 +156,7 @@ class OpenAIService(BaseAttributionService):
|
|
| 156 |
text_content = [
|
| 157 |
{
|
| 158 |
"type": "text",
|
| 159 |
-
"text": prompts.FOLLOW_SCHEMA_HUMAN_MESSAGE.
|
| 160 |
},
|
| 161 |
]
|
| 162 |
|
|
|
|
| 74 |
) -> Dict[str, Any]:
|
| 75 |
|
| 76 |
print("Prompt: ")
|
| 77 |
+
print(prompts.EXTRACT_INFO_HUMAN_MESSAGE.replace("{product_data}", product_data_to_str(product_data)))
|
| 78 |
|
| 79 |
text_content = [
|
| 80 |
{
|
| 81 |
"type": "text",
|
| 82 |
+
"text": prompts.EXTRACT_INFO_HUMAN_MESSAGE.replace("{product_data}", product_data_to_str(product_data)),
|
| 83 |
},
|
| 84 |
]
|
| 85 |
if img_urls is not None:
|
|
|
|
| 156 |
text_content = [
|
| 157 |
{
|
| 158 |
"type": "text",
|
| 159 |
+
"text": prompts.FOLLOW_SCHEMA_HUMAN_MESSAGE.replace("{json_info}", json.dumps(data)),
|
| 160 |
},
|
| 161 |
]
|
| 162 |
|