miketwais

work up

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>
View Code

场景并不难,重点是如何与大模型进行交互,也就是prompt的书写。

DSL附件分享:multiplemode_follow_up

posted @ 2025-07-03 15:53  MasonZhang  阅读(427)  评论(0)    收藏  举报