如果是需要多個操作說明或步驟的複雜任務,您可以將提示分解為子任務,以改善模型的回應內容。較小的提示可協助您改善可控性、偵錯和準確度。
您可以透過下列兩種方式分解複雜提示,並將其輸入模型:
- 連鎖提示:將工作拆分為子工作,然後依序執行這些子工作。
- 匯總回應:將工作拆分為子工作,並並行執行這些子工作。
鏈式提示
如果是涉及多個連續步驟的複雜工作,請將每個步驟設為提示,並將提示串連在一起。在這個按順序顯示的提示鏈結中,序列中一個提示的輸出內容會成為下一個提示的輸入內容。序列中最後一個提示的輸出內容即為最終輸出內容。
範例
舉例來說,假設您經營電信業務,並希望使用模型來分析客戶意見回饋,找出常見的客戶問題、將問題分類,並為各類問題產生解決方案。
工作 1:找出客戶問題
您希望模型完成的第一項工作,是從原始客戶意見中擷取有意義的資料。完成此任務的提示可能類似以下內容,其中 CUSTOMER_FEEDBACK
是包含顧客意見回饋的檔案:
擷取資料 |
---|
Extract the main issues and sentiments from the customer feedback on our telecom services. Focus on comments related to service disruptions, billing issues, and customer support interactions. Please format the output into a list with each issue/sentiment in a sentence, separated by semicolon. Input: CUSTOMER_FEEDBACK |
我們希望模型的回應包含從客戶意見回饋中擷取的問題和情緒清單。
工作 2:將問題分類
接下來,您想使用先前任務的回應,提示模型將資料分類,以便瞭解客戶面臨的問題類型。達成此任務的提示可能會類似以下內容,其中 TASK_1_RESPONSE
是上一個任務的回應:
分類資料 |
---|
Classify the extracted issues into categories such as service reliability, pricing concerns, customer support quality, and others. Please organize the output into JSON format with each issue as the key, and category as the value. Input: TASK_1_RESPONSE |
我們希望模型的回覆包含分類問題。
工作 3:產生解決方案
接著,您想使用上一個工作中的回應,根據已分類的問題產生可行的建議,以提升顧客滿意度。達成這項目標的提示可能會類似以下內容,其中 TASK_2_RESPONSE
是上一個工作中的回應:
產生建議 |
---|
Generate detailed recommendations for each category of issues identified from the feedback. Suggest specific actions to address service reliability, improving customer support, and adjusting pricing models, if necessary. Please organize the output into a JSON format with each category as the key, and recommendation as the value. Input: TASK_2_RESPONSE |
我們希望模型的回應包含各個類別的最佳化建議,以便改善客戶體驗和服務品質,滿足我們的整體目標。
匯總回覆
如果您有複雜的任務,但不需要按照特定順序執行這些任務,可以執行並行提示,並匯總模型的回應。
範例
舉例來說,假設你是唱片行店主,想根據音樂串流趨勢和商店的銷售資料,使用模型來決定要進哪些唱片。
任務 1:分析資料
首先,您需要分析兩個資料集:串流資料和銷售資料。您可以執行提示,以便同時完成這些工作。完成這些任務的提示可能類似以下內容,其中 STORE_SALES_DATA
是包含銷售資料的檔案,而 STREAMING_DATA
則是包含串流資料的檔案:
工作 1a:分析銷售資料 |
---|
Analyze the sales data to identify the number of sales of each record. Please organize the output into a JSON format with each record as the key, and sales as the value. Input: STORE_SALES_DATA |
我們預期輸出內容會包含每筆記錄的銷售次數,並以 JSON 格式呈現。
工作 1b:分析串流資料 |
---|
Analyze the streaming data to provide a the number of streams for each album. Please organize the output into a JSON format with each album as the key, and streams as the value. Input: STREAMING_DATA |
我們希望輸出內容包含每張專輯的串流次數,並以 JSON 格式呈現。
工作 2:匯總資料
您現在可以匯總這兩個資料集的資料,以便規劃購買決策。如要匯總資料,請將兩個工作項的輸出內容納入輸入內容。達成這項目標的提示可能會類似以下內容,其中 TASK_1A_RESPONSE
和 TASK_1B_RESPONSE
是先前任務的回應:
匯總銷售和串流資料 |
---|
Recommend a stocklist of about 20 records based on the most sold and most streamed records. Roughly three quarters of the stock list should be based on record sales, and the rest on streaming. Input: TASK_1A_RESPONSE and TASK_1B_RESPONSE |
我們預期輸出內容會包含約 20 筆建議的庫存清單,並根據唱片銷售量和串流量,優先顯示銷售量較高的唱片,而非串流熱門度較高的唱片。
後續步驟
- 在提示庫中探索提示範例。