I hereby claim:
- I am treethought on github.
- I am treethought (https://keybase.io/treethought) on keybase.
- I have a public key ASCywsChCvU0Zl40uAXyxRXhL2RvZ0M87hdkKORpnvz5vgo
To claim this, I am signing this object:
#!/usr/bin/env | |
import os | |
import inspect | |
from flask import json | |
from project import ask | |
def generate_schema(skill): |
# http://stackoverflow.com/questions/2546207/does-sqlalchemy-have-an-equivalent-of-djangos-get-or-create | |
# credit to Wolf | |
def get_or_create(session, model, defaults=None, **kwargs): | |
instance = session.query(model).filter_by(**kwargs).first() | |
if instance: | |
return instance, False | |
else: | |
params = dict((k, v) for k, v in kwargs.iteritems() if not isinstance(v, ClauseElement)) | |
params.update(defaults or {}) |
# Providing the following resposne to API.AI from a webhook produces a rich response list | |
# API.AI parses the messages and sends an appropriately formmated response to Actions.abs | |
# However, the API and Actions appear to be on different api versions currently.abs | |
# Therefore, in API.AI when a user selects a list object, the object's "key" is sent to API.AI | |
# as a user query to trigger thenext intent. In Actions, the items title is sent | |
BASEDIR=$(CURDIR) | |
CORDOVADIR = $(BASEDIR)/cordova | |
ABDDIR = ~/Library/Android/sdk/platform-tools | |
KEYSTORE = YOURSTORE | |
STOREPWD = YOURPASSWORD | |
KEYALIAS = YOURALIAS | |
KEYPWD = YOURPASSWORD |
I hereby claim:
To claim this, I am signing this object:
The EventState classes are being used to trigger other intents, which then set dialogue checkpoints and perform logic. This divides the bot experience into sensible components (Report Items, Show Items, Gathering Info about an Item, etc). However, it also requires that each step/state of these components be completed in a specific order.
While I appreciate the serparation of logic and the EventStates' purpose of starting the next segmnet of dialogue, I feel that it may be overly complex and redundant, without providing potential advantages. We could simply use the EventState phrases for the targeted Intent itself, which accomplishes the same triggering.
With the following Events
, "Phrases", and Intents to report a found phone
Instead of:
import os | |
import sys | |
import re | |
import click | |
import subprocess | |
def get_py_files(dir): | |
for dirname, dirnames, filenames in os.walk(dir): | |
# path to all subdirectories first. | |
for subdirname in dirnames: |
import requests # Import the requests library for making HTTP requests | |
import argparse # Import the argparse library for parsing command-line arguments | |
import os # Import the os library for accessing environment variables | |
import json | |
# Function to make a GET request to the Neynar API | |
def get(endpoint, args, api_key=None): | |
url = f"https://api.neynar.com/{endpoint}" # Construct the full URL for the endpoint | |
params = args.copy() # Copy the arguments to avoid modifying the original dictionary | |
if api_key is None: |