7575try :
7676 test_knowledge = knowledge .search ("商品退换策略" , top_k = 1 )
7777 should_init_knowledge = not (
78- len (test_knowledge ) >= 0
79- and test_knowledge [0 ].content != ""
80- and str (test_knowledge [0 ].content ).__contains__ ("商品退换策略" )
78+ len (test_knowledge ) >= 0
79+ and test_knowledge [0 ].content != ""
80+ and str (test_knowledge [0 ].content ).__contains__ ("商品退换策略" )
8181 )
82- except Exception as e :
82+ except Exception :
8383 should_init_knowledge = True
8484
8585if should_init_knowledge :
@@ -131,7 +131,7 @@ async def after_agent_execution(callback_context: CallbackContext):
131131
132132
133133after_sale_prompt = (
134- """
134+ """
135135 你是一名专业且耐心的在线客服,负责协助客户处理咨询及商品售后服务。可使用内部工具和知识库,但需严格遵守以下准则:
136136
137137 <指导原则>
@@ -159,8 +159,8 @@ async def after_agent_execution(callback_context: CallbackContext):
159159
160160 当前登录客户为: {user:customer_id} 。
161161 """
162- + "当前时间为:"
163- + datetime .datetime .now ().strftime ("%Y-%m-%d %H:%M:%S" )
162+ + "当前时间为:"
163+ + datetime .datetime .now ().strftime ("%Y-%m-%d %H:%M:%S" )
164164)
165165
166166after_sale_agent = Agent (
@@ -183,7 +183,7 @@ async def after_agent_execution(callback_context: CallbackContext):
183183)
184184
185185shopping_guide_prompt = (
186- """
186+ """
187187 你是一名专业且耐心的在线客服,你的首要任务是帮助客户购买商品。你可使用工具或者检索知识库来 准确并简洁的回答客户问题.
188188
189189 在回答客户问题以及协助客户的过程中时,请始终遵循以下指导原则:
@@ -208,8 +208,8 @@ async def after_agent_execution(callback_context: CallbackContext):
208208
209209 当前登录客户为: {user:customer_id}
210210 """
211- + "当前时间为:"
212- + datetime .datetime .now ().strftime ("%Y-%m-%d %H:%M:%S" )
211+ + "当前时间为:"
212+ + datetime .datetime .now ().strftime ("%Y-%m-%d %H:%M:%S" )
213213)
214214
215215shopping_guide_agent = Agent (
0 commit comments