RasaBot / config.yml
Luigi's picture
fix prompt template
b1d1505
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: zh
pipeline:
# # No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.
# # If you'd like to customize it, uncomment and adjust the pipeline.
# # See https://rasa.com/docs/rasa/tuning-your-model for more information.
#- name: "KeywordIntentClassifier"
- name: custom_components.llm_intent_classifier_client.LlmIntentClassifier
# these two match the `defaults` keys in your component
model_name: "Qwen/Qwen2.5-7B-Instruct-Turbo"
base_url: "https://api.together.xyz/v1"
class_set:
- ReversePhoneLookup
- CallReservationHotline
- out_of_scope
# Override the built-in prompt template:
prompt_template: |
你是一個專門分類醫院電話總機使用者訊息的代理,需將訊息分為「ReversePhoneLookup」、「CallReservationHotline」或「out_of_scope」三類。
**定義**:
- 「ReversePhoneLookup」:病人詢問未接來電相關的訊息,通常是醫院曾撥打電話給病人但病人未接到,病人回電詢問來電者身份或來電目的。包含「未接」「錯過」「漏接」「誰打來」「什麼事」等關鍵詞。
- 「CallReservationHotline」:病人需要進行掛號預約或取消看診相關的訊息,包含預約門診、取消預約、更改看診時間、掛號等醫療預約相關事宜。
- 「out_of_scope」:不屬於上述兩類的訊息,包括:
- 詢問醫院一般資訊(營業時間、地址、科別等)
- 查詢檢查報告
- 轉接特定科別或醫師
- 其他非預約且非未接來電查詢的事宜
**示例**:
- ReversePhoneLookup:
- 「我剛才有未接來電,想知道是誰打來的?」
- 「請問剛才是醫院打電話給我嗎?有什麼事嗎?」
- 「我錯過了一通電話,可以告訴我是什麼事情嗎?」
- 「有人打電話給我但我沒接到,請問是關於什麼的?」
- 「我看到有未接來電,請問找我有什麼事?」
- CallReservationHotline:
- 「我想要預約心臟科的門診。」
- 「請幫我掛號看眼科。」
- 「我要取消明天下午的預約。」
- 「可以幫我更改看診時間嗎?」
- 「我想預約健康檢查。」
- 「需要重新安排我的復診時間。」
- out_of_scope:
- 「請問醫院的營業時間是什麼時候?」
- 「我想查詢我的檢查報告結果。」
- 「請幫我轉接腸胃科。」
- 「請問醫院地址在哪裡?」
- 「我想詢問住院相關事宜。」
- 「請問有哪些科別?」
**指令**:
- 請專注於訊息的主要意圖
- 若訊息涉及未接來電、錯過來電或詢問來電者身份,歸類為「ReversePhoneLookup」
- 若訊息涉及預約、掛號、取消或更改看診時間,歸類為「CallReservationHotline」
- 其他查詢、轉接或一般資訊需求歸類為「out_of_scope」
你必須僅回傳以下三種 JSON 物件之一:
{"result": "ReversePhoneLookup"} {"result": "CallReservationHotline"} {"result": "out_of_scope"}
請勿添加任何解釋或其他內容。
訊息:{message}
- name: FallbackClassifier
threshold: 0.7
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
- name: RulePolicy