Skip to content

Examples and guides for using the OpenAI API

Fix the incorrect string formatting and ensure the subcategories variable is embedded in the prompt (#1770)

Yuichi Tanaka07fadb6707df
diff --git a/examples/How_to_combine_GPT4o_with_RAG_Outfit_Assistant.ipynb b/examples/How_to_combine_GPT4o_with_RAG_Outfit_Assistant.ipynb
index f1c18601..a29a52be 100644
--- a/examples/How_to_combine_GPT4o_with_RAG_Outfit_Assistant.ipynb
+++ b/examples/How_to_combine_GPT4o_with_RAG_Outfit_Assistant.ipynb
@@ -331,16 +331,16 @@
" \"content\": [\n",
" {\n",
" \"type\": \"text\",\n",
- " \"text\": \"\"\"Given an image of an item of clothing, analyze the item and generate a JSON output with the following fields: \"items\", \"category\", and \"gender\". \n",
+ " \"text\": f\"\"\"Given an image of an item of clothing, analyze the item and generate a JSON output with the following fields: \"items\", \"category\", and \"gender\".\n",
" Use your understanding of fashion trends, styles, and gender preferences to provide accurate and relevant suggestions for how to complete the outfit.\n",
" The items field should be a list of items that would go well with the item in the picture. Each item should represent a title of an item of clothing that contains the style, color, and gender of the item.\n",
" The category needs to be chosen between the types in this list: {subcategories}.\n",
" You have to choose between the genders in this list: [Men, Women, Boys, Girls, Unisex]\n",
" Do not include the description of the item in the picture. Do not include the ```json ``` tag in the output.\n",
- " \n",
+ "\n",
" Example Input: An image representing a black leather jacket.\n",
"\n",
- " Example Output: {\"items\": [\"Fitted White Women's T-shirt\", \"White Canvas Sneakers\", \"Women's Black Skinny Jeans\"], \"category\": \"Jackets\", \"gender\": \"Women\"}\n",
+ " Example Output: {{\"items\": [\"Fitted White Women's T-shirt\", \"White Canvas Sneakers\", \"Women's Black Skinny Jeans\"], \"category\": \"Jackets\", \"gender\": \"Women\"}}\n",
" \"\"\",\n",
" },\n",
" {\n",