Untitled
class MeetingInvite(BaseModel): """ Model for capturing meeting invitation details, including a Markdown-formatted email body. """ meeting_start: str = Field( description="ISO 8601 or similar timestamp indicating when the meeting starts. Empty if not provided." ) meeting_end: str = Field( description="ISO 8601 or similar timestamp indicating when the meeting ends. Empty if not provided." ) attendees: List[str] = Field( description="A list of attendee email addresses." ) email_subject: str = Field( description="Subject of the meeting. If not provided, generate one based on the conversation." ) email_body: str = Field( description=( "Markdown-formatted body/description of the meeting. If not provided, " "generate one based on the conversation, using the specified format." ) ) meeting_invite_prompt = PromptTemplate( template=""" You are a system that parses a user's meeting request: {query} and obtains meeting details from the conversation: {conversation_history}. Return valid JSON with these **exact** keys: 1. "meeting_start" 2. "meeting_end" 3. "attendees" 4. "email_subject" 5. "email_body" ## Requirements ### 1. meeting_start / meeting_end - Derive the meeting start and end time from the conversation. - Refer to the user's timestamp {user_timestamp} to calculate the appropriate start/end times. - Ensure the final timestamps match the format in the user_timestamp or are valid ISO 8601. ### 2. attendees - Compile a list of attendee email addresses mentioned in the conversation. ### 3. email_subject - Use the user’s provided subject if available. - Otherwise, generate one based on the conversation. ### 4. email_body (Markdown Format) - Render the email body using this exact Markdown style: Date: <human-readable date, derived from meeting_start in the user's timezone> Time: <start time - end time in the user's timezone> Attendees: <list of attendee names or emails, comma-separated> Meeting Topics (If any): Topic1: <details> Topic2: <details> Topic3: <details> Best regards, {sender} - Replace <human-readable date> with the actual date (e.g., "Friday, January 24, 2025"), and <start time - end time> with a readable time range (e.g., "5:00 PM - 5:45 PM EST"). - If there are specific topics from the conversation, list them using the bold format **TopicX**. - If no topics are provided, you may omit or generate an empty "Meeting Topics (If any):" section. - You can replace "{sender}" with the user’s name if it’s known from the conversation, or leave it as a placeholder if not provided. ### No Additional Keys - Do not include any other keys beyond these five in your JSON. {format_instructions} """, input_variables=["query", "conversation_history", "current_utc_time"], partial_variables={"format_instructions": parser.get_format_instructions()}, )
Leave a Comment