新增 取消agent配饰(保留鞋子)推荐,改为默认随机配饰搭配
This commit is contained in:
@@ -20,9 +20,9 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class AsyncStylistAgent:
|
||||
CATEGORY_SET = {
|
||||
'Activewear', 'Dresses', 'Outerwear', 'Pants', 'Shirts & Tops', 'Skirts', 'Suits', 'Swimwear', 'Underwear'
|
||||
'Activewear', 'Dresses', 'Outerwear', 'Pants', 'Shirts & Tops', 'Skirts', 'Suits', 'Swimwear', 'Underwear', 'Shoes',
|
||||
# 取消推荐配饰
|
||||
# , 'Watches', 'Shopping Totes', 'Sunglasses', 'Handbags', 'Backpacks', 'Belts', 'Hats', 'Jewelry', 'Briefcases', 'Socks', 'Neckties', 'Shoes', 'Scarves & Shawls'
|
||||
# , 'Watches', 'Shopping Totes', 'Sunglasses', 'Handbags', 'Backpacks', 'Belts', 'Hats', 'Jewelry', 'Briefcases', 'Socks', 'Neckties', 'Scarves & Shawls'
|
||||
}
|
||||
CATEGORY_SET_ALL = {
|
||||
'Activewear', 'Dresses', 'Outerwear', 'Pants', 'Shirts & Tops', 'Skirts', 'Suits', 'Swimwear', 'Underwear',
|
||||
@@ -108,8 +108,8 @@ class AsyncStylistAgent:
|
||||
|
||||
## Your Workflow and Constraints
|
||||
|
||||
1. **Style Adherence**: You must strictly observe all rules in the Style Guide concerning **color palette, fit, layering principles, pattern restrictions coordination**.
|
||||
2. **Step Planning**: The styling sequence must follow a **top-down, inside-out** approach: major garments (tops/outerwear/bottoms/dresses).
|
||||
1. **Style Adherence**: You must strictly observe all rules in the Style Guide concerning **color palette, fit, layering principles, pattern restrictions , shoe coordination**.
|
||||
2. **Step Planning**: The styling sequence must follow a **top-down, inside-out** approach: First major garments (tops/outerwear/bottoms/dresses) then shoes.
|
||||
3. **Structured Output**: Every response must recommend the **next single item**. You must strictly use the **JSON format** for your output, as follows:
|
||||
|
||||
```json
|
||||
@@ -129,7 +129,10 @@ class AsyncStylistAgent:
|
||||
* **Role in the Outfit** (e.g., serves as the innermost base layer for layering; acts as the crucial tie accent for the smart casual look)
|
||||
|
||||
4. **Termination Condition**: Only when you deem the entire outfit complete and **all mandatory elements stipulated in the Style Guide are met**, you must output the following JSON format to terminate the process:
|
||||
|
||||
start 10:59:36,396
|
||||
fitst image 10:59:51,551
|
||||
fitst 完成11:00:34,672
|
||||
all 完成11:02:57,355
|
||||
```json
|
||||
{{
|
||||
"action": "stop",
|
||||
@@ -260,7 +263,7 @@ class AsyncStylistAgent:
|
||||
print(f"An error occurred during item retrieval: {e}")
|
||||
return None
|
||||
|
||||
def _get_random_accessories(self):
|
||||
async def _get_random_accessories(self):
|
||||
results = self.local_db.random_get_accessories()
|
||||
|
||||
# 3. 模拟 Agent 审核(实际应用中,你需要将图片发回给 Agent进行审核)
|
||||
@@ -343,7 +346,7 @@ class AsyncStylistAgent:
|
||||
logger.info(f"request data :{response_data} | JAVA callback info -> status:{response.status_code} | message:{response.text}")
|
||||
|
||||
# 新增配饰
|
||||
new_item = self._get_random_accessories()
|
||||
new_item = await self._get_random_accessories()
|
||||
self.outfit_items.append(new_item)
|
||||
user_input = self._build_user_input()
|
||||
gemini_response_text, response_data['path'] = await self._call_gemini(user_input, user_id)
|
||||
@@ -425,7 +428,7 @@ class AsyncStylistAgent:
|
||||
logger.info(f"request data :{response_data} | JAVA callback info -> status:{response.status_code} | message:{response.text}")
|
||||
|
||||
# 新增配饰
|
||||
new_item = self._get_random_accessories()
|
||||
new_item = await self._get_random_accessories()
|
||||
self.outfit_items.append(new_item)
|
||||
user_input = self._build_user_input()
|
||||
gemini_response_text, response_data['path'] = await self._call_gemini(user_input, user_id)
|
||||
|
||||
@@ -53,4 +53,4 @@ JSON FIELD REQUIREMENTS:
|
||||
- **style (string):** The overall aesthetic description (e.g., "Classic elegance", "Modern minimalist", "Bohemian vibe", "Edgy and contemporary").
|
||||
- **color_preference (string or list):** User's preferred or excluded colors/tones (e.g., "Light colors only", "Avoid deep shades", "['Cream', 'Pale Blue']", "No preference").
|
||||
- **clothing_type (string):** User's preference for specific garment types, material, or silhouette (e.g., "Lightweight maxi dress", "Skirt with silk blouse", "Tailored wide-leg pants", "Floral print").
|
||||
- **vibe_or_details (string):** Any other details, mood requirements, or specific constraints (e.g., "Needs to be comfortable and breathable", "Accent on accessories", "Must cover shoulders")."""
|
||||
- **vibe_or_details (string):** Any other details, mood requirements, or specific constraints (e.g., "Needs to be comfortable and breathable", "Must cover shoulders")."""
|
||||
@@ -68,6 +68,7 @@ class VectorDatabase():
|
||||
FILTER_CRITERIA = {
|
||||
"$and": [
|
||||
{"item_group_id": {"$ne": "Clothing"}},
|
||||
{"item_group_id": {"$ne": "Shoes"}}, # 新增:过滤 Shoes
|
||||
{"modality": "image"},
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user