outfit单品数量通过java传参控制
This commit is contained in:
@@ -21,6 +21,7 @@ class AgentRequestModel(BaseModel):
|
||||
stylist_path: str
|
||||
callback_url: str
|
||||
gender: str
|
||||
max_len: int
|
||||
|
||||
|
||||
class LCAgent(ls.LitAPI):
|
||||
@@ -39,7 +40,7 @@ class LCAgent(ls.LitAPI):
|
||||
)
|
||||
self.stylist_agent_kwages = {
|
||||
'local_db': self.vector_db,
|
||||
'max_len': 5,
|
||||
'max_len': 9,
|
||||
'gemini_model_name': settings.LLM_MODEL_NAME
|
||||
}
|
||||
self.outfit_ids = []
|
||||
@@ -80,7 +81,8 @@ class LCAgent(ls.LitAPI):
|
||||
num_outfits=request.num_outfits,
|
||||
user_id=request.user_id,
|
||||
gender=request.gender,
|
||||
callback_url=request.callback_url)
|
||||
callback_url=request.callback_url,
|
||||
max_len=request.max_len)
|
||||
logger.info("--- Final Recommendation Results ---")
|
||||
for i, path in enumerate(recommendation_results.get("successful_outfits", [])):
|
||||
logger.info(f"✅ Outfit {i + 1} saved to: {path}")
|
||||
@@ -101,7 +103,7 @@ class LCAgent(ls.LitAPI):
|
||||
return summary
|
||||
|
||||
async def recommend_outfit(self, request_summary: str, stylist_name: str, start_outfit=None, num_outfits: int = 1,
|
||||
user_id: str = "test", gender: str = "male", callback_url: str = None):
|
||||
user_id: str = "test", gender: str = "male", callback_url: str = None, max_len: str = 9):
|
||||
"""
|
||||
基于用户的对话历史和需求,推荐一套搭配。
|
||||
|
||||
@@ -115,6 +117,7 @@ class LCAgent(ls.LitAPI):
|
||||
task_map = {}
|
||||
for i in range(num_outfits):
|
||||
self.stylist_agent_kwages['outfit_id'] = self.outfit_ids[i]
|
||||
self.stylist_agent_kwages['max_len'] = max_len
|
||||
agent = AsyncStylistAgent(**self.stylist_agent_kwages)
|
||||
task = agent.run_styling_process(
|
||||
request_summary=request_summary,
|
||||
@@ -198,4 +201,4 @@ class LCAgent(ls.LitAPI):
|
||||
"successful_outfits": successful_outfits,
|
||||
"failed_outfits": failed_outfits,
|
||||
"error": ""
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user