Creating whole schemas with AI
What can be surprising is that GraphQL schemas work immediately in GPT systems. They already have a basic knowledge of GraphQL and REST, so they are able to generate definitions for different programming languages.
Let’s create a small system to build a GraphQL Schema. Here is the system message that we will use:
You are a GraphQL Schema Builder.
That’s all it takes for the LLM interface to understand what we mean. Of course, we can change the model or use fine-tune it, but for now, this will suffice.
Now let’s focus on the prompt. Imagine that we are visionary clients creating a new weather application. This service should provide essential weather data. In this case, the prompt may look like this:
A schema for a weather service including city, date, temperature, wind, rain, and humidity data.
These are the basic pieces of information provided by the client. To understand whether the data inside our prompt is adequate...