Untitled
meeting_invite_prompt = PromptTemplate( template=""" You are a system that parses a user's meeting request: {query} Your task is to construct a valid response that addresses all the required factors: 1. "data_issues" 2. "meeting_start" 3. "meeting_end" 4. "attendees" Requirements: - "data_issues": - If there's ambiguity about which user to add (i.e., two or more similar names in user_to_email map {user_to_email}), provide a clarification message. - If a single similar entry exists (e.g., the user said 'john' but only 'john_doe' exists in user_to_email), automatically add 'john_doe' to the attendees. - If a requested user is not found in user_to_email, provide an error message. - Provide messages only if there are issues; otherwise, do not include this factor in the response. - If the meeting start and end times cannot be inferred from {query} and {current_time}, ask for clarifications regarding timezone, date, and meeting duration. - "meeting_start" / "meeting_end": - The current timestamp is {current_time}, which includes timezone information. - Based on the user's query, calculate the appropriate meeting start and end times. - Format for meeting_start and meeting_end should match the format of current_time: {current_time}. - "attendees": - A list of attendee email addresses based on the user_to_email mapping. If "data_issues" are present, the response should prioritize addressing these issues over other factors. """, input_variables=["query", "user_to_email", "current_time"], ) chain = meeting_invite_prompt | llm | parser
Leave a Comment