Skip to content

Commit

Permalink
Working Plugin Model
Browse files Browse the repository at this point in the history
  • Loading branch information
spydaz committed Jun 8, 2020
1 parent 4f371a5 commit 884da3a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 28 deletions.
6 changes: 2 additions & 4 deletions AI_AgentModel.vb
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,15 @@ Public Class AI_AgentModel
''' <param name="_userInput"></param>
''' <remarks></remarks>
Private Function ExecutePlugins(ByVal _userInput As String, ByRef Plugins As ICollection(Of IPlugin)) As String
Dim responded = False


Dim Str As String = ""

'Plugins
If Plugins IsNot Nothing Then
For Each NewPlugin In Plugins
NewPlugin.GetResponse(_userInput)
If IsNotTest(NewPlugin.Response) = True Then
If NewPlugin.Response <> "" Or NewPlugin.Response <> " " Then
Str = LCase(RTrim(LTrim(Str)) & NewPlugin.Response)
Str &= LCase(RTrim(LTrim(Str)) & NewPlugin.Response)
End If
Else
End If
Expand Down
10 changes: 7 additions & 3 deletions Chatbot_2020_Tutorial.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,13 @@
<ItemGroup>
<Content Include="Icon_AI_Brain.ico" />
<Content Include="Icon_SpydazBrain.ico" />
<Content Include="Plugins\AI_Contracts.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Plugins\SamplePlugin.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Plugins\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>
Binary file added Plugins/AI_Contracts.dll
Binary file not shown.
Binary file added Plugins/SamplePlugin.dll
Binary file not shown.
7 changes: 1 addition & 6 deletions SamplePlugin/Sample_Plugin_Chatbot_Tutorial.vb
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ Public Class Sample_Plugin_Chatbot_Tutorial
End Property

Public Function GetResponse(UserInput As String) As Boolean Implements IPlugin.GetResponse
Dim NewResponse As String = ""





Dim NewResponse As String = "HI - Here we will Design its brain function"

If NewResponse IsNot Nothing Then
Response = NewResponse
Expand Down
11 changes: 6 additions & 5 deletions SplashScreen.Designer.vb

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

12 changes: 2 additions & 10 deletions SplashScreen.vb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
Private Sub SplashScreen_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Set up the dialog text at runtime according to the application's assembly information.

'TODO: Customize the application's assembly information in the "Application" pane of the project
' properties dialog (under the "Project" menu).

'Application title
If My.Application.Info.Title <> "" Then
Expand All @@ -18,21 +16,15 @@
ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
End If

'Format the version information using the text set into the Version control at design time as the
' formatting string. This allows for effective localization if desired.
' Build and revision information could be included by using the following code and changing the
' Version control's designtime text to "Version {0}.{1:00}.{2}.{3}" or something similar. See
' String.Format() in Help for more information.
'
' Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)

Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)

'Copyright info
Copyright.Text = My.Application.Info.Copyright
Main()

Me.Close()

End Sub


End Class

0 comments on commit 884da3a

Please sign in to comment.