Skip to content

Commit

Permalink
modify requirements; tune prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
XuHwang committed Oct 10, 2023
1 parent 914c04e commit 770c7b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 9 additions & 2 deletions llm4crs/agent_plan_first_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,16 +446,21 @@ def _summarize_recommendation(
"role": "system",
"content": "You are a conversational recommender assistant. "
"You are good at give comprehensive response to recommend some items to human. "
f"Items are retrieved by some useful tools: {OVERALL_TOOL_DESC.format( **self._domain_map)} \n"
f"Items are retrieved by some useful tools: \n"
"------\n"
f"{OVERALL_TOOL_DESC.format( **self._domain_map)} \n"
"------\n"
"You need to give some explainations for the recommendation according to the chat history with human.",
},
{
"role": "user",
"content": f"Previous Chat History: \n{prompt_map['history']}.\n\n"
"content": f"Previous Chat History: \n{prompt_map['history']}\n\n"
f"Human's Input:\n {prompt_map['input']}.\n\n"
f"Tool Execution Track:\n {self.candidate_buffer.track_info}.\n\n"
f"Execution Result: \n {tool_result}.\n\n"
"Please use those information to generate flexible and comprehensive response to human. Never tell the tool names to human.\n"
"Do remember if items in Execution Result do not meet human's requirement given in Human's Input "
"(such as brand not match, title not match and so on), apologize that you cannot found suitable items and suggest user to try the items in result.\n"
+ (
"Do not give details about items and make the response concise."
if self.reply_style == "concise"
Expand All @@ -472,6 +477,8 @@ def _summarize_recommendation(
f"Tool Execution Track:\n {self.candidate_buffer.track_info}.\n\n"
f"Execution Result: \n {tool_result}.\n\n"
"Please use those information to generate flexible and comprehensive response to human. Never tell the tool names to human.\n"
"Do remember if items in Execution Result do not meet human's requirement given in Human's Input "
"(such as brand not match, title not match and so on), apologize that you cannot found suitable items and suggest user to try the items in result.\n"
+ (
"Do not give details about items and make the response concise."
if self.reply_style == "concise"
Expand Down
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ tiktoken==0.4.0
guidance==0.0.64
SQLAlchemy==1.4.46
--extra-index-url https://download.pytorch.org/whl/cu113
torch==1.13.1
torchvision==0.13.1
torchaudio==0.12.1
torch==1.12.1
unirec==0.0.1a2

0 comments on commit 770c7b6

Please sign in to comment.