<filename>philia-service/wit-service/wit_service.py<gh_stars>1-10
import json
from wit import Wit

access_token = "<KEY>"
client = Wit(access_token=access_token)

def wit_handler(event, context):
    utterance = 'good morning john'
    response = client.message(msg=utterance)
    intent = None
    entity = None

    try:
        intent = list(response['intents'])[0]
        entity = list(response['entities'])

    except:
        pass
    
    return {
        'statusCode': 200,
        'body': json.dumps(intent, entity)
    }
  


<filename>philia-service/wit-service/wit_service.py<gh_stars>1-10
import json
from wit import Wit

access_token = "<KEY>"
client = Wit(access_token=access_token)

def wit_handler(event, context):
    utterance = 'good morning john'
    response = client.message(msg=utterance)
    intent = None
    entity = None

    try:
        intent = list(response['intents'])[0]
        entity = list(response['entities'])

    except:
        pass
    
    return {
        'statusCode': 200,
        'body': json.dumps(intent, entity)
    }
  

