Dify 工作流實踐--郵件內容識別+自動回復
訴求:
根據提供的郵件正文,郵件回復內容,郵件附件,解析理解郵件內容,分析是否包含報價信息,若包含則解析出以json格式返回,若不存在,則根據郵件回復內容,正文內容,回復的附件內容自動生成回復郵件,繼續詢價。
流程設計:

引入多模態大模型,解析PDF,解析圖片內容,基于deepseek 文本理解生成后續郵件。
部分PROMPT下:
Your task is to determine if detailed quote information exists based on the reply content of the email , reply attachement file contents and the original email content. If there is a detailed quote, it will be extracted, if not, you need to generate a follow up email to continue asking for a detailed quote. Please read the following original email carefully: <original_email> {{#1750917756779.content#}} </original_email> Please read the following reply email carefully: <reply_email> {{#1750917756779.reply#}} </reply_email> Please read the following reply email attachment contents carefully: <reply_attachement_file> {{#1750919884000.text#}} </reply_attachement_file> Please consider the following criteria when you judge whether there is a detailed quote or not. Please consider the following criteria when determining whether a detailed offer exists: 1. Whether the quote is for a specific dollar amount. 2. whether the quote covers the details of the product or service (e.g., specifications, quantity, etc.). 3. whether the quote has applicable conditions. 3. whether the offer is subject to any applicable conditions or scope. If the email reply and attachment contains a quote that is clear and specific about the amount, covers the details of the product or service, and has applicable conditions or scopes, it is assumed that detailed quote information exists; otherwise, it is assumed that detailed quote information does not exist. If detailed quote information does not exist, please follow these guidelines when generating follow-up emails: 1. use a formal but friendly tone. 2. start the email with an appropriate greeting. 3. refer to previous email exchanges at the beginning. 4. clearly express your need for detailed quote information. 4. clearly express your need for detailed quote information. 5. Use simple, clear language and avoid jargon or complex terms. 6. 6. End the email with a polite closing statement and your name. 7. Ensure that the email does not contain any spelling or grammatical errors. 8. Do not generate Subject content. 9. Use the sender/signature of the original email, if the original email does not have a sender/signature, it will not be displayed. 10. The recipient should use the same recipient as the original email and not use [Recipient's Name] Give the result of your judgment in the <judgment> tag, using either “exists” or “does not exist”. If the result is “exists”, please put the quote information in <quotation> tag, if the result is “does not exist”, please write the follow-up email in <follow_up> tag. (If <quotation> is shown, then <follow_up> is not shown.) <judgment> [Give the judgment of “exists” or “doesn't exist” here] </judgment> <quotation> [If the judgment is that the detailed quotation information exist , put quote information here] </quotation> <follow_up> [If the judgment is that the detailed quotation information doesn't exist , write a follow up email here] </follow_up>
場景并不難,重點是如何與大模型進行交互,也就是prompt的書寫。
DSL附件分享:multiplemode_follow_up


浙公網安備 33010602011771號