Commit
•
99eb419
1
Parent(s):
4c594fb
Update README.md
Browse files
README.md
CHANGED
@@ -121,7 +121,7 @@ print(doc)
|
|
121 |
### 1. Code Documentation
|
122 |
### prompt
|
123 |
```python
|
124 |
-
|
125 |
--code:def function_2(x): return x / 2
|
126 |
--question:Document the python code above giving function description ,parameters and return type and example how to call the function.
|
127 |
--doc:
|
@@ -210,7 +210,7 @@ text=''' <example_response>
|
|
210 |
### 2. SQL Generation
|
211 |
### prompt
|
212 |
```python
|
213 |
-
|
214 |
<schema>CREATE TABLE department (Department_ID number,
|
215 |
Name text,
|
216 |
Creation text,
|
@@ -238,7 +238,7 @@ SELECT head.name FROM head WHERE head.born_state <> 'California';
|
|
238 |
### 3. Performance Schema Monitoring
|
239 |
### prompt
|
240 |
```python
|
241 |
-
|
242 |
<example>
|
243 |
--question: What are the top 10 most frequently used queries/statements?
|
244 |
--sql: SELECT DIGEST_TEXT, COUNT(*) as frequency FROM performance_schema.events_statements_summary_by_digest GROUP BY DIGEST_TEXT ORDER BY frequency DESC LIMIT 10;
|
@@ -263,7 +263,7 @@ SELECT USER, CURRENT_CONNECTIONS FROM accounts;
|
|
263 |
|
264 |
### prompt
|
265 |
```python
|
266 |
-
|
267 |
<example>
|
268 |
--question: What are the top 10 most frequently used queries/statements?
|
269 |
--sql: SELECT DIGEST_TEXT, COUNT(*) as frequency FROM performance_schema.events_statements_summary_by_digest GROUP BY DIGEST_TEXT ORDER BY frequency DESC LIMIT 10;
|
@@ -309,5 +309,145 @@ List out 10 names of the files with the most read and writes
|
|
309 |
SELECT FILE_NAME FROM file_summary_by_instance ORDER BY SUM_NUMBER_OF_BYTES_READ DESC, SUM_NUMBER_OF_BYTES_WRITE DESC LIMIT 10;
|
310 |
```
|
311 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
### Team
|
313 |
Avi Kothari, Gyan Ranjan, Pratham Gupta, Ritvik Aryan Kalra, Soham Acharya
|
|
|
121 |
### 1. Code Documentation
|
122 |
### prompt
|
123 |
```python
|
124 |
+
prompt =''' <example_response>
|
125 |
--code:def function_2(x): return x / 2
|
126 |
--question:Document the python code above giving function description ,parameters and return type and example how to call the function.
|
127 |
--doc:
|
|
|
210 |
### 2. SQL Generation
|
211 |
### prompt
|
212 |
```python
|
213 |
+
prompt = """Generate a simple SQL query from the schema mentioned for the following question.
|
214 |
<schema>CREATE TABLE department (Department_ID number,
|
215 |
Name text,
|
216 |
Creation text,
|
|
|
238 |
### 3. Performance Schema Monitoring
|
239 |
### prompt
|
240 |
```python
|
241 |
+
prompt = """Generate the SQL query for SkySQL performance schema for the following question.
|
242 |
<example>
|
243 |
--question: What are the top 10 most frequently used queries/statements?
|
244 |
--sql: SELECT DIGEST_TEXT, COUNT(*) as frequency FROM performance_schema.events_statements_summary_by_digest GROUP BY DIGEST_TEXT ORDER BY frequency DESC LIMIT 10;
|
|
|
263 |
|
264 |
### prompt
|
265 |
```python
|
266 |
+
prompt = """Generate the SQL query for SkySQL performance schema for the following question.
|
267 |
<example>
|
268 |
--question: What are the top 10 most frequently used queries/statements?
|
269 |
--sql: SELECT DIGEST_TEXT, COUNT(*) as frequency FROM performance_schema.events_statements_summary_by_digest GROUP BY DIGEST_TEXT ORDER BY frequency DESC LIMIT 10;
|
|
|
309 |
SELECT FILE_NAME FROM file_summary_by_instance ORDER BY SUM_NUMBER_OF_BYTES_READ DESC, SUM_NUMBER_OF_BYTES_WRITE DESC LIMIT 10;
|
310 |
```
|
311 |
|
312 |
+
|
313 |
+
### 4. Function Calling
|
314 |
+
|
315 |
+
### prompt
|
316 |
+
```python
|
317 |
+
prompt = """
|
318 |
+
Give a function call in python langugae for the following question:
|
319 |
+
<example_response>
|
320 |
+
--doc: Description: This function logs a curl command in debug mode.
|
321 |
+
Parameters:
|
322 |
+
- method (str): The HTTP method to use for the request.
|
323 |
+
- url (str): The URL to send the request to.
|
324 |
+
- data (dict, optional): The data to send in the request. Defaults to None.
|
325 |
+
- headers (dict, optional): The headers to send with the request. Defaults to None.
|
326 |
+
- level (int, optional): The log level to use for this log message. Defaults to logging.DEBUG.
|
327 |
+
Returns:
|
328 |
+
- None
|
329 |
+
Example:
|
330 |
+
log_curl_debug('GET', 'https://example.com')
|
331 |
+
--question: log a curl PUT request for url https://web.io/
|
332 |
+
--function_call: log_curl_debug(method='PUT', url = 'https://web.io')
|
333 |
+
</example_response>
|
334 |
+
<doc>
|
335 |
+
Function Name: make_get_req()
|
336 |
+
Description: This function is used to make a GET request.
|
337 |
+
Parameters:
|
338 |
+
- path (str): The path of the URL to be requested.
|
339 |
+
- data (dict): The data to be sent in the body of the request.
|
340 |
+
- flags (dict): The flags to be sent in the request.
|
341 |
+
- params (dict): The parameters to be sent in the request.
|
342 |
+
- headers (dict): The headers to be sent in the request.
|
343 |
+
- not_json_response (bool): OPTIONAL: If set to True, the function will return the raw response content instead of trying to parse it as JSON.
|
344 |
+
- trailing (str): OPTIONAL: For wrapping slash symbol in the end of string.
|
345 |
+
- absolute (bool): OPTIONAL: If set to True, the function will not prefix the URL with the base URL.
|
346 |
+
- advanced_mode (bool): OPTIONAL: If set to True, the function will return the raw response instead of trying to parse it as JSON.
|
347 |
+
Returns:
|
348 |
+
- Union[str, dict, list, None]: The response content as a string, a dictionary, a list, or None if the response was not successful.
|
349 |
+
</doc>
|
350 |
+
<instruction>
|
351 |
+
1. Strictly use named parameters mentioned in the doc to generate function calls.
|
352 |
+
2. Only return the response as python parsable string version of function call.
|
353 |
+
3. mention the 'self' parameter if required.
|
354 |
+
</instruction>
|
355 |
+
<question>
|
356 |
+
Make a GET request for the URL parameter using variable_2. For the params parameter, use 'weight' as one of the keys with variable_3 as its value, and 'width' as another key with a value of 10. For the data parameter, use variable_1. Prefix the URL with the base URL, and ensure the response is in raw format.
|
357 |
+
</question>
|
358 |
+
<response>
|
359 |
+
"""
|
360 |
+
```
|
361 |
+
|
362 |
+
### response
|
363 |
+
```python
|
364 |
+
make_get_req(path='https://example.com/api/v1/users', data=variable_1, params={'weight': variable_3, 'width': 10}, headers={'Content-Type': 'application/json'}, not_json_response=True, absolute=True)
|
365 |
+
```
|
366 |
+
|
367 |
+
|
368 |
+
```python
|
369 |
+
prompt = """
|
370 |
+
Give only function call in python langugae as response for the following question:
|
371 |
+
<example_response>
|
372 |
+
--doc:
|
373 |
+
Function:
|
374 |
+
Help on function head in module pandas.core.generic:
|
375 |
+
|
376 |
+
head(self, n: 'int' = 5) -> 'Self'
|
377 |
+
Return the first `n` rows.
|
378 |
+
|
379 |
+
This function returns the first `n` rows for the object based
|
380 |
+
on position. It is useful for quickly testing if your object
|
381 |
+
has the right type of data in it.
|
382 |
+
|
383 |
+
For negative values of `n`, this function returns all rows except
|
384 |
+
the last `|n|` rows, equivalent to ``df[:n]``.
|
385 |
+
|
386 |
+
If n is larger than the number of rows, this function returns all rows.
|
387 |
+
|
388 |
+
Parameters
|
389 |
+
----------
|
390 |
+
n : int, default 5
|
391 |
+
Number of rows to select.
|
392 |
+
|
393 |
+
Returns
|
394 |
+
-------
|
395 |
+
same type as caller
|
396 |
+
The first `n` rows of the caller object.
|
397 |
+
|
398 |
+
See Also
|
399 |
+
--------
|
400 |
+
DataFrame.tail: Returns the last `n` rows.
|
401 |
+
|
402 |
+
Examples
|
403 |
+
--------
|
404 |
+
>>> df = pd.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
|
405 |
+
... 'monkey', 'parrot', 'shark', 'whale', 'zebra']})
|
406 |
+
>>> df
|
407 |
+
animal
|
408 |
+
0 alligator
|
409 |
+
|
410 |
+
--question: Get the top 5 rows with the highest Engagement_Score. Parameter Description: Use 5 as Number of rows to return ,Use variable_3 as Sorted DataFrame, Do not call any other function, Pass variable to self parameter for method calls
|
411 |
+
--function_call: head(self=variable_3, n=5)
|
412 |
+
</example_response>
|
413 |
+
<doc>
|
414 |
+
Function: sort_values
|
415 |
+
sort_values in module pandas.core.frame:
|
416 |
+
sort_values(self, by: 'IndexLabel', *, axis: 'Axis' = 0, ascending: 'bool | list[bool] | tuple[bool, ...]' = True, inplace: 'bool' = False, kind: 'SortKind' = 'quicksort', na_position: 'str' = 'last', ignore_index: 'bool' = False, key: 'ValueKeyFunc | None' = None) -> 'DataFrame | None'
|
417 |
+
Sort by the values along either axis.
|
418 |
+
Parameters
|
419 |
+
----------
|
420 |
+
by : str or list of str
|
421 |
+
Name or list of names to sort by.
|
422 |
+
|
423 |
+
- if `axis` is 0 or `'index'` then `by` may contain index
|
424 |
+
levels and/or column labels.
|
425 |
+
- if `axis` is 1 or `'columns'` then `by` may contain column
|
426 |
+
levels and/or index labels.
|
427 |
+
axis : "{0 or 'index', 1 or 'columns'}", default 0
|
428 |
+
Axis to be sorted.
|
429 |
+
ascending : bool or list of bool, default True
|
430 |
+
Sort ascending vs. descending. Specify list for multiple sort
|
431 |
+
orders. If this is a list of bools, must match the length of
|
432 |
+
the
|
433 |
+
</doc>
|
434 |
+
<instruction>
|
435 |
+
1. Strictly use named parameters mentioned in the doc to generate function calls.
|
436 |
+
2. Only return the response as python parsable string version of function call.
|
437 |
+
3. Use the 'self' parameter if required in the function call with it's value in named keyword format.
|
438 |
+
</instruction>
|
439 |
+
<question>
|
440 |
+
Using the above function, Sort the DataFrame by the Engagement_Score in descending order. Parameter Description: Use Engagement_Score as Column name to sort by ,Use False as Sort in descending order ,Use variable_1 as DataFrame to sort, Do not call any other function, Pass variable to self parameter for method calls
|
441 |
+
</question>
|
442 |
+
<function_call>
|
443 |
+
"""
|
444 |
+
```
|
445 |
+
### response
|
446 |
+
```python
|
447 |
+
sort_values(self=variable_1, by='Engagement_Score', ascending=False)
|
448 |
+
```
|
449 |
+
|
450 |
+
|
451 |
+
|
452 |
### Team
|
453 |
Avi Kothari, Gyan Ranjan, Pratham Gupta, Ritvik Aryan Kalra, Soham Acharya
|