Skip to content

Commit 25b9e89

Browse files
committed
feature/add-functionCalling
1 parent a8e2a98 commit 25b9e89

9 files changed

Lines changed: 1832 additions & 3 deletions

File tree

Samples/BD/dados.db

0 Bytes
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
program FunctionCalling;
2+
3+
uses
4+
Vcl.Forms,
5+
Main.View in 'Src\Main.View.pas' {MainView},
6+
uDM in 'Src\uDM.pas' {DM: TDataModule};
7+
8+
{$R *.res}
9+
10+
begin
11+
Application.Initialize;
12+
Application.MainFormOnTaskbar := True;
13+
Application.CreateForm(TMainView, MainView);
14+
Application.CreateForm(TDM, DM);
15+
Application.Run;
16+
end.

Samples/FunctionCalling/FunctionCalling.dproj

Lines changed: 1122 additions & 0 deletions
Large diffs are not rendered by default.
151 KB
Binary file not shown.
Lines changed: 290 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,290 @@
1+
object MainView: TMainView
2+
Left = 0
3+
Top = 0
4+
Caption = 'IA na pr'#225'tica: Function Calling (chamada de fun'#231#227'o)'
5+
ClientHeight = 653
6+
ClientWidth = 742
7+
Color = clBtnFace
8+
Font.Charset = DEFAULT_CHARSET
9+
Font.Color = clWindowText
10+
Font.Height = -12
11+
Font.Name = 'Segoe UI'
12+
Font.Style = []
13+
KeyPreview = True
14+
Position = poScreenCenter
15+
OnCreate = FormCreate
16+
TextHeight = 15
17+
object Splitter1: TSplitter
18+
Left = 0
19+
Top = 321
20+
Width = 742
21+
Height = 5
22+
Cursor = crVSplit
23+
Align = alTop
24+
ExplicitLeft = -284
25+
ExplicitTop = 233
26+
ExplicitWidth = 1025
27+
end
28+
object pnTop: TPanel
29+
Left = 0
30+
Top = 0
31+
Width = 742
32+
Height = 65
33+
Align = alTop
34+
TabOrder = 0
35+
object Label1: TLabel
36+
Left = 18
37+
Top = 8
38+
Width = 50
39+
Height = 15
40+
Caption = 'IA service'
41+
end
42+
object cBoxIAService: TComboBox
43+
Left = 18
44+
Top = 25
45+
Width = 201
46+
Height = 23
47+
Style = csDropDownList
48+
TabOrder = 0
49+
OnChange = cBoxIAServiceChange
50+
end
51+
object TMSFNCCloudAI1: TTMSFNCCloudAI
52+
Left = 480
53+
Top = 8
54+
Width = 26
55+
Height = 26
56+
Visible = True
57+
Service = aiOpenAI
58+
Settings.GeminiModel = 'gemini-1.5-flash-latest'
59+
Settings.OpenAIModel = 'gpt-4o'
60+
Settings.GrokModel = 'grok-3'
61+
Settings.ClaudeModel = 'claude-3-5-sonnet-20241022'
62+
Settings.OllamaModel = 'llama3.2:latest'
63+
Settings.DeepSeekModel = 'deepseek-chat'
64+
Settings.PerplexityModel = 'llama-3.1-sonar-small-128k-online'
65+
Settings.OllamaHost = 'localhost'
66+
Settings.OllamaPath = '/api/chat'
67+
Settings.MistralModel = 'mistral-large-latest'
68+
Tools = <
69+
item
70+
Name = 'IdCliente'
71+
Description = 'Retorne os dados do cliente pelo ID informado'
72+
Parameters = <
73+
item
74+
ArrayProperties = <>
75+
Name = 'IdCliente'
76+
Type = ptNumber
77+
Description = 'Id do cliente'
78+
Properties = <>
79+
end>
80+
OnExecute = TMSFNCCloudAI1Tools3Execute
81+
end
82+
item
83+
Name = 'GetEstoqueProduto'
84+
Description = 'Retorne o estoque do produto informado'
85+
Parameters = <
86+
item
87+
ArrayProperties = <>
88+
Name = 'IdProduto'
89+
Type = ptNumber
90+
Description = 'Id do produto'
91+
Properties = <>
92+
end>
93+
OnExecute = TMSFNCCloudAI1Tools0Execute
94+
end
95+
item
96+
Name = 'GetEndereco'
97+
Description = 'Qual o endere'#231'o do CEP informado'
98+
Parameters = <
99+
item
100+
ArrayProperties = <>
101+
Name = 'CEP'
102+
Type = ptString
103+
Description = 'CEP a ser consultado'
104+
Properties = <>
105+
end>
106+
OnExecute = TMSFNCCloudAI1Tools1Execute
107+
end
108+
item
109+
Name = 'PeriodoVenda'
110+
Description = 'Retorne os dados das vendas do periodo informado'
111+
Parameters = <
112+
item
113+
ArrayProperties = <>
114+
Name = 'DataIni'
115+
Type = ptString
116+
Description = 'Data inicial do periodo de filtro da venda'
117+
Properties = <>
118+
end
119+
item
120+
ArrayProperties = <>
121+
Name = 'DataFim'
122+
Type = ptString
123+
Description = 'Data final do periodo de filtro da venda'
124+
Properties = <>
125+
end>
126+
OnExecute = TMSFNCCloudAI1Tools2Execute
127+
end>
128+
OnExecuted = TMSFNCCloudAI1Executed
129+
end
130+
end
131+
object pnBoth: TPanel
132+
Left = 0
133+
Top = 65
134+
Width = 742
135+
Height = 256
136+
Align = alTop
137+
TabOrder = 1
138+
object gBoxQuestion: TGroupBox
139+
Left = 1
140+
Top = 1
141+
Width = 740
142+
Height = 222
143+
Align = alClient
144+
Caption = ' Prompt / question '
145+
Padding.Left = 1
146+
Padding.Right = 1
147+
Padding.Bottom = 1
148+
TabOrder = 0
149+
object mmQuestion: TMemo
150+
Left = 3
151+
Top = 17
152+
Width = 734
153+
Height = 143
154+
Align = alClient
155+
BorderStyle = bsNone
156+
Lines.Strings = (
157+
'Retorne os dados das vendas do periodo 01/06/2025 a 24/06/2025')
158+
TabOrder = 0
159+
ExplicitLeft = 2
160+
ExplicitTop = 11
161+
end
162+
object gBoxDefaultsPrompts: TGroupBox
163+
Left = 3
164+
Top = 160
165+
Width = 734
166+
Height = 59
167+
Align = alBottom
168+
Caption = ' Defaults Prompts '
169+
TabOrder = 1
170+
object pnDefaultsPrompts01: TPanel
171+
Left = 2
172+
Top = 17
173+
Width = 730
174+
Height = 24
175+
Align = alTop
176+
BevelOuter = bvNone
177+
TabOrder = 0
178+
ExplicitLeft = 1
179+
ExplicitTop = 1
180+
ExplicitWidth = 732
181+
object Button1: TButton
182+
Left = 198
183+
Top = 0
184+
Width = 99
185+
Height = 24
186+
Align = alLeft
187+
Caption = 'Vendas per'#237'odo'
188+
TabOrder = 0
189+
OnClick = Button1Click
190+
end
191+
object Button2: TButton
192+
Left = 297
193+
Top = 0
194+
Width = 182
195+
Height = 24
196+
Align = alLeft
197+
Caption = 'Vendas per'#237'odo (detalhando)'
198+
TabOrder = 1
199+
OnClick = Button2Click
200+
end
201+
object Button3: TButton
202+
Left = 0
203+
Top = 0
204+
Width = 99
205+
Height = 24
206+
Align = alLeft
207+
Caption = 'Dados cliente'
208+
TabOrder = 2
209+
OnClick = Button3Click
210+
end
211+
object Button4: TButton
212+
Left = 99
213+
Top = 0
214+
Width = 99
215+
Height = 24
216+
Align = alLeft
217+
Caption = 'Email cliente'
218+
TabOrder = 3
219+
OnClick = Button4Click
220+
end
221+
end
222+
end
223+
end
224+
object Panel1: TPanel
225+
Left = 1
226+
Top = 223
227+
Width = 740
228+
Height = 32
229+
Align = alBottom
230+
Padding.Top = 2
231+
Padding.Right = 2
232+
Padding.Bottom = 2
233+
TabOrder = 1
234+
object btnExecute: TBitBtn
235+
Left = 1
236+
Top = 3
237+
Width = 102
238+
Height = 26
239+
Cursor = crHandPoint
240+
Align = alLeft
241+
Caption = 'Execute'
242+
TabOrder = 0
243+
OnClick = btnExecuteClick
244+
ExplicitLeft = -2
245+
ExplicitTop = 1
246+
end
247+
object ProgressBar1: TProgressBar
248+
AlignWithMargins = True
249+
Left = 109
250+
Top = 7
251+
Width = 200
252+
Height = 18
253+
Margins.Left = 6
254+
Margins.Top = 4
255+
Margins.Right = 6
256+
Margins.Bottom = 4
257+
Align = alLeft
258+
Smooth = True
259+
Style = pbstMarquee
260+
SmoothReverse = True
261+
State = pbsPaused
262+
TabOrder = 1
263+
end
264+
end
265+
end
266+
object gBoxResponse: TGroupBox
267+
Left = 0
268+
Top = 326
269+
Width = 742
270+
Height = 327
271+
Align = alClient
272+
Caption = ' Response '
273+
Padding.Left = 1
274+
Padding.Right = 1
275+
Padding.Bottom = 1
276+
TabOrder = 2
277+
object mmResponse: TMemo
278+
Left = 3
279+
Top = 17
280+
Width = 736
281+
Height = 307
282+
Align = alClient
283+
BorderStyle = bsNone
284+
ScrollBars = ssVertical
285+
TabOrder = 0
286+
ExplicitLeft = 2
287+
ExplicitTop = 16
288+
end
289+
end
290+
end

0 commit comments

Comments
 (0)