Skip to content

Abstract assistant #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
708 changes: 708 additions & 0 deletions Examples/ServiceExamples/Scripts/ExampleAssistant.cs

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions Examples/ServiceExamples/Scripts/ExampleAssistant.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions Examples/ServiceExamples/Scripts/ExampleVisualRecognition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private IEnumerator Examples()

while (!_detectFacesPostTested)
yield return null;

#if DELETE_TRAINED_CLASSIFIER
#region Delay
Runnable.Run(Delay(_delayTime));
Expand Down Expand Up @@ -217,20 +217,23 @@ private void OnDetectFacesPost(FacesTopLevelMultiple multipleImages, Dictionary<
_detectFacesPostTested = true;
}

#region Delay
#region Delay
// Introducing a delay because of a known issue with Visual Recognition where newly created classifiers
// will disappear without being deleted if a delete is attempted less than ~10 seconds after creation.
#if DELETE_TRAINED_CLASSIFIER
private float _delayTime = 15f;
private bool _isWaitingForDelay = false;


private IEnumerator Delay(float delayTime)
{
_isWaitingForDelay = true;
Log.Debug("ExampleVisualRecognition.Delay()", "Delaying for {0} seconds....", delayTime);
yield return new WaitForSeconds(delayTime);
_isWaitingForDelay = false;
}
#endregion
#endif
#endregion

private void OnFail(RESTConnector.Error error, Dictionary<string, object> customData)
{
Expand Down
78 changes: 60 additions & 18 deletions Examples/ServiceExamples/ServiceExamples.unity
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ LightmapSettings:
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
Expand Down Expand Up @@ -150,7 +151,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &473286772
GameObject:
Expand Down Expand Up @@ -190,7 +191,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &525603453
GameObject:
Expand Down Expand Up @@ -230,7 +231,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &659829311
GameObject:
Expand Down Expand Up @@ -270,7 +271,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &725710367
GameObject:
Expand Down Expand Up @@ -343,6 +344,7 @@ Camera:
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
Expand All @@ -358,7 +360,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 15
m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &748186939
GameObject:
Expand Down Expand Up @@ -398,7 +400,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &854511683
GameObject:
Expand Down Expand Up @@ -438,7 +440,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &859102722
GameObject:
Expand Down Expand Up @@ -478,7 +480,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1053617509
GameObject:
Expand Down Expand Up @@ -518,7 +520,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1073418922
GameObject:
Expand Down Expand Up @@ -558,7 +560,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1160237478
GameObject:
Expand Down Expand Up @@ -598,7 +600,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 13
m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1194016994
GameObject:
Expand Down Expand Up @@ -638,7 +640,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1310649318
GameObject:
Expand Down Expand Up @@ -678,7 +680,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1646373635
GameObject:
Expand Down Expand Up @@ -718,7 +720,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1713392457
GameObject:
Expand Down Expand Up @@ -758,7 +760,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1740459831
GameObject:
Expand Down Expand Up @@ -798,7 +800,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 14
m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2041722972
GameObject:
Expand All @@ -815,7 +817,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &2041722973
Transform:
m_ObjectHideFlags: 0
Expand All @@ -827,7 +829,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 16
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2041722974
MonoBehaviour:
Expand All @@ -840,3 +842,43 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5c93a3595292dc6479dfb6e7c721838b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2118312579
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 2118312581}
- component: {fileID: 2118312580}
m_Layer: 0
m_Name: ExampleAssistant
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2118312580
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2118312579}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9848745df680ac7438f802aac3f4b8f2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &2118312581
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2118312579}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ The credentials for each service contain either a `username`, `password` and end
## Watson Services
To get started with the Watson Services in Unity, click on each service below to read through each of their `README.md`'s and their codes.
* [Alchemy Language](/Scripts/Services/AlchemyAPI/v1) **Deprecated**
* [Assistant](/Scripts/Services/Assistant/v1)
* [Conversation](/Scripts/Services/Conversation/v1)
* [Discovery](/Scripts/Services/Discovery/v1)
* [Document Conversion](/Scripts/Services/DocumentConversion/v1) **Deprecated**
Expand Down
10 changes: 10 additions & 0 deletions Scripts/Services/Assistant.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Scripts/Services/Assistant/v1.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading