File size: 286 Bytes
dc26720
 
 
 
 
 
1
2
3
4
5
6
7
def process_query(query, intents):
    for intent in intents["intents"]:
        for pattern in intent["patterns"]:
            if pattern.lower() in query.lower():
                return intent["responses"][0]
    return "I'm sorry, I don't understand your request. Can you rephrase?"