How to call functions with chat models - SQL Function Specification 2
As before, we'll define a function specification for the function we'd like the API to generate arguments for. Notice that we are inserting the database schema into the function specification. This will be important for the model to know about. functions = [ { 'name': 'ask_database', 'description': 'Use this function to answer user questions about music. Input should be a fully formed SQL query.', 'parameters': { 'type': 'object', 'properties': { 'query': { 'type': 'string', 'description': f' SQL query extracting info to answer the user's question. SQL should be written using this database schema: {database_schema_string} The query should be returned in plain text, not in JSON.', }, }, 'required': ['query'], }, }, ]