A demo that illustrates how to use Kor to fill in form fields from a user's request. This can be useful, for example, to define filter settings using natural language.
The JSON schema for Kor is defined in the file schema.json. See also Schema from JSON.
The client frontend was created with GPT Engineer. The prompt for it is in the file prompt. The client can be started by opening the file index.html in a browser.
The server is a Python FastAPI that accepts a query via HTTP Post at /query. The result of the call is the parsed request. An example request is located in the file requests.http
NOTE:
Make sure to provide the OpenAI API key in an environment variable called OPENAI_API_KEY.
The server can be started as follows:
python ./server/server.py