Skip to content

Instantly share code, notes, and snippets.

@potatoqualitee
Created April 21, 2024 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save potatoqualitee/9ee54a021df900f761265e728f2c8c88 to your computer and use it in GitHub Desktop.
Save potatoqualitee/9ee54a021df900f761265e728f2c8c88 to your computer and use it in GitHub Desktop.
function_calling.json
[
{
"type": "function",
"function": {
"name": "Invoke-DbaQuery",
"description": "Use this function to answer user questions about Northwind. Input should be a fully formed SQL query.",
"parameters": {
"properties": {
"Query": {
"type": "string",
"description": "SQL query extracting info to answer the user\u0027s question.\n SQL should be written using this database schema:\n Table: dbo.Categories\nColumns: CategoryID, CategoryName, Description, Picture\n\nTable: dbo.CustomerCustomerDemo\nColumns: CustomerID, CustomerTypeID\nForeign Keys:\n- CustomerTypeID -\u003e dbo.CustomerDemographics(CustomerTypeID)\n\nForeign Keys:\n- CustomerID -\u003e dbo.Customers(CustomerID)\n\nTable: dbo.CustomerDemographics\nColumns: CustomerTypeID, CustomerDesc\n\nTable: dbo.Customers\nColumns: CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax\n\nTable: dbo.Employees\nColumns: EmployeeID, LastName, FirstName, Title, TitleOfCourtesy, BirthDate, HireDate, Address, City, Region, PostalCode, Country, HomePhone, Extension, Photo, Notes, ReportsTo, PhotoPath\nForeign Keys:\n- ReportsTo -\u003e dbo.Employees(EmployeeID)\n\nTable: dbo.EmployeeTerritories\nColumns: EmployeeID, TerritoryID\nForeign Keys:\n- EmployeeID -\u003e dbo.Employees(EmployeeID)\n\nForeign Keys:\n- TerritoryID -\u003e dbo.Territories(TerritoryID)\n\nTable: dbo.Order Details\nColumns: OrderID, ProductID, UnitPrice, Quantity, Discount\nForeign Keys:\n- OrderID -\u003e dbo.Orders(OrderID)\n\nForeign Keys:\n- ProductID -\u003e dbo.Products(ProductID)\n\nTable: dbo.Orders\nColumns: OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia, Freight, ShipName, ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry\nForeign Keys:\n- CustomerID -\u003e dbo.Customers(CustomerID)\n\nForeign Keys:\n- EmployeeID -\u003e dbo.Employees(EmployeeID)\n\nForeign Keys:\n- ShipVia -\u003e dbo.Shippers(ShipperID)\n\nTable: dbo.Products\nColumns: ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued\nForeign Keys:\n- CategoryID -\u003e dbo.Categories(CategoryID)\n\nForeign Keys:\n- SupplierID -\u003e dbo.Suppliers(SupplierID)\n\nTable: dbo.Region\nColumns: RegionID, RegionDescription\n\nTable: dbo.Shippers\nColumns: ShipperID, CompanyName, Phone\n\nTable: dbo.Suppliers\nColumns: SupplierID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, HomePage\n\nTable: dbo.Territories\nColumns: TerritoryID, TerritoryDescription, RegionID\nForeign Keys:\n- RegionID -\u003e dbo.Region(RegionID)\n\nView: dbo.Alphabetical list of products\nColumns: ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued, CategoryName\n\nView: dbo.Category Sales for 1997\nColumns: CategoryName, CategorySales\n\nView: dbo.Current Product List\nColumns: ProductID, ProductName\n\nView: dbo.Customer and Suppliers by City\nColumns: City, CompanyName, ContactName, Relationship\n\nView: dbo.Invoices\nColumns: ShipName, ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry, CustomerID, CustomerName, Address, City, Region, PostalCode, Country, Salesperson, OrderID, OrderDate, RequiredDate, ShippedDate, ShipperName, ProductID, ProductName, UnitPrice, Quantity, Discount, ExtendedPrice, Freight\n\nView: dbo.Order Details Extended\nColumns: OrderID, ProductID, ProductName, UnitPrice, Quantity, Discount, ExtendedPrice\n\nView: dbo.Order Subtotals\nColumns: OrderID, Subtotal\n\nView: dbo.Orders Qry\nColumns: OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia, Freight, ShipName, ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry, CompanyName, Address, City, Region, PostalCode, Country\n\nView: dbo.Product Sales for 1997\nColumns: CategoryName, ProductName, ProductSales\n\nView: dbo.Products Above Average Price\nColumns: ProductName, UnitPrice\n\nView: dbo.Products by Category\nColumns: CategoryName, ProductName, QuantityPerUnit, UnitsInStock, Discontinued\n\nView: dbo.Quarterly Orders\nColumns: CustomerID, CompanyName, City, Country\n\nView: dbo.Sales by Category\nColumns: CategoryID, CategoryName, ProductName, ProductSales\n\nView: dbo.Sales Totals by Amount\nColumns: SaleAmount, OrderID, CompanyName, ShippedDate\n\nView: dbo.Summary of Sales by Quarter\nColumns: ShippedDate, OrderID, Subtotal\n\nView: dbo.Summary of Sales by Year\nColumns: ShippedDate, OrderID, Subtotal\n\n The query should be returned in plain text, not in JSON."
}
},
"type": "object",
"required": [
"Query"
]
}
}
},
{
"type": "function",
"function": {
"name": "Test-SuspectQuery",
"description": "Determine if a SQL query might be suspect for SQL Injection and return true or false.",
"parameters": {
"properties": {
"query": {
"type": "string",
"description": "The SQL query to be evaluated for potential SQL injection risks."
}
},
"type": "object",
"required": [
"query"
]
}
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment