yarn global add dialogflow-exporter
npm install -g dialogflow-exporter
export dialogflow .zip archive
put the file at the root (or anywhere you want)
in this example my agent name is "example"
and I put it at the root of the nodejs project:
import loadAgentFile from 'dialogflow-exporter';
const agent = loadAgentFile("example.zip");
agent
.init()
.then((agent)=> console.log(agent.intents));
ENJOY!!
#####Agent
method | input | response |
---|---|---|
constructor | filePath:string | Agent object |
init | Promise | |
toString | get all the agent as string |
property | type | description |
---|---|---|
intents | Intent[] | List of intents including each intent includes a name, user says, and response |
#####Intent | ||
method | input | response |
------------- | ------------------------------------------------------------ | -------------------------------------------- |
constructor | name: string, userSays: IUserSay[], responses: IResponse[] | Intent object |
toObject | returns normal js object instead of class | |
toString | returns same object in json representation |
property | type | description |
---|---|---|
name | string | The name of this intent |
userSays | IUserSay[] | Possible things an user can say |
response | IResponse[] | The expected response |
MIT see license.md file