PR #30
#30
by
aqhg
- opened
- rewards/microsoft-teams.py +935 -0
- tasks/salesforce/change-case-status.json +1 -0
- tasks/salesforce/change-lead-status.json +1 -0
- tasks/salesforce/convert-lead-to-contact.json +1 -0
- tasks/salesforce/create-and-close-case.json +1 -0
- tasks/salesforce/create-and-convert-lead.json +1 -0
- tasks/salesforce/create-new-case.json +1 -0
- tasks/salesforce/create-new-lead.json +1 -0
- tasks/salesforce/edit-lead-inline.json +1 -0
- tasks/salesforce/open-edit-case-dialog.json +1 -0
- tasks/salesforce/open-new-case-dialog.json +1 -0
- tasks/salesforce/open-new-contact-dialog.json +1 -0
- tasks/salesforce/open-new-lead-dialog.json +1 -0
- tasks/salesforce/open-new-opportunity-dialog.json +1 -0
rewards/microsoft-teams.py
ADDED
|
@@ -0,0 +1,935 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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# === Easy ===
|
| 8 |
+
def _validate_respond_to_hermione(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 9 |
+
"""
|
| 10 |
+
Reward function that checks if the user has sent the message
|
| 11 |
+
"Sure thing - it looks good!" to Hermione.
|
| 12 |
+
|
| 13 |
+
Args:
|
| 14 |
+
state: The current SPA state as a dictionary
|
| 15 |
+
|
| 16 |
+
Returns:
|
| 17 |
+
Tuple of (reward, message)
|
| 18 |
+
reward = 1.0 if message sent, 0.0 otherwise
|
| 19 |
+
"""
|
| 20 |
+
user_id = "you"
|
| 21 |
+
target_conversation_id = "hermione-granger"
|
| 22 |
+
expected_content = "Sure thing - it looks good!"
|
| 23 |
+
|
| 24 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 25 |
+
|
| 26 |
+
# Find Hermione's conversation
|
| 27 |
+
hermione_convo = None
|
| 28 |
+
for convo in messages:
|
| 29 |
+
if convo.get("conversationId") == target_conversation_id:
|
| 30 |
+
hermione_convo = convo
|
| 31 |
+
break
|
| 32 |
+
|
| 33 |
+
if hermione_convo is None:
|
| 34 |
+
return 0.0, "Hermione's conversation not found."
|
| 35 |
+
|
| 36 |
+
# Check if the expected message exists in the conversation
|
| 37 |
+
for msg in hermione_convo.get("messages", []):
|
| 38 |
+
if msg.get("senderId") == user_id and msg.get("content") == expected_content:
|
| 39 |
+
return 1.0, "Success! The expected message was sent to Hermione."
|
| 40 |
+
|
| 41 |
+
return 0.0, f"Message not sent. Expected: '{expected_content}'"
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def _validate_message_tim_white_twice(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 45 |
+
"""
|
| 46 |
+
Reward function that checks if the user has sent two specific messages
|
| 47 |
+
to Tim White.
|
| 48 |
+
|
| 49 |
+
Args:
|
| 50 |
+
initial_state: The initial SPA state as a dictionary
|
| 51 |
+
final_state: The final SPA state as a dictionary
|
| 52 |
+
|
| 53 |
+
Returns:
|
| 54 |
+
Tuple of (reward, message)
|
| 55 |
+
reward = 1.0 if both messages sent, 0.0 otherwise
|
| 56 |
+
"""
|
| 57 |
+
user_id = "you"
|
| 58 |
+
target_conversation_id = "tim-white"
|
| 59 |
+
expected_messages = [
|
| 60 |
+
"Hey Tim, smoke test completed.",
|
| 61 |
+
"Let me know if you need a hand with anything."
|
| 62 |
+
]
|
| 63 |
+
|
| 64 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 65 |
+
|
| 66 |
+
# Find Tim White's conversation
|
| 67 |
+
tim_convo = None
|
| 68 |
+
for convo in messages:
|
| 69 |
+
if convo.get("conversationId") == target_conversation_id:
|
| 70 |
+
tim_convo = convo
|
| 71 |
+
break
|
| 72 |
+
|
| 73 |
+
if tim_convo is None:
|
| 74 |
+
return 0.0, "Tim White's conversation not found."
|
| 75 |
+
|
| 76 |
+
# Check if both expected messages exist in the conversation
|
| 77 |
+
sent_messages = [msg.get("content") for msg in tim_convo.get("messages", []) if msg.get("senderId") == user_id]
|
| 78 |
+
missing = [msg for msg in expected_messages if msg not in sent_messages]
|
| 79 |
+
|
| 80 |
+
if not missing:
|
| 81 |
+
return 1.0, "Success! Both messages were sent to Tim White."
|
| 82 |
+
else:
|
| 83 |
+
return 0.0, f"Message(s) not sent: {missing}"
|
| 84 |
+
|
| 85 |
+
def _validate_harry_hagrid_harry_hagrid(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 86 |
+
"""
|
| 87 |
+
Reward function that checks if the user completed the sequence:
|
| 88 |
+
1. Messaged Harry: "Hey Harry, can we reschedule to 2? I have a meeting with Hagrid."
|
| 89 |
+
2. Messaged Hagrid: "Hey Hagrid, should be all good - I'll let you know asap."
|
| 90 |
+
3. Messaged Harry: "Good to hear - see you at 2!"
|
| 91 |
+
4. Messaged Hagrid: "Harry said yes, I'll see you at 12 then!"
|
| 92 |
+
|
| 93 |
+
Args:
|
| 94 |
+
initial_state: The starting SPA state
|
| 95 |
+
final_state: The final SPA state after user actions
|
| 96 |
+
|
| 97 |
+
Returns:
|
| 98 |
+
Tuple of (reward, message)
|
| 99 |
+
reward = 1.0 if all messages are correctly sent, 0.0 otherwise
|
| 100 |
+
"""
|
| 101 |
+
user_id = "you"
|
| 102 |
+
harry_convo_id = "harry-potter"
|
| 103 |
+
hagrid_convo_id = "hagrid-cao"
|
| 104 |
+
|
| 105 |
+
expected_messages = {
|
| 106 |
+
harry_convo_id: [
|
| 107 |
+
"Hey Harry, can we reschedule to 2? I have a meeting with Hagrid.",
|
| 108 |
+
"Good to hear - see you at 2!"
|
| 109 |
+
],
|
| 110 |
+
hagrid_convo_id: [
|
| 111 |
+
"Hey Hagrid, should be all good - I'll let you know asap.",
|
| 112 |
+
"Harry said yes, I'll see you at 12 then!"
|
| 113 |
+
]
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 117 |
+
found: dict[str, list[str]] = {harry_convo_id: [], hagrid_convo_id: []}
|
| 118 |
+
|
| 119 |
+
for convo in messages:
|
| 120 |
+
convo_id = convo.get("conversationId")
|
| 121 |
+
if convo_id in expected_messages:
|
| 122 |
+
for msg in convo.get("messages", []):
|
| 123 |
+
if msg.get("senderId") == user_id:
|
| 124 |
+
content = msg.get("content", "")
|
| 125 |
+
if content in expected_messages[convo_id]:
|
| 126 |
+
found[convo_id].append(content)
|
| 127 |
+
|
| 128 |
+
harry_msgs = set(found[harry_convo_id])
|
| 129 |
+
hagrid_msgs = set(found[hagrid_convo_id])
|
| 130 |
+
|
| 131 |
+
harry_ok = harry_msgs == set(expected_messages[harry_convo_id])
|
| 132 |
+
hagrid_ok = hagrid_msgs == set(expected_messages[hagrid_convo_id])
|
| 133 |
+
|
| 134 |
+
if harry_ok and hagrid_ok:
|
| 135 |
+
return 1.0, "Success! All messages were correctly sent to Harry and Hagrid in both chats."
|
| 136 |
+
|
| 137 |
+
missing: list[str] = []
|
| 138 |
+
for convo_id, expected in expected_messages.items():
|
| 139 |
+
convo_name = "Harry" if convo_id == harry_convo_id else "Hagrid"
|
| 140 |
+
missing_msgs = [m for m in expected if m not in found[convo_id]]
|
| 141 |
+
if missing_msgs:
|
| 142 |
+
missing.append(f"{convo_name}: {missing_msgs}")
|
| 143 |
+
|
| 144 |
+
return 0.0, f"Some messages are missing or incorrect: {', '.join(missing)}"
|
| 145 |
+
|
| 146 |
+
def _validate_open_search_page_for_hagrid(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 147 |
+
"""
|
| 148 |
+
Reward function that checks if the user opened the search page for Hagrid.
|
| 149 |
+
|
| 150 |
+
Args:
|
| 151 |
+
initial_state: The SPA state before user action
|
| 152 |
+
final_state: The SPA state after user action
|
| 153 |
+
|
| 154 |
+
Returns:
|
| 155 |
+
Tuple of (reward, message)
|
| 156 |
+
reward = 1.0 if the search page shows results for Hagrid, 0.0 otherwise
|
| 157 |
+
"""
|
| 158 |
+
expected_search_term = "hagrid"
|
| 159 |
+
expected_page = "SEARCH"
|
| 160 |
+
expected_search_page_type = "PEOPLE"
|
| 161 |
+
|
| 162 |
+
# Check if the search page is open
|
| 163 |
+
page = final_state.get("page")
|
| 164 |
+
search_page = final_state.get("searchPage")
|
| 165 |
+
search_term = final_state.get("searchTerm", "").lower()
|
| 166 |
+
|
| 167 |
+
if page != expected_page:
|
| 168 |
+
return 0.0, f"Wrong page open: {page}. Expected HOME → SEARCH."
|
| 169 |
+
|
| 170 |
+
if search_page != expected_search_page_type:
|
| 171 |
+
return 0.0, f"Search page type is '{search_page}', expected '{expected_search_page_type}'."
|
| 172 |
+
|
| 173 |
+
if search_term != expected_search_term:
|
| 174 |
+
return 0.0, f"Search term is '{search_term}', expected '{expected_search_term}'."
|
| 175 |
+
|
| 176 |
+
return 1.0, "Success! Hagrid's search page is open and ready."
|
| 177 |
+
|
| 178 |
+
def _validate_prepare_to_make_a_new_chat(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 179 |
+
"""
|
| 180 |
+
Reward function that checks if the user has selected the new chat icon
|
| 181 |
+
and entered the new chat screen.
|
| 182 |
+
|
| 183 |
+
Args:
|
| 184 |
+
initial_state: The SPA state before the action
|
| 185 |
+
final_state: The SPA state after the action
|
| 186 |
+
|
| 187 |
+
Returns:
|
| 188 |
+
Tuple of (reward, message)
|
| 189 |
+
reward = 1.0 if the new chat screen is shown, 0.0 otherwise
|
| 190 |
+
"""
|
| 191 |
+
# Check if the SPA has transitioned to creating a new chat
|
| 192 |
+
creating_chat = final_state.get("creatingChat", False)
|
| 193 |
+
|
| 194 |
+
if creating_chat:
|
| 195 |
+
return 1.0, "Success! The new chat screen is now shown."
|
| 196 |
+
|
| 197 |
+
return 0.0, "New chat screen not shown. Make sure the new chat icon was clicked."
|
| 198 |
+
|
| 199 |
+
def _validate_filter_chats_for_harry(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 200 |
+
"""
|
| 201 |
+
Reward function that checks if the sidebar chats are filtered
|
| 202 |
+
for the name 'harry', meaning only Harry Potter's chat is shown.
|
| 203 |
+
|
| 204 |
+
Args:
|
| 205 |
+
state: The current SPA state as a dictionary.
|
| 206 |
+
|
| 207 |
+
Returns:
|
| 208 |
+
Tuple of (reward, message)
|
| 209 |
+
reward = 1.0 if only Harry Potter's chat is displayed after filtering,
|
| 210 |
+
0.0 otherwise.
|
| 211 |
+
"""
|
| 212 |
+
target_filter = "harry"
|
| 213 |
+
|
| 214 |
+
# Extract filtering info
|
| 215 |
+
filter_string: str = final_state.get("filterString", "")
|
| 216 |
+
filtering: bool = final_state.get("filtering", False)
|
| 217 |
+
# messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 218 |
+
|
| 219 |
+
# If filtering not active or filter string is wrong
|
| 220 |
+
if (not filtering):
|
| 221 |
+
return 0.0, "Filtering is not active."
|
| 222 |
+
if (filter_string.lower() != target_filter):
|
| 223 |
+
return 0.0, f"Expected filter string '{target_filter}', got '{filter_string}'."
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
return 1.0, "Success! Filters for Harry potter's chat."
|
| 227 |
+
|
| 228 |
+
def _validate_navigate_to_harrys_files_page(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 229 |
+
"""
|
| 230 |
+
Reward function that checks if the user has navigated to Harry's files page.
|
| 231 |
+
|
| 232 |
+
Args:
|
| 233 |
+
initial_state: The initial SPA state as a dictionary
|
| 234 |
+
final_state: The final SPA state as a dictionary
|
| 235 |
+
|
| 236 |
+
Returns:
|
| 237 |
+
Tuple of (reward, message)
|
| 238 |
+
reward = 1.0 if files page is open, 0.0 otherwise
|
| 239 |
+
"""
|
| 240 |
+
expected_page = "FILES"
|
| 241 |
+
current_page = final_state.get("mainChatPage", "")
|
| 242 |
+
|
| 243 |
+
if current_page == expected_page:
|
| 244 |
+
return 1.0, "Success! The files page is open."
|
| 245 |
+
|
| 246 |
+
return 0.0, f"Files page not open. Current page: '{current_page}'"
|
| 247 |
+
|
| 248 |
+
def _validate_navigate_to_harrys_photos_page(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 249 |
+
"""
|
| 250 |
+
Reward function that checks if the user has navigated to Harry's photos page.
|
| 251 |
+
|
| 252 |
+
Args:
|
| 253 |
+
initial_state: The initial SPA state as a dictionary
|
| 254 |
+
final_state: The final SPA state as a dictionary
|
| 255 |
+
|
| 256 |
+
Returns:
|
| 257 |
+
Tuple of (reward, message)
|
| 258 |
+
reward = 1.0 if files page is open, 0.0 otherwise
|
| 259 |
+
"""
|
| 260 |
+
expected_page = "PHOTOS"
|
| 261 |
+
current_page = final_state.get("mainChatPage", "")
|
| 262 |
+
|
| 263 |
+
if current_page == expected_page:
|
| 264 |
+
return 1.0, "Success! The photos page is open."
|
| 265 |
+
|
| 266 |
+
return 0.0, f"Photos page not open. Current page: '{current_page}'"
|
| 267 |
+
|
| 268 |
+
|
| 269 |
+
|
| 270 |
+
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
# === Medium ===
|
| 274 |
+
def _validate_message_hermione_and_then_tim(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 275 |
+
"""
|
| 276 |
+
Reward function that checks if the user has:
|
| 277 |
+
1. Sent Hermione the message "All done. Let me know if you get it!"
|
| 278 |
+
2. Sent Tim the message "Smoke tested! Should be with you shortly."
|
| 279 |
+
|
| 280 |
+
Args:
|
| 281 |
+
initial_state: The initial SPA state
|
| 282 |
+
final_state: The final SPA state after user interaction
|
| 283 |
+
|
| 284 |
+
Returns:
|
| 285 |
+
Tuple of (reward, message)
|
| 286 |
+
reward = 1.0 if both messages were sent correctly, 0.5 if only one was sent, 0.0 otherwise
|
| 287 |
+
"""
|
| 288 |
+
user_id = "you"
|
| 289 |
+
|
| 290 |
+
# Define targets
|
| 291 |
+
hermione_conversation_id = "hermione-granger"
|
| 292 |
+
tim_conversation_id = "tim-white"
|
| 293 |
+
|
| 294 |
+
expected_hermione_msg = "All done. Let me know if you get it!"
|
| 295 |
+
expected_tim_msg = "Smoke tested! Should be with you shortly."
|
| 296 |
+
|
| 297 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 298 |
+
|
| 299 |
+
# Helper to find a conversation by ID
|
| 300 |
+
def find_convo(convo_id: str) -> Dict[str, Any]:
|
| 301 |
+
for convo in messages:
|
| 302 |
+
if convo.get("conversationId") == convo_id:
|
| 303 |
+
return convo
|
| 304 |
+
return {}
|
| 305 |
+
|
| 306 |
+
# Check Hermione convo
|
| 307 |
+
hermione_convo = find_convo(hermione_conversation_id)
|
| 308 |
+
hermione_msg_sent = any(
|
| 309 |
+
msg.get("senderId") == user_id and msg.get("content") == expected_hermione_msg
|
| 310 |
+
for msg in hermione_convo.get("messages", [])
|
| 311 |
+
) if hermione_convo else False
|
| 312 |
+
|
| 313 |
+
# Check Tim convo
|
| 314 |
+
tim_convo = find_convo(tim_conversation_id)
|
| 315 |
+
tim_msg_sent = any(
|
| 316 |
+
msg.get("senderId") == user_id and msg.get("content") == expected_tim_msg
|
| 317 |
+
for msg in tim_convo.get("messages", [])
|
| 318 |
+
) if tim_convo else False
|
| 319 |
+
|
| 320 |
+
# Reward logic
|
| 321 |
+
if hermione_msg_sent and tim_msg_sent:
|
| 322 |
+
return 1.0, "Success! Messages sent to both Hermione and Tim."
|
| 323 |
+
elif hermione_msg_sent or tim_msg_sent:
|
| 324 |
+
missing = "Tim" if hermione_msg_sent else "Hermione"
|
| 325 |
+
return 0.5, f"Partially complete. Missing message to {missing}."
|
| 326 |
+
else:
|
| 327 |
+
return 0.0, "Messages not sent to either Hermione or Tim."
|
| 328 |
+
|
| 329 |
+
|
| 330 |
+
def _validate_make_a_group_chat_with_hagrid_and_ron(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 331 |
+
"""
|
| 332 |
+
Reward function that checks if the user has created a group chat
|
| 333 |
+
including Hagrid and Ron, and sent the message "Hey guys!".
|
| 334 |
+
|
| 335 |
+
Args:
|
| 336 |
+
initial_state: The initial SPA state as a dictionary
|
| 337 |
+
final_state: The final SPA state as a dictionary
|
| 338 |
+
|
| 339 |
+
Returns:
|
| 340 |
+
Tuple of (reward, message)
|
| 341 |
+
reward = 1.0 if the correct group chat was created and message sent, 0.0 otherwise
|
| 342 |
+
"""
|
| 343 |
+
user_id = "you"
|
| 344 |
+
expected_participants = {"hagrid-cao", "ron-weasley"}
|
| 345 |
+
expected_message = "Hey guys!"
|
| 346 |
+
|
| 347 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 348 |
+
if not messages:
|
| 349 |
+
return 0.0, "No messages found in final state."
|
| 350 |
+
|
| 351 |
+
# Look for a new conversation containing both Hagrid and Ron
|
| 352 |
+
for convo in messages:
|
| 353 |
+
user_ids = set(convo.get("userIds", []))
|
| 354 |
+
if expected_participants.issubset(user_ids):
|
| 355 |
+
# Check that the user sent "Hey guys!" in this conversation
|
| 356 |
+
for msg in convo.get("messages", []):
|
| 357 |
+
if msg.get("senderId") == user_id and msg.get("content") == expected_message:
|
| 358 |
+
return 1.0, "Success! Created group chat with Hagrid and Ron and sent 'Hey guys!'."
|
| 359 |
+
return 0.0, "Group chat found, but expected message not sent."
|
| 360 |
+
|
| 361 |
+
return 0.0, "No group chat found with both Hagrid and Ron."
|
| 362 |
+
|
| 363 |
+
|
| 364 |
+
def _validate_create_a_chat_with_fred_weasely(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 365 |
+
"""
|
| 366 |
+
Reward function that checks if a new chat was created with Fred Weasley
|
| 367 |
+
and the message "Hey Fred, how are you!" was sent.
|
| 368 |
+
|
| 369 |
+
Args:
|
| 370 |
+
state: The current SPA state as a dictionary.
|
| 371 |
+
|
| 372 |
+
Returns:
|
| 373 |
+
Tuple of (reward, message)
|
| 374 |
+
reward = 1.0 if chat created and message sent, 0.0 otherwise.
|
| 375 |
+
"""
|
| 376 |
+
user_id = "you"
|
| 377 |
+
target_conversation_id = "fred-weasley"
|
| 378 |
+
expected_content = "Hey Fred, how are you!"
|
| 379 |
+
|
| 380 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 381 |
+
|
| 382 |
+
# Find Fred's conversation
|
| 383 |
+
fred_convo = None
|
| 384 |
+
for convo in messages:
|
| 385 |
+
if convo.get("conversationId") == target_conversation_id:
|
| 386 |
+
fred_convo = convo
|
| 387 |
+
break
|
| 388 |
+
|
| 389 |
+
if fred_convo is None:
|
| 390 |
+
return 0.0, "Conversation with Fred Weasley not found. Make sure you started a new chat."
|
| 391 |
+
|
| 392 |
+
# Check if the expected message exists in the conversation
|
| 393 |
+
for msg in fred_convo.get("messages", []):
|
| 394 |
+
if msg.get("senderId") == user_id and msg.get("content") == expected_content:
|
| 395 |
+
return 1.0, "Success! Chat with Fred Weasley created and message sent."
|
| 396 |
+
|
| 397 |
+
return 0.0, f"Message not found in Fred's chat. Expected: '{expected_content}'"
|
| 398 |
+
|
| 399 |
+
def _validate_message_tim_and_select_hermiones_photos(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 400 |
+
"""
|
| 401 |
+
Reward function that validates whether:
|
| 402 |
+
1. The user sent "Hey Tim, it's me" to Tim White.
|
| 403 |
+
2. The user navigated to Hermione's chat and selected the Photos tab.
|
| 404 |
+
|
| 405 |
+
Args:
|
| 406 |
+
initial_state: The SPA's starting state as a dictionary.
|
| 407 |
+
final_state: The SPA's ending state as a dictionary.
|
| 408 |
+
|
| 409 |
+
Returns:
|
| 410 |
+
Tuple of (reward, message)
|
| 411 |
+
reward = 1.0 if both actions are complete, 0.5 if only message is sent,
|
| 412 |
+
0.0 otherwise.
|
| 413 |
+
"""
|
| 414 |
+
|
| 415 |
+
user_id = "you"
|
| 416 |
+
tim_conversation_id = "tim-white"
|
| 417 |
+
hermione_conversation_id = "hermione-granger"
|
| 418 |
+
expected_message = "Hey Tim, it's me"
|
| 419 |
+
|
| 420 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 421 |
+
|
| 422 |
+
# --- Step 1: Check message to Tim ---
|
| 423 |
+
tim_convo = None
|
| 424 |
+
for convo in messages:
|
| 425 |
+
if convo.get("conversationId") == tim_conversation_id:
|
| 426 |
+
tim_convo = convo
|
| 427 |
+
break
|
| 428 |
+
|
| 429 |
+
message_sent = False
|
| 430 |
+
if tim_convo:
|
| 431 |
+
for msg in tim_convo.get("messages", []):
|
| 432 |
+
if msg.get("senderId") == user_id and msg.get("content") == expected_message:
|
| 433 |
+
message_sent = True
|
| 434 |
+
break
|
| 435 |
+
|
| 436 |
+
# --- Step 2: Check Hermione's chat and Photos tab ---
|
| 437 |
+
active_convo = final_state.get("msgId")
|
| 438 |
+
active_tab = final_state.get("mainChatPage")
|
| 439 |
+
|
| 440 |
+
on_hermione_photos = (
|
| 441 |
+
active_convo == hermione_conversation_id
|
| 442 |
+
and active_tab == "PHOTOS"
|
| 443 |
+
)
|
| 444 |
+
|
| 445 |
+
# --- Combine results ---
|
| 446 |
+
if message_sent and on_hermione_photos:
|
| 447 |
+
return 1.0, "Success! Message sent to Tim and Hermione's Photos tab is open."
|
| 448 |
+
elif message_sent:
|
| 449 |
+
return 0.5, "Partial success. Message sent to Tim, but not on Hermione's Photos tab."
|
| 450 |
+
else:
|
| 451 |
+
return 0.0, "Message to Tim not sent yet, and Hermione's Photos tab not open."
|
| 452 |
+
|
| 453 |
+
def _validate_search_for_messages_containing_hey(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 454 |
+
"""
|
| 455 |
+
Reward function that checks if a search for 'hey' was performed and
|
| 456 |
+
if the result containing "Hey Hugo — are we still on for Friday at 12pm?" is shown.
|
| 457 |
+
|
| 458 |
+
Args:
|
| 459 |
+
initial_state: The initial SPA state as a dictionary
|
| 460 |
+
final_state: The final SPA state as a dictionary
|
| 461 |
+
|
| 462 |
+
Returns:
|
| 463 |
+
Tuple of (reward, message)
|
| 464 |
+
reward = 1.0 if search result is present, 0.0 otherwise
|
| 465 |
+
"""
|
| 466 |
+
expected_message_content = "Hey Hugo — are we still on for Friday at 12pm?"
|
| 467 |
+
|
| 468 |
+
# Check if the user navigated to the MESSAGES tab in the search page
|
| 469 |
+
if final_state.get("page") != "SEARCH" or final_state.get("searchPage") != "MESSAGES":
|
| 470 |
+
return 0.0, "User did not navigate to the messages tab after searching."
|
| 471 |
+
|
| 472 |
+
# Look through all messages in the final state
|
| 473 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 474 |
+
for convo in messages:
|
| 475 |
+
for msg in convo.get("messages", []):
|
| 476 |
+
if expected_message_content in msg.get("content", ""):
|
| 477 |
+
return 1.0, f"Success! Found expected message: '{expected_message_content}'"
|
| 478 |
+
|
| 479 |
+
return 0.0, f"Message not found. Expected: '{expected_message_content}'"
|
| 480 |
+
|
| 481 |
+
|
| 482 |
+
def _validate_message_tim_and_alex_langford(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 483 |
+
"""
|
| 484 |
+
Reward function that checks if the user sent the message
|
| 485 |
+
"Smoke test finished, looks good!" to Tim and also started a
|
| 486 |
+
new conversation with Alex Langford, sending "Good to see you Alex!".
|
| 487 |
+
|
| 488 |
+
Args:
|
| 489 |
+
initial_state: The initial SPA state as a dictionary
|
| 490 |
+
final_state: The final SPA state as a dictionary
|
| 491 |
+
|
| 492 |
+
Returns:
|
| 493 |
+
Tuple[float, str]:
|
| 494 |
+
reward = 1.0 if both conditions met,
|
| 495 |
+
0.5 if only one of them is met,
|
| 496 |
+
0.0 otherwise.
|
| 497 |
+
message = explanation of result.
|
| 498 |
+
"""
|
| 499 |
+
user_id = "you"
|
| 500 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 501 |
+
|
| 502 |
+
# --- Targets ---
|
| 503 |
+
tim_convo_id = "tim-white"
|
| 504 |
+
tim_expected_content = "Smoke test finished, looks good!"
|
| 505 |
+
|
| 506 |
+
alex_convo_id = "alex-langford"
|
| 507 |
+
alex_expected_content = "Good to see you Alex!"
|
| 508 |
+
|
| 509 |
+
tim_message_sent = False
|
| 510 |
+
alex_message_sent = False
|
| 511 |
+
|
| 512 |
+
# Check Tim’s conversation
|
| 513 |
+
for convo in messages:
|
| 514 |
+
if convo.get("conversationId") == tim_convo_id:
|
| 515 |
+
for msg in convo.get("messages", []):
|
| 516 |
+
if msg.get("senderId") == user_id and msg.get("content") == tim_expected_content:
|
| 517 |
+
tim_message_sent = True
|
| 518 |
+
break
|
| 519 |
+
|
| 520 |
+
# Check Alex’s conversation (it must exist and have the message)
|
| 521 |
+
for convo in messages:
|
| 522 |
+
if convo.get("conversationId") == alex_convo_id:
|
| 523 |
+
for msg in convo.get("messages", []):
|
| 524 |
+
if msg.get("senderId") == user_id and msg.get("content") == alex_expected_content:
|
| 525 |
+
alex_message_sent = True
|
| 526 |
+
break
|
| 527 |
+
|
| 528 |
+
# --- Scoring logic ---
|
| 529 |
+
if tim_message_sent and alex_message_sent:
|
| 530 |
+
return 1.0, "Success! Messages sent to both Tim and Alex."
|
| 531 |
+
elif tim_message_sent:
|
| 532 |
+
return 0.5, "Partial success: message sent to Tim, but not to Alex."
|
| 533 |
+
elif alex_message_sent:
|
| 534 |
+
return 0.5, "Partial success: message sent to Alex, but not to Tim."
|
| 535 |
+
else:
|
| 536 |
+
return 0.0, "No valid messages sent to Tim or Alex."
|
| 537 |
+
|
| 538 |
+
|
| 539 |
+
|
| 540 |
+
|
| 541 |
+
|
| 542 |
+
|
| 543 |
+
# === Hard ===
|
| 544 |
+
def _validate_large_group_chat(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 545 |
+
"""
|
| 546 |
+
Reward function that checks if the user has created a group chat with
|
| 547 |
+
Harry Potter, Hermione Granger, Tim White, and Tim White 2,
|
| 548 |
+
and sent the message 'What a group chat!'.
|
| 549 |
+
|
| 550 |
+
Args:
|
| 551 |
+
initial_state: The initial SPA state as a dictionary
|
| 552 |
+
final_state: The final SPA state as a dictionary
|
| 553 |
+
|
| 554 |
+
Returns:
|
| 555 |
+
Tuple of (reward, message)
|
| 556 |
+
reward = 1.0 if the group chat and message exist, 0.0 otherwise
|
| 557 |
+
"""
|
| 558 |
+
user_id = "you"
|
| 559 |
+
expected_users = {"harry-potter", "hermione-granger", "tim-white", "tim-white-2"}
|
| 560 |
+
expected_message = "What a group chat!"
|
| 561 |
+
|
| 562 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 563 |
+
|
| 564 |
+
# Find a conversation that has exactly the expected users
|
| 565 |
+
group_convo = None
|
| 566 |
+
for convo in messages:
|
| 567 |
+
convo_users = set(convo.get("userIds", []))
|
| 568 |
+
if convo_users == expected_users:
|
| 569 |
+
group_convo = convo
|
| 570 |
+
break
|
| 571 |
+
|
| 572 |
+
if group_convo is None:
|
| 573 |
+
return 0.0, "Group chat with the required users not found."
|
| 574 |
+
|
| 575 |
+
# Check if the expected message was sent by the user in that chat
|
| 576 |
+
for msg in group_convo.get("messages", []):
|
| 577 |
+
if msg.get("senderId") == user_id and msg.get("content") == expected_message:
|
| 578 |
+
return 1.0, "Success! Group chat created and message sent."
|
| 579 |
+
|
| 580 |
+
return 0.0, f"Message not found in the group chat. Expected: '{expected_message}'"
|
| 581 |
+
|
| 582 |
+
def _validate_message_hermione_and_search_for_it(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 583 |
+
"""
|
| 584 |
+
Reward function that verifies:
|
| 585 |
+
1. The user sent the message "All good Hermione, it's finished." to Hermione.
|
| 586 |
+
2. The user performed a search for 'Hermi' and opened the 'messages' tab.
|
| 587 |
+
|
| 588 |
+
Args:
|
| 589 |
+
initial_state: The initial SPA state as a dictionary.
|
| 590 |
+
final_state: The final SPA state as a dictionary.
|
| 591 |
+
|
| 592 |
+
Returns:
|
| 593 |
+
Tuple of (reward, message)
|
| 594 |
+
reward = 1.0 if both conditions are met, partial reward if only one is met.
|
| 595 |
+
"""
|
| 596 |
+
user_id = "you"
|
| 597 |
+
target_conversation_id = "hermione-granger"
|
| 598 |
+
expected_content = "All good Hermione, it's finished."
|
| 599 |
+
expected_search_term = "Hermi"
|
| 600 |
+
expected_search_page = "MESSAGES"
|
| 601 |
+
|
| 602 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 603 |
+
|
| 604 |
+
# Step 1: Verify Hermione's conversation and message
|
| 605 |
+
hermione_convo = None
|
| 606 |
+
for convo in messages:
|
| 607 |
+
if convo.get("conversationId") == target_conversation_id:
|
| 608 |
+
hermione_convo = convo
|
| 609 |
+
break
|
| 610 |
+
|
| 611 |
+
if hermione_convo is None:
|
| 612 |
+
return 0.0, "Hermione's conversation not found."
|
| 613 |
+
|
| 614 |
+
sent_message = any(
|
| 615 |
+
msg.get("senderId") == user_id and msg.get("content") == expected_content
|
| 616 |
+
for msg in hermione_convo.get("messages", [])
|
| 617 |
+
)
|
| 618 |
+
|
| 619 |
+
# Step 2: Verify search term and tab
|
| 620 |
+
search_term = final_state.get("searchTerm", "")
|
| 621 |
+
search_page = final_state.get("searchPage", "")
|
| 622 |
+
on_search_page = final_state.get("page") == "SEARCH"
|
| 623 |
+
|
| 624 |
+
correct_search = (
|
| 625 |
+
on_search_page and
|
| 626 |
+
search_term == expected_search_term and
|
| 627 |
+
search_page == expected_search_page
|
| 628 |
+
)
|
| 629 |
+
|
| 630 |
+
# Evaluate total reward
|
| 631 |
+
if sent_message and correct_search:
|
| 632 |
+
return 1.0, "Success! You messaged Hermione and searched for it correctly."
|
| 633 |
+
elif sent_message:
|
| 634 |
+
return 0.5, "Message sent, but search not completed correctly."
|
| 635 |
+
elif correct_search:
|
| 636 |
+
return 0.5, "Search was correct, but Hermione’s message wasn’t sent."
|
| 637 |
+
else:
|
| 638 |
+
return 0.0, "Neither the message nor the search action were completed correctly."
|
| 639 |
+
|
| 640 |
+
|
| 641 |
+
def _validate_message_the_third_user_in_the_search(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 642 |
+
"""
|
| 643 |
+
Reward function that checks if the user has messaged the third user in the
|
| 644 |
+
search list ("Anne Peters") with the message "Hi Anne, it's me."
|
| 645 |
+
|
| 646 |
+
Args:
|
| 647 |
+
initial_state: The starting SPA state as a dictionary
|
| 648 |
+
final_state: The resulting SPA state as a dictionary
|
| 649 |
+
|
| 650 |
+
Returns:
|
| 651 |
+
Tuple of (reward, message)
|
| 652 |
+
reward = 1.0 if message sent correctly, 0.0 otherwise
|
| 653 |
+
"""
|
| 654 |
+
user_id = "you"
|
| 655 |
+
target_conversation_id = "anne-peters"
|
| 656 |
+
expected_content = "Hi Anne, it's me."
|
| 657 |
+
|
| 658 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 659 |
+
|
| 660 |
+
# Locate Anne's conversation
|
| 661 |
+
anne_convo = None
|
| 662 |
+
for convo in messages:
|
| 663 |
+
if convo.get("conversationId") == target_conversation_id:
|
| 664 |
+
anne_convo = convo
|
| 665 |
+
break
|
| 666 |
+
|
| 667 |
+
if anne_convo is None:
|
| 668 |
+
return 0.0, "Anne's conversation not found — looks like you didn't message her."
|
| 669 |
+
|
| 670 |
+
# Check if the expected message exists
|
| 671 |
+
for msg in anne_convo.get("messages", []):
|
| 672 |
+
if msg.get("senderId") == user_id and msg.get("content") == expected_content:
|
| 673 |
+
return 1.0, "Nice! You successfully messaged Anne Peters with the correct text."
|
| 674 |
+
|
| 675 |
+
return 0.0, f"Message not sent or incorrect. Expected: '{expected_content}'"
|
| 676 |
+
|
| 677 |
+
# _validate_harry_hagrid_harry_hagrid
|
| 678 |
+
def _validate_message_and_search_for_2(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 679 |
+
"""
|
| 680 |
+
Reward function for verifying that:
|
| 681 |
+
1. The user sent two specific messages to Harry Potter.
|
| 682 |
+
2. The user searched for the number '2' in messages.
|
| 683 |
+
3. The search results display five messages (four from user, one from Harry).
|
| 684 |
+
|
| 685 |
+
Args:
|
| 686 |
+
initial_state: The starting state of the SPA
|
| 687 |
+
final_state: The ending state after the user's actions
|
| 688 |
+
|
| 689 |
+
Returns:
|
| 690 |
+
Tuple of (reward, message)
|
| 691 |
+
reward = 1.0 if all criteria are met, 0.0 otherwise
|
| 692 |
+
"""
|
| 693 |
+
user_id = "you"
|
| 694 |
+
target_conversation_id = "harry-potter"
|
| 695 |
+
|
| 696 |
+
required_messages = [
|
| 697 |
+
"What do you mean you said we'd meet at two?!",
|
| 698 |
+
"Wait let me check my message history"
|
| 699 |
+
]
|
| 700 |
+
|
| 701 |
+
# 1. Check messages to Harry
|
| 702 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 703 |
+
harry_convo = next(
|
| 704 |
+
(convo for convo in messages if convo.get("conversationId") == target_conversation_id),
|
| 705 |
+
None
|
| 706 |
+
)
|
| 707 |
+
|
| 708 |
+
if harry_convo is None:
|
| 709 |
+
return 0.0, "Harry's conversation not found."
|
| 710 |
+
|
| 711 |
+
convo_messages = harry_convo.get("messages", [])
|
| 712 |
+
sent_texts = [m.get("content") for m in convo_messages if m.get("senderId") == user_id]
|
| 713 |
+
|
| 714 |
+
if not all(req in sent_texts for req in required_messages):
|
| 715 |
+
return 0.0, "Missing one or more required messages to Harry."
|
| 716 |
+
|
| 717 |
+
# 2. Check search parameters
|
| 718 |
+
search_term = final_state.get("searchTerm", "")
|
| 719 |
+
search_page = final_state.get("searchPage", "")
|
| 720 |
+
|
| 721 |
+
if search_term != "2" or search_page != "MESSAGES":
|
| 722 |
+
return 0.0, f"Search not completed correctly. Expected term='2' and page='MESSAGES', got term='{search_term}', page='{search_page}'."
|
| 723 |
+
|
| 724 |
+
# 3. Check number of messages in search results (five total, four from user, one from Harry)
|
| 725 |
+
harry_msgs = [
|
| 726 |
+
msg for convo in messages
|
| 727 |
+
if convo.get("conversationId") == target_conversation_id
|
| 728 |
+
for msg in convo.get("messages", [])
|
| 729 |
+
]
|
| 730 |
+
|
| 731 |
+
num_from_user = sum(1 for m in harry_msgs if m.get("senderId") == user_id)
|
| 732 |
+
num_from_harry = sum(1 for m in harry_msgs if m.get("senderId") == "harry-potter")
|
| 733 |
+
|
| 734 |
+
if num_from_user == 5 and num_from_harry == 1: # three to harry, one to hermione and tim.
|
| 735 |
+
return 1.0, "Success! Messages sent, search performed, and correct results displayed."
|
| 736 |
+
else:
|
| 737 |
+
return 0.0, f"Incorrect number of messages displayed. Found {num_from_user} from you and {num_from_harry} from Harry."
|
| 738 |
+
|
| 739 |
+
|
| 740 |
+
def _validate_the_a_team(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 741 |
+
"""
|
| 742 |
+
Reward function for the "The A team" task in Microsoft Teams.
|
| 743 |
+
Checks if a group chat with Alex Langford, Alex Langford II, and Anne Peters
|
| 744 |
+
exists and contains the message "The A team" sent by the user.
|
| 745 |
+
|
| 746 |
+
Args:
|
| 747 |
+
initial_state: The initial SPA state (not used here)
|
| 748 |
+
final_state: The final SPA state
|
| 749 |
+
|
| 750 |
+
Returns:
|
| 751 |
+
Tuple of (reward, message)
|
| 752 |
+
reward = 1.0 if group chat exists and message sent, 0.0 otherwise
|
| 753 |
+
"""
|
| 754 |
+
user_id = "you"
|
| 755 |
+
target_users = {"alex-langford", "alex-langford-2", "anne-peters"}
|
| 756 |
+
expected_message = "The A team"
|
| 757 |
+
|
| 758 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 759 |
+
|
| 760 |
+
# Find the group chat containing all three target users
|
| 761 |
+
target_chat = None
|
| 762 |
+
for convo in messages:
|
| 763 |
+
convo_users = set(["alex-langford", "alex-langford-2", "anne-peters"])
|
| 764 |
+
if target_users.issubset(convo_users):
|
| 765 |
+
target_chat = convo
|
| 766 |
+
break
|
| 767 |
+
|
| 768 |
+
if target_chat is None:
|
| 769 |
+
return 0.0, "Group chat with Alex Langford, Alex Langford II, and Anne Peters not found."
|
| 770 |
+
|
| 771 |
+
# Check if the expected message was sent by the user
|
| 772 |
+
for msg in target_chat.get("messages", []):
|
| 773 |
+
if msg.get("senderId") == user_id and msg.get("content") == expected_message:
|
| 774 |
+
return 1.0, "Success! The group chat was created and message sent."
|
| 775 |
+
|
| 776 |
+
return 0.0, f"Group chat exists but message '{expected_message}' was not sent."
|
| 777 |
+
|
| 778 |
+
|
| 779 |
+
def _validate_birthday_for_george(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 780 |
+
"""
|
| 781 |
+
Reward function that checks if the user has:
|
| 782 |
+
1. Created a group chat with Fred Weasley, Hermione Granger, and Harry Potter
|
| 783 |
+
2. Sent the correct message in that group chat
|
| 784 |
+
3. Sent a follow-up message to George Weasley
|
| 785 |
+
4. Typed "Ron Weasley" into the search bar (without pressing enter)
|
| 786 |
+
5. Stayed on the HOME page
|
| 787 |
+
|
| 788 |
+
Args:
|
| 789 |
+
state: The current SPA state as a dictionary
|
| 790 |
+
|
| 791 |
+
Returns:
|
| 792 |
+
Tuple of (reward, message)
|
| 793 |
+
reward = 1.0 if all criteria are met, 0.0 otherwise
|
| 794 |
+
"""
|
| 795 |
+
|
| 796 |
+
user_id = "you"
|
| 797 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 798 |
+
page: str = final_state.get("page", "")
|
| 799 |
+
search_term: str = final_state.get("searchTerm", "").strip().lower()
|
| 800 |
+
|
| 801 |
+
# --- 1. Check for group chat ---
|
| 802 |
+
expected_group_users = {"fred-weasley", "harry-potter", "hermione-granger"}
|
| 803 |
+
group_message_text = "Hey guys, just confirming we're throwing a surprise party for George tomorrow at 3. See you then!"
|
| 804 |
+
|
| 805 |
+
group_chat_found = False
|
| 806 |
+
group_message_ok = False
|
| 807 |
+
george_message_ok = False
|
| 808 |
+
|
| 809 |
+
for convo in messages:
|
| 810 |
+
user_ids = set(convo.get("userIds", []))
|
| 811 |
+
convo_messages = convo.get("messages", [])
|
| 812 |
+
|
| 813 |
+
# Check group chat
|
| 814 |
+
if user_ids == expected_group_users:
|
| 815 |
+
group_chat_found = True
|
| 816 |
+
for msg in convo_messages:
|
| 817 |
+
if msg.get("senderId") == user_id and msg.get("content") == group_message_text:
|
| 818 |
+
group_message_ok = True
|
| 819 |
+
break
|
| 820 |
+
|
| 821 |
+
# Check message to George
|
| 822 |
+
if user_ids == {"george-weasley"}:
|
| 823 |
+
for msg in convo_messages:
|
| 824 |
+
if (
|
| 825 |
+
msg.get("senderId") == user_id
|
| 826 |
+
and msg.get("content")
|
| 827 |
+
== "Hey George, is it your day off tomorrow? I can't remember if you're out."
|
| 828 |
+
):
|
| 829 |
+
george_message_ok = True
|
| 830 |
+
break
|
| 831 |
+
|
| 832 |
+
# --- 2. Check all criteria ---
|
| 833 |
+
if not group_chat_found:
|
| 834 |
+
return 0.0, "Group chat with Fred, Harry, and Hermione not found."
|
| 835 |
+
|
| 836 |
+
if not group_message_ok:
|
| 837 |
+
return 0.0, "Expected message to the group chat not found."
|
| 838 |
+
|
| 839 |
+
if not george_message_ok:
|
| 840 |
+
return 0.0, "Expected message to George Weasley not found."
|
| 841 |
+
|
| 842 |
+
if search_term != "ron weasley":
|
| 843 |
+
return 0.0, f"Search term incorrect. Expected 'Ron Weasley', found '{final_state.get('searchTerm', '')}'."
|
| 844 |
+
|
| 845 |
+
if page != "HOME":
|
| 846 |
+
return 0.0, f"User is not on HOME page (found '{page}')."
|
| 847 |
+
|
| 848 |
+
return 1.0, "Success! All expected actions were completed correctly."
|
| 849 |
+
|
| 850 |
+
def _validate_group_chat_and_hermione(initial_state: Dict[str, Any], final_state: Dict[str, Any]) -> Tuple[float, str]:
|
| 851 |
+
"""
|
| 852 |
+
Reward function for validating that:
|
| 853 |
+
1. The user created a group chat with Harry and Hagrid and sent the message:
|
| 854 |
+
"I'll see you both at 2. Looking forward to it!"
|
| 855 |
+
2. Then messaged Hermione saying:
|
| 856 |
+
"Hey Hermione, me, Harry and Hagrid are meeting up if you want to join us!"
|
| 857 |
+
|
| 858 |
+
Args:
|
| 859 |
+
state: The current SPA state as a dictionary
|
| 860 |
+
|
| 861 |
+
Returns:
|
| 862 |
+
Tuple of (reward, message)
|
| 863 |
+
reward = 1.0 if both conditions met, 0.5 if only group chat message sent,
|
| 864 |
+
0.0 otherwise
|
| 865 |
+
"""
|
| 866 |
+
user_id = "you"
|
| 867 |
+
messages: List[Dict[str, Any]] = final_state.get("messages", [])
|
| 868 |
+
|
| 869 |
+
# --- Condition 1: Group chat with Harry and Hagrid ---
|
| 870 |
+
expected_group_users = {"hagrid-cao", "harry-potter"}
|
| 871 |
+
expected_group_message = "I'll see you both at 2. Looking forward to it!"
|
| 872 |
+
group_chat_found = False
|
| 873 |
+
group_message_sent = False
|
| 874 |
+
|
| 875 |
+
for convo in messages:
|
| 876 |
+
convo_users = set(convo.get("userIds", []))
|
| 877 |
+
if convo_users == expected_group_users:
|
| 878 |
+
group_chat_found = True
|
| 879 |
+
for msg in convo.get("messages", []):
|
| 880 |
+
if msg.get("senderId") == user_id and msg.get("content") == expected_group_message:
|
| 881 |
+
group_message_sent = True
|
| 882 |
+
break
|
| 883 |
+
break
|
| 884 |
+
|
| 885 |
+
if not group_chat_found:
|
| 886 |
+
return 0.0, "Group chat with Harry and Hagrid not found."
|
| 887 |
+
|
| 888 |
+
if not group_message_sent:
|
| 889 |
+
return 0.0, f"Group chat found, but expected message '{expected_group_message}' not sent."
|
| 890 |
+
|
| 891 |
+
# --- Condition 2: Message Hermione ---
|
| 892 |
+
hermione_convo = next((c for c in messages if c.get("conversationId") == "hermione-granger"), None)
|
| 893 |
+
expected_hermione_message = "Hey Hermione, me, Harry and Hagrid are meeting up if you want to join us!"
|
| 894 |
+
hermione_message_sent = False
|
| 895 |
+
|
| 896 |
+
if hermione_convo is not None:
|
| 897 |
+
for msg in hermione_convo.get("messages", []):
|
| 898 |
+
if msg.get("senderId") == user_id and msg.get("content") == expected_hermione_message:
|
| 899 |
+
hermione_message_sent = True
|
| 900 |
+
break
|
| 901 |
+
else:
|
| 902 |
+
return 0.5, "Hermione's conversation not found, but group chat message was sent."
|
| 903 |
+
|
| 904 |
+
if group_message_sent and hermione_message_sent:
|
| 905 |
+
return 1.0, "Success! Both group chat message and Hermione message were sent."
|
| 906 |
+
elif group_message_sent:
|
| 907 |
+
return 0.5, "Partial success — group chat message sent, but Hermione message missing."
|
| 908 |
+
else:
|
| 909 |
+
return 0.0, "Messages missing or incorrect."
|
| 910 |
+
|
| 911 |
+
|
| 912 |
+
# Registry of all microsoft teams reward functions
|
| 913 |
+
REWARD_FUNCTIONS_MICROSOFT_TEAMS = {
|
| 914 |
+
_validate_respond_to_hermione,
|
| 915 |
+
_validate_message_tim_white_twice,
|
| 916 |
+
_validate_prepare_to_make_a_new_chat,
|
| 917 |
+
_validate_open_search_page_for_hagrid,
|
| 918 |
+
_validate_filter_chats_for_harry,
|
| 919 |
+
_validate_navigate_to_harrys_files_page,
|
| 920 |
+
_validate_navigate_to_harrys_photos_page,
|
| 921 |
+
_validate_message_hermione_and_then_tim,
|
| 922 |
+
_validate_make_a_group_chat_with_hagrid_and_ron,
|
| 923 |
+
_validate_create_a_chat_with_fred_weasely,
|
| 924 |
+
_validate_message_tim_and_select_hermiones_photos,
|
| 925 |
+
_validate_search_for_messages_containing_hey,
|
| 926 |
+
_validate_message_tim_and_alex_langford,
|
| 927 |
+
_validate_large_group_chat,
|
| 928 |
+
_validate_message_hermione_and_search_for_it,
|
| 929 |
+
_validate_message_the_third_user_in_the_search,
|
| 930 |
+
_validate_harry_hagrid_harry_hagrid,
|
| 931 |
+
_validate_message_and_search_for_2,
|
| 932 |
+
_validate_the_a_team,
|
| 933 |
+
_validate_birthday_for_george,
|
| 934 |
+
_validate_group_chat_and_hermione,
|
| 935 |
+
}
|
tasks/salesforce/change-case-status.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "change-case-status",
|
| 3 |
"name": "Change Case Status",
|
| 4 |
"description": "Change a case's status from the case details page",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "change-case-status",
|
| 4 |
"name": "Change Case Status",
|
| 5 |
"description": "Change a case's status from the case details page",
|
tasks/salesforce/change-lead-status.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "change-lead-status",
|
| 3 |
"name": "Change Lead Status",
|
| 4 |
"description": "Change a lead's status from the lead details page",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "change-lead-status",
|
| 4 |
"name": "Change Lead Status",
|
| 5 |
"description": "Change a lead's status from the lead details page",
|
tasks/salesforce/convert-lead-to-contact.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "convert-lead-to-contact",
|
| 3 |
"name": "Convert Lead to Contact",
|
| 4 |
"description": "Convert an existing lead to a contact through the full conversion workflow",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "convert-lead-to-contact",
|
| 4 |
"name": "Convert Lead to Contact",
|
| 5 |
"description": "Convert an existing lead to a contact through the full conversion workflow",
|
tasks/salesforce/create-and-close-case.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "create-and-close-case",
|
| 3 |
"name": "Create and Close Case",
|
| 4 |
"description": "Complete workflow of creating a new case and closing it",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "create-and-close-case",
|
| 4 |
"name": "Create and Close Case",
|
| 5 |
"description": "Complete workflow of creating a new case and closing it",
|
tasks/salesforce/create-and-convert-lead.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "create-and-convert-lead",
|
| 3 |
"name": "Create and Convert Lead",
|
| 4 |
"description": "Complete workflow of creating a new lead and converting it to a contact",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "create-and-convert-lead",
|
| 4 |
"name": "Create and Convert Lead",
|
| 5 |
"description": "Complete workflow of creating a new lead and converting it to a contact",
|
tasks/salesforce/create-new-case.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "create-new-case",
|
| 3 |
"name": "Create New Case",
|
| 4 |
"description": "Create a new case by filling out the form and saving it",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "create-new-case",
|
| 4 |
"name": "Create New Case",
|
| 5 |
"description": "Create a new case by filling out the form and saving it",
|
tasks/salesforce/create-new-lead.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "create-new-lead",
|
| 3 |
"name": "Create New Lead",
|
| 4 |
"description": "Create a new lead by filling out the form and saving it",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "create-new-lead",
|
| 4 |
"name": "Create New Lead",
|
| 5 |
"description": "Create a new lead by filling out the form and saving it",
|
tasks/salesforce/edit-lead-inline.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "edit-lead-inline",
|
| 3 |
"name": "Edit Lead Inline",
|
| 4 |
"description": "Edit a lead's details using inline editing on the details panel",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "edit-lead-inline",
|
| 4 |
"name": "Edit Lead Inline",
|
| 5 |
"description": "Edit a lead's details using inline editing on the details panel",
|
tasks/salesforce/open-edit-case-dialog.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "open-edit-case-dialog",
|
| 3 |
"name": "Open Edit Case Dialog",
|
| 4 |
"description": "Open the edit case dialog from a case details page",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "open-edit-case-dialog",
|
| 4 |
"name": "Open Edit Case Dialog",
|
| 5 |
"description": "Open the edit case dialog from a case details page",
|
tasks/salesforce/open-new-case-dialog.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "open-new-case-dialog",
|
| 3 |
"name": "Open New Case Dialog",
|
| 4 |
"description": "Open the new case creation dialog from the dashboard",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "open-new-case-dialog",
|
| 4 |
"name": "Open New Case Dialog",
|
| 5 |
"description": "Open the new case creation dialog from the dashboard",
|
tasks/salesforce/open-new-contact-dialog.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "open-new-contact-dialog",
|
| 3 |
"name": "Open New Contact Dialog",
|
| 4 |
"description": "Open the new contact creation dialog from the dashboard",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "open-new-contact-dialog",
|
| 4 |
"name": "Open New Contact Dialog",
|
| 5 |
"description": "Open the new contact creation dialog from the dashboard",
|
tasks/salesforce/open-new-lead-dialog.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "open-new-lead-dialog",
|
| 3 |
"name": "Open New Lead Dialog",
|
| 4 |
"description": "Open the new lead creation dialog from the dashboard",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "open-new-lead-dialog",
|
| 4 |
"name": "Open New Lead Dialog",
|
| 5 |
"description": "Open the new lead creation dialog from the dashboard",
|
tasks/salesforce/open-new-opportunity-dialog.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"id": "open-new-opportunity-dialog",
|
| 3 |
"name": "Open New Opportunity Dialog",
|
| 4 |
"description": "Open the new opportunity creation dialog from the dashboard",
|
|
|
|
| 1 |
{
|
| 2 |
+
"spa": "salesforce",
|
| 3 |
"id": "open-new-opportunity-dialog",
|
| 4 |
"name": "Open New Opportunity Dialog",
|
| 5 |
"description": "Open the new opportunity creation dialog from the dashboard",
|