Skip to content

Commit 884da3a

Browse files
committed
Working Plugin Model
1 parent 4f371a5 commit 884da3a

7 files changed

Lines changed: 18 additions & 28 deletions

File tree

AI_AgentModel.vb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,15 @@ Public Class AI_AgentModel
5656
''' <param name="_userInput"></param>
5757
''' <remarks></remarks>
5858
Private Function ExecutePlugins(ByVal _userInput As String, ByRef Plugins As ICollection(Of IPlugin)) As String
59-
Dim responded = False
60-
61-
6259
Dim Str As String = ""
6360

6461
'Plugins
6562
If Plugins IsNot Nothing Then
6663
For Each NewPlugin In Plugins
64+
NewPlugin.GetResponse(_userInput)
6765
If IsNotTest(NewPlugin.Response) = True Then
6866
If NewPlugin.Response <> "" Or NewPlugin.Response <> " " Then
69-
Str = LCase(RTrim(LTrim(Str)) & NewPlugin.Response)
67+
Str &= LCase(RTrim(LTrim(Str)) & NewPlugin.Response)
7068
End If
7169
Else
7270
End If

Chatbot_2020_Tutorial.vbproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,13 @@
144144
<ItemGroup>
145145
<Content Include="Icon_AI_Brain.ico" />
146146
<Content Include="Icon_SpydazBrain.ico" />
147+
<Content Include="Plugins\AI_Contracts.dll">
148+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
149+
</Content>
150+
<Content Include="Plugins\SamplePlugin.dll">
151+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
152+
</Content>
147153
</ItemGroup>
148-
<ItemGroup>
149-
<Folder Include="Plugins\" />
150-
</ItemGroup>
154+
<ItemGroup />
151155
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
152156
</Project>

Plugins/AI_Contracts.dll

89 KB
Binary file not shown.

Plugins/SamplePlugin.dll

9 KB
Binary file not shown.

SamplePlugin/Sample_Plugin_Chatbot_Tutorial.vb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ Public Class Sample_Plugin_Chatbot_Tutorial
4444
End Property
4545

4646
Public Function GetResponse(UserInput As String) As Boolean Implements IPlugin.GetResponse
47-
Dim NewResponse As String = ""
48-
49-
50-
51-
52-
47+
Dim NewResponse As String = "HI - Here we will Design its brain function"
5348

5449
If NewResponse IsNot Nothing Then
5550
Response = NewResponse

SplashScreen.Designer.vb

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

SplashScreen.vb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
Private Sub SplashScreen_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
88
'Set up the dialog text at runtime according to the application's assembly information.
99

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

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

21-
'Format the version information using the text set into the Version control at design time as the
22-
' formatting string. This allows for effective localization if desired.
23-
' Build and revision information could be included by using the following code and changing the
24-
' Version control's designtime text to "Version {0}.{1:00}.{2}.{3}" or something similar. See
25-
' String.Format() in Help for more information.
26-
'
27-
' 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)
28-
2919
Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor)
3020

3121
'Copyright info
3222
Copyright.Text = My.Application.Info.Copyright
3323
Main()
24+
3425
Me.Close()
3526

3627
End Sub
3728

29+
3830
End Class

0 commit comments

Comments
 (0)