Untitled

 avatar
unknown
plain_text
21 days ago
3.4 kB
4
Indexable
@tool
def meeting_confirmation_details_tool(user_query, state: Annotated[dict, InjectedState], config: RunnableConfig) -> str:
    """
    Tool that handles and confirms the details of the meeting like the meeting day,meeting time and meeting attendees.
    Args:
        user_query: The user query request for creating a meeting with 1 or more participants.
    """
    access_token = config["configurable"]["access_token"]
    llm = model_categories["l_model"]
    user_timestamp = config["configurable"]["user_timestamp"]
    user_timezone=config["configurable"]["user_timezone"]
    meeting_invite_prompt = PromptTemplate(
        template="""
    You are a system that processes a user's meeting request. The user has asked: {query}. Using the information in 
    the user_to_email map {user_to_email} , user timestamp {user_timestamp} and conversation_history {conversation_history} 
    you need to construct a clear response that addresses the following:

    1. Data Issues:
       - If there is ambiguity about which user to add due to similar names, ask for clarification.
       - If there is a closely matching name (e.g., the user says 'john' but only 'john_doe' exists), consider that as a attendee to the conversation.
         Do not clarify but notify the user all the attendees to your conversation in this scenario.
       - If a requested user is not found, notify the user that the person is not in the email list.
       - If it's unclear when the meeting should start or end, ask for details about the  date, and duration.{user_timezone}
       - Ask the user to clarify the topics of the meeting and let this be in a separate section called "Meeting topics" in case any is their and let this be a seperate heading.

    2. Meeting Start and End Times:
       -  Use the user timestamp to calculate the appropriate meeting_start and meeting_end time. Refer user timezone as well

    3. Attendees:
       - Compile a list of attendee email addresses based on the corrected input from the data issues step. If the
         user adds specific email addresses not part of the user_to_email map ,include them as part of attendees as well.

    If there are data issues, your response should primarily focus on resolving these before confirming meeting details. 
     Do not include sign-offs or greetings in your response.
    """,
        input_variables=["query", "user_to_email", "conversation_history","user_timestamp"],
    )
    chain = meeting_invite_prompt | llm|StrOutputParser()
    response = chain.invoke({"query": user_query,"conversation_history":state["messages"],
                             "user_timestamp": user_timestamp,"user_timezone":user_timezone })
    return response


I need you to make a similar function tool but for this set of parameters
{   
    "email_body": "test",
    "to": ["harishankar@salientminds.com"],
    "cc": [],
    "email_subject": "test_subject"
}
Here user wants to send an email to someone,we need to gather the recievers in the to section(we must also allow user to pass custom ids if they have.They can cc people as well which is optional(the clarifying message must be passed if not provided before confirming meeting details).The subject must also be clarified again else make a subject based on the conversation.the reply content is the subject of the email that also should be clarified.
Leave a Comment