File size: 24,364 Bytes
3d87c18
 
60f68c4
 
76271c7
c101c53
5bd7fd2
c2276e3
 
535f75c
60f68c4
 
 
ccbdd61
60f68c4
331a091
c2276e3
5bd7fd2
 
 
 
 
 
 
76271c7
 
 
5bd7fd2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76271c7
5bd7fd2
76271c7
3d87c18
 
 
ccbdd61
 
 
 
76271c7
 
 
 
c2276e3
76271c7
 
 
 
 
 
 
3d87c18
 
 
76271c7
 
 
 
 
 
 
3d87c18
 
 
76271c7
 
 
 
ccbdd61
 
331a091
c2276e3
 
 
 
 
 
 
 
 
 
dd82d0a
 
 
 
 
76271c7
 
 
 
 
 
 
 
c101c53
76271c7
c2276e3
 
76271c7
 
 
 
 
 
 
c2276e3
76271c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c2276e3
76271c7
 
 
 
 
 
 
 
 
 
 
 
 
c101c53
76271c7
c2276e3
 
76271c7
 
 
 
 
 
 
c2276e3
76271c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c2276e3
76271c7
 
 
 
 
 
 
 
 
 
 
 
 
c101c53
76271c7
c2276e3
 
76271c7
 
 
 
 
 
 
c2276e3
76271c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c2276e3
76271c7
 
 
 
 
 
dd82d0a
 
 
 
76271c7
 
 
c101c53
76271c7
c2276e3
 
76271c7
 
 
 
 
 
 
c2276e3
76271c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3d87c18
76271c7
 
 
 
 
 
 
c2276e3
76271c7
 
 
 
 
 
 
 
 
 
dd82d0a
 
 
c101c53
17c6c25
 
b0dcc61
 
17c6c25
60f68c4
fb65c41
3d87c18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
chart_tools = [
    {
        "type": "function",
            "function": {
                "name": "scatter_chart_generation_func",
                "description": f"""This is a scatter plot generation tool useful to generate scatter plots from queried data from our data source that we are querying.

                The data values will come from the columns of our query.csv (the 'x' and 'y' values of each graph) file but the layout section of the plotly dictionary objects will be generated by you.

                Returns an iframe string which will be displayed inline in our chat window. Do not edit the iframe string returned 

                from the scatter_chart_generation_func function in any way and always display the iframe fully to the user in the chat window. You can add your own text supplementary 

                to it for context if desired.""",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "data": {
                            "type": "array",
                            "description": """The array containing a dictionary that contains the 'data' portion of the plotly chart generation and will include the options requested by the user. 

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work. 

                            Do not include the 'x' or 'y' portions of the object as this will come from the query.csv file generated by our SQLite query. 

                            Infer this from the user's message.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "x_column": {
                            "type": "array",
                            "description": f"""An array of strings that correspond to the the columns in our query.csv file that contain the x values of the graph. There can be more than one column

                            that can each be plotted against the y_column, if needed.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "y_column": {
                            "type": "string",
                            "description": f"""The column in our query.csv file that contain the y values of the graph.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "category": {
                            "type": "string",
                            "description": f"""An optional column in our query.csv file that contain a parameter that will define the category for the data.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "trendline": {
                            "type": "string",
                            "description": f"""An optional field to specify the type of plotly trendline we wish to use in the scatter plot.

                                This trendline value can be one of ['ols','lowess','rolling','ewm','expanding']. 

                                Do not send any values outside of this array as the function will fail. 

                                Infer this from the user's message.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "trendline_options": {
                            "type": "array",
                            "description": """An array containing a dictionary that contains the 'trendline_options' portion of the plotly chart generation.

                            The 'lowess', 'rolling', and 'ewm' options require trendline_options to be included.

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "marginal_x": {
                            "type": "string",
                            "description": f"""The type of marginal distribution plot we'd like to specify for the plotly scatter plot for the x axis.

                                This marginal_x value can be one of ['histogram','rug','box','violin']. 

                                Do not send any values outside of this array as the function will fail. 

                                Infer this from the user's message.""",
                            "items": {
                                "type": "string",
                            }
                        },  
                        "marginal_y": {
                            "type": "string",
                            "description": f"""The type of marginal distribution plot we'd like to specify for the plotly scatter plot for the y axis.

                                This marginal_y value can be one of ['histogram','rug','box','violin']. 

                                Do not send any values outside of this array as the function will fail. 

                                Infer this from the user's message.""",
                            "items": {
                                "type": "string",
                            }
                        },                                               
                        "layout": {
                            "type": "array",
                            "description": """An array containing a dictionary that contains the 'layout' portion of the plotly chart generation. 

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "size": {
                            "type": "string",
                            "description": f"""An optional column in our query.csv file that contain a parameter that will define the size of each plot point.

                            This is useful for a bubble chart where another value in our query can be represented by the size of the plotted point.

                            Values must be greater than or equal to 0 and so in our query, all values less than 0 should be set equal to zero.""",
                            "items": {
                                "type": "string",
                            }
                        }
                    },
                    "required": ["x_column","y_column"],
                },
            }, 
        }, 
        {
        "type": "function",
            "function": {
                "name": "line_chart_generation_func",
                "description": f"""This is a line chart generation tool useful to generate line charts from queried data from our data source that we are querying.

                The data values will come from the columns of our query.csv (the 'x' and 'y' values of each graph) file but the layout section of the plotly dictionary objects will be generated by you.

                Returns an iframe string which will be displayed inline in our chat window. Do not edit the iframe string returned 

                from the line_chart_generation_func function in any way and always display the iframe fully to the user in the chat window. You can add your own text supplementary 

                to it for context if desired.""",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "data": {
                            "type": "array",
                            "description": """The array containing a dictionary that contains the 'data' portion of the plotly chart generation and will include the options requested by the user. 

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work. 

                            Do not include the 'x' or 'y' portions of the object as this will come from the query.csv file generated by our SQLite query. 

                            Infer this from the user's message.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "x_column": {
                            "type": "string",
                            "description": f"""The column in our query.csv file that contain the x values of the graph.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "y_column": {
                            "type": "string",
                            "description": f"""The column in our query.csv file that contain the y values of the graph.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "category": {
                            "type": "string",
                            "description": f"""An optional column in our query.csv file that contain a parameter that will define the category for the data.""",
                            "items": {
                                "type": "string",
                            }
                        },                                               
                        "layout": {
                            "type": "array",
                            "description": """An array containing a dictionary that contains the 'layout' portion of the plotly chart generation. 

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work.""",
                            "items": {
                                "type": "string",
                            }
                        }
                    },
                    "required": ["x_column","y_column","layout"],
                },
            }, 
        }, 
        {
        "type": "function",
            "function": {
                "name": "bar_chart_generation_func",
                "description": f"""This is a bar chart generation tool useful to generate line charts from queried data from our data source that we are querying.

                The data values will come from the columns of our query.csv (the 'x' and 'y' values of each graph) file but the layout section of the plotly dictionary objects will be generated by you.

                Returns an iframe string which will be displayed inline in our chat window. Do not edit the iframe string returned 

                from the bar_chart_generation_func function in any way and always display the iframe fully to the user in the chat window. You can add your own text supplementary 

                to it for context if desired.""",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "data": {
                            "type": "array",
                            "description": """The array containing a dictionary that contains the 'data' portion of the plotly chart generation and will include the options requested by the user. 

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work. 

                            Do not include the 'x' or 'y' portions of the object as this will come from the query.csv file generated by our SQLite query. 

                            Infer this from the user's message.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "x_column": {
                            "type": "string",
                            "description": f"""The column in our query.csv file that contains the x values of the graph.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "y_column": {
                            "type": "string",
                            "description": f"""The column in our query.csv file that contains the y values of the graph.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "category": {
                            "type": "string",
                            "description": f"""An optional column in our query.csv file that contains a parameter that will define the category for the data.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "facet_row": {
                            "type": "string",
                            "description": f"""An optional column in our query.csv file that contains a parameter that will define a faceted subplot, where different rows

                            correspond to different values of the query specified in this parameter.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "facet_col": {
                            "type": "string",
                            "description": f"""An optional column in our query.csv file that contain a parameter that will define the faceted column, corresponding to 

                            different values of our query specified in this parameter.""",
                            "items": {
                                "type": "string",
                            }
                        },                                            
                        "layout": {
                            "type": "array",
                            "description": """An array containing a dictionary that contains the 'layout' portion of the plotly chart generation. 

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work.""",
                            "items": {
                                "type": "string",
                            }
                        }
                    },
                    "required": ["x_column","y_column","layout"],
                },
            }, 
        },  
        {
        "type": "function",
            "function": {
                "name": "pie_chart_generation_func",
                "description": f"""This is a pie chart generation tool useful to generate pie charts from queried data from our data source that we are querying.

                The data values will come from the columns of our query.csv (the 'values' and 'names' values of each graph) file but the layout section of the plotly dictionary objects will be generated by you.

                Returns an iframe string which will be displayed inline in our chat window. Do not edit the iframe string returned 

                from the pie_chart_generation_func function in any way and always display the iframe fully to the user in the chat window. You can add your own text supplementary 

                to it for context if desired.""",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "data": {
                            "type": "array",
                            "description": """The array containing a dictionary that contains the 'data' portion of the plotly chart generation and will include the options requested by the user. 

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work. 

                            Do not include the 'x' or 'y' portions of the object as this will come from the query.csv file generated by our SQLite query. 

                            Infer this from the user's message.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "values": {
                            "type": "string",
                            "description": f"""The column in our query.csv file that contain the values of the pie chart.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "names": {
                            "type": "string",
                            "description": f"""The column in our query.csv file that contain the label or section of each piece of the pie graph and allow us to know what each piece of the pie chart represents.""",
                            "items": {
                                "type": "string",
                            }
                        },                                           
                        "layout": {
                            "type": "array",
                            "description": """An array containing a dictionary that contains the 'layout' portion of the plotly chart generation. 

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work.""",
                            "items": {
                                "type": "string",
                            }
                        }
                    },
                    "required": ["values","names","layout"],
                },
            }, 
        },
        {
        "type": "function",
            "function": {
                "name": "histogram_generation_func",
                "description": f"""This is a histogram generation tool useful to generate histograms from queried data from our data source that we are querying.

                The data values will come from the columns of our query.csv (the 'values' and 'names' values of each graph) file but the layout section of the plotly dictionary objects will be generated by you.

                Returns an iframe string which will be displayed inline in our chat window. Do not edit the iframe string returned 

                from the histogram_generation_func function in any way and always display the iframe fully to the user in the chat window. You can add your own text supplementary 

                to it for context if desired.""",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "data": {
                            "type": "array",
                            "description": """The array containing a dictionary that contains the 'data' portion of the plotly chart generation and will include the options requested by the user. 

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work. 

                            Do not include the 'x' or 'y' portions of the object as this will come from the query.csv file generated by our SQLite query. 

                            Infer this from the user's message.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "x_column": {
                            "type": "string",
                            "description": f"""The column in our query.csv file that contains the x values of the histogram. 

                            This would correspond to the counts that would be distributed in the histogram.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "y_column": {
                            "type": "string",
                            "description": f"""An optional column in our query.csv file that contains the y values of the histogram.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "histnorm": {
                            "type": "string",
                            "description": f"""An optional argument to specify the type of normalization if the default isn't used.

                            This histnorm value can be one of ['percent','probability','density','probability density'].

                            Do not send any values outside of this array as the function will fail.""",
                            "items": {
                                "type": "string",
                            }
                        }, 
                        "category": {
                            "type": "string",
                            "description": f"""An optional column in our query.csv file that contains a parameter that will define the category for the data.""",
                            "items": {
                                "type": "string",
                            }
                        },
                        "histfunc": {
                            "type": "string",
                            "description": f"""An optional value that represents the function of data to compute the function which is used on the optional y column.

                            This histfunc value can be one of ['avg','sum','count']. 

                                Do not send any values outside of this array as the function will fail.""",
                            "items": {
                                "type": "string",
                            }
                        },                                         
                        "layout": {
                            "type": "array",
                            "description": """An array containing a dictionary that contains the 'layout' portion of the plotly chart generation. 

                            The array must contain a json formatted dictionary with outer brackets included, any other format will not work.""",
                            "items": {
                                "type": "string",
                            }
                        }
                    },
                    "required": ["x_column"],
                },
            }, 
        },                     
        {
        "type": "function",
            "function": {
                "name": "table_generation_func",
                "description": f"""This an table generation tool useful to format data as a table from queried data from our data source that we are querying.

                Takes no parameters as it uses data queried in our query.csv file to build the table.

                Call this function after running our SQLite query and generating query.csv.

                Returns an iframe string which will be displayed inline in our chat window. Do not edit the iframe string returned 

                from the table_generation_func function in any way and always display the iframe fully to the user in the chat window.""",
                "parameters": {},
            }, 
        }
]