Skip to content

Commit 2d8a974

Browse files
committed
Small-Talk Package
added package for Eday
1 parent 41ee6a8 commit 2d8a974

File tree

6 files changed

+215
-0
lines changed

6 files changed

+215
-0
lines changed

.vs/Lab-Assistant-IO/v15/.suo

15.5 KB
Binary file not shown.

Lab-Assistant-IO.njsproj

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<SchemaVersion>2.0</SchemaVersion>
6+
<ProjectGuid>{147439e5-6021-4a97-b946-c5dd12392241}</ProjectGuid>
7+
<ProjectHome />
8+
<ProjectView>ShowAllFiles</ProjectView>
9+
<StartupFile />
10+
<WorkingDirectory>.</WorkingDirectory>
11+
<OutputPath>.</OutputPath>
12+
<ProjectTypeGuids>{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}</ProjectTypeGuids>
13+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
14+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
15+
</PropertyGroup>
16+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
17+
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
18+
<ItemGroup>
19+
<Content Include="CONTRIBUTING.md" />
20+
<Content Include="NOTICE.md" />
21+
<Content Include="README.md" />
22+
<Content Include="documentation\debian_logo.png" />
23+
<Content Include="documentation\dialogflow_logo.png" />
24+
<Content Include="documentation\Overall-Assistant-Diagram.png" />
25+
<Content Include="documentation\pycharm_logo.png" />
26+
<Content Include="documentation\sparc_logo.png" />
27+
<Content Include="documentation\KAREN RoadMap.md" />
28+
<Content Include="main_server\package-lock.json" />
29+
<Content Include="main_server\package.json" />
30+
<Compile Include="main_server\app.js" />
31+
<Content Include="main_server\public\manifest.json" />
32+
<Compile Include="main_server\routes\command_handler.js" />
33+
<Compile Include="main_server\routes\devices.js" />
34+
<Compile Include="main_server\routes\documentation.js" />
35+
<Compile Include="main_server\routes\index.js" />
36+
<Compile Include="main_server\routes\packages.js" />
37+
<Compile Include="main_server\routes\settings.js" />
38+
<Compile Include="main_server\routes\users.js" />
39+
<Compile Include="main_server\tests\dialogflow_test.js" />
40+
<Content Include="main_server\views\devices.pug" />
41+
<Content Include="main_server\views\documentation.pug" />
42+
<Content Include="main_server\views\error.pug" />
43+
<Content Include="main_server\views\index.pug" />
44+
<Content Include="main_server\views\layout.pug" />
45+
<Content Include="main_server\views\packages.pug" />
46+
<Content Include="main_server\views\settings.pug" />
47+
<Content Include="main_server\packages\default\aio_info.json" />
48+
<Content Include="main_server\packages\default\README.md" />
49+
<Compile Include="main_server\packages\default\index.js" />
50+
<Content Include="main_server\packages\home\aio_info.json" />
51+
<Content Include="main_server\packages\home\README.md" />
52+
<Compile Include="main_server\packages\home\index.js" />
53+
<Content Include="main_server\packages\lab\aio_info.json" />
54+
<Content Include="main_server\packages\lab\README.md" />
55+
<Compile Include="main_server\packages\lab\index.js" />
56+
<Content Include="main_server\packages\social\aio_info.json" />
57+
<Content Include="main_server\packages\social\README.md" />
58+
<Compile Include="main_server\packages\social\index.js" />
59+
<Content Include="main_server\public\images\icon.png" />
60+
<Content Include="main_server\public\images\icon2.png" />
61+
<Content Include="main_server\public\images\karen_icon.png" />
62+
<Content Include="main_server\public\images\source.gif" />
63+
<Content Include="main_server\public\images\icon.svg" />
64+
<Compile Include="main_server\public\javascripts\index.js" />
65+
<Compile Include="main_server\public\javascripts\packages.js" />
66+
<Content Include="main_server\public\stylesheets\botui.min.css" />
67+
<Content Include="main_server\public\stylesheets\dark-theme.css" />
68+
<Content Include="main_server\public\stylesheets\light-theme.css" />
69+
<Content Include="main_server\public\stylesheets\material-lite(reference).css" />
70+
<Content Include="main_server\public\stylesheets\speechkitt.css" />
71+
<Content Include="main_server\public\stylesheets\style.css" />
72+
<Content Include="main_server\public\images\ic_mic_black_24dp\web\ic_mic_black_24dp_1x.png" />
73+
<Content Include="main_server\public\images\ic_mic_black_24dp\web\ic_mic_black_24dp_2x.png" />
74+
<Content Include="main_server\public\images\ic_mic_black_24dp\android\drawable-hdpi\ic_mic_black_24dp.png" />
75+
<Content Include="main_server\public\images\ic_mic_black_24dp\android\drawable-mdpi\ic_mic_black_24dp.png" />
76+
<Content Include="main_server\public\images\ic_mic_black_24dp\android\drawable-xhdpi\ic_mic_black_24dp.png" />
77+
<Content Include="main_server\public\images\ic_mic_black_24dp\android\drawable-xxhdpi\ic_mic_black_24dp.png" />
78+
<Content Include="main_server\public\images\ic_mic_black_24dp\android\drawable-xxxhdpi\ic_mic_black_24dp.png" />
79+
<Content Include="main_server\public\images\ic_mic_black_24dp\ios\ic_mic.imageset\ic_mic.png" />
80+
<Content Include="main_server\public\images\ic_mic_black_24dp\ios\ic_mic.imageset\ic_mic_2x.png" />
81+
<Content Include="main_server\public\images\ic_mic_black_24dp\ios\ic_mic.imageset\ic_mic_3x.png" />
82+
<Content Include="main_server\public\images\ic_mic_black_24dp\ios\ic_mic.imageset\Contents.json" />
83+
</ItemGroup>
84+
<ItemGroup>
85+
<Folder Include="documentation" />
86+
<Folder Include="Lab-Assistant-IO" />
87+
<Folder Include="Lab-Assistant-IO\Lab-Assistant-IO" />
88+
<Folder Include="main_server" />
89+
<Folder Include="main_server\bin" />
90+
<Folder Include="main_server\packages" />
91+
<Folder Include="main_server\packages\default" />
92+
<Folder Include="main_server\packages\home" />
93+
<Folder Include="main_server\packages\lab" />
94+
<Folder Include="main_server\packages\social" />
95+
<Folder Include="main_server\public" />
96+
<Folder Include="main_server\public\images" />
97+
<Folder Include="main_server\public\images\ic_mic_black_24dp" />
98+
<Folder Include="main_server\public\images\ic_mic_black_24dp\android" />
99+
<Folder Include="main_server\public\images\ic_mic_black_24dp\android\drawable-hdpi" />
100+
<Folder Include="main_server\public\images\ic_mic_black_24dp\android\drawable-mdpi" />
101+
<Folder Include="main_server\public\images\ic_mic_black_24dp\android\drawable-xhdpi" />
102+
<Folder Include="main_server\public\images\ic_mic_black_24dp\android\drawable-xxhdpi" />
103+
<Folder Include="main_server\public\images\ic_mic_black_24dp\android\drawable-xxxhdpi" />
104+
<Folder Include="main_server\public\images\ic_mic_black_24dp\ios" />
105+
<Folder Include="main_server\public\images\ic_mic_black_24dp\ios\ic_mic.imageset" />
106+
<Folder Include="main_server\public\images\ic_mic_black_24dp\web" />
107+
<Folder Include="main_server\public\javascripts" />
108+
<Folder Include="main_server\public\stylesheets" />
109+
<Folder Include="main_server\routes" />
110+
<Folder Include="main_server\tests" />
111+
<Folder Include="main_server\views" />
112+
</ItemGroup>
113+
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
114+
<!--Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them.-->
115+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="False" />
116+
<Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" />
117+
<ProjectExtensions>
118+
<VisualStudio>
119+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
120+
<WebProjectProperties>
121+
<UseIIS>False</UseIIS>
122+
<AutoAssignPort>True</AutoAssignPort>
123+
<DevelopmentServerPort>0</DevelopmentServerPort>
124+
<DevelopmentServerVPath>/</DevelopmentServerVPath>
125+
<IISUrl>http://localhost:48022/</IISUrl>
126+
<NTLMAuthentication>False</NTLMAuthentication>
127+
<UseCustomServer>True</UseCustomServer>
128+
<CustomServerUrl>http://localhost:1337</CustomServerUrl>
129+
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
130+
</WebProjectProperties>
131+
</FlavorProperties>
132+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}" User="">
133+
<WebProjectProperties>
134+
<StartPageUrl>
135+
</StartPageUrl>
136+
<StartAction>CurrentPage</StartAction>
137+
<AspNetDebugging>True</AspNetDebugging>
138+
<SilverlightDebugging>False</SilverlightDebugging>
139+
<NativeDebugging>False</NativeDebugging>
140+
<SQLDebugging>False</SQLDebugging>
141+
<ExternalProgram>
142+
</ExternalProgram>
143+
<StartExternalURL>
144+
</StartExternalURL>
145+
<StartCmdLineArguments>
146+
</StartCmdLineArguments>
147+
<StartWorkingDirectory>
148+
</StartWorkingDirectory>
149+
<EnableENC>False</EnableENC>
150+
<AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug>
151+
</WebProjectProperties>
152+
</FlavorProperties>
153+
</VisualStudio>
154+
</ProjectExtensions>
155+
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# AssistIO Packages
2+
3+
Packages allow AssistIO to do just about anything. They are like the
4+
Amazon Alexa skills.
5+
6+
## Required
7+
- `ai_info.json`
8+
- contains two keys
9+
- `names`
10+
- Array of names your application could go by
11+
- `queryHandler`
12+
- The function in your package that recieves the query from the user.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name":"small-talk",
3+
"description": "Fallback suite for when the bot doesn't know what to say",
4+
"enabled": true,
5+
"default": false,
6+
"dialogflowid": "a583372870a84d00a62475e8613275ca"
7+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// @ts-check
2+
// Set up DialogFlow
3+
var fs = require('fs');
4+
var apiai = require('apiai');
5+
var path = require("path");
6+
var jsonContent = JSON.parse(fs.readFileSync(path.resolve(__dirname)+"/aio_info.json").toString());
7+
var app = apiai(jsonContent.dialogflowid);
8+
9+
module.exports.getResponse = function (query, callback){
10+
// Sends the query from the user to DialogFlow
11+
// Sends the response back to the command handler.
12+
var request = app.textRequest(query, {sessionId: '1'});
13+
request.on('response', function(response) {
14+
return(callback(processResponse(response)));
15+
});
16+
request.on('error', function(error) {
17+
console.log(error);
18+
return(callback(error));
19+
});
20+
request.end();
21+
};
22+
23+
module.exports.getName = function (){
24+
return jsonContent.name;
25+
}
26+
27+
function processResponse(response){
28+
// Parses through JSON response from Dialogue Flow.
29+
// Returns a string response or undefined if there is none.
30+
if (response.result.fulfillment.speech != undefined && response.result.fulfillment.speech != ""){
31+
return response.result.fulfillment.speech;
32+
}
33+
// Check intents and entities here for more advanced responses.
34+
else {
35+
// Finally return undefined to signify that there is no response.
36+
return undefined;
37+
}
38+
}

package-lock.json

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)