Have an existing DDN project?
Make sure to have a DDN cloud project connected to your local project, which is required for PromptQL to work. See ddn project init
In this tutorial we’ll see how to add PromptQL to an existing DDN project.
Go to your DDN project directory
cd mysupergraphRun codemod command using DDN
sudo ddn update-cliFrom the latest cli, run the following command from your project directory:
ddn codemod enable-promptqlThis will make the following changes to your project:
-
Changes to
context.yaml:- Update the
context.yamlfile’sdefinition, to add apromptQL: trueentry. - Add a new
docker-start-promptqlscript to thecontext.yaml.
- Update the
-
Changes to docker compose file used to run Hasura engine:
- Add a new service called
promptql-playground. - Optionally add
ENABLE_SQL_INTERFACEenvironment variable inengineservice (if not present) - Optionally add
io.hasura.ddn.service-namelabel inengineservice (if not present)
- Add a new service called
-
Enable promptQL for the DDN project, and generate a PromptQL API key.
-
Enable promptQL playground for the DDN cloud project, using the LLM api key added in step 1.
Start your assistant
Open a new terminal window, and run the following command from the project directory:
ddn run docker-start-promptqlThis command will execute the script found in your .hasura/context.yaml file.
When you run this command, Docker will start the engine, promptql-playground, and any other services present in the
docker compose file.
Then run the following command to open the DDN console:
ddn console --localBrowser support: PromptQL playground is supported on all browsers except Firefox and Safari. Support for these browsers should be available shortly.
This should open up your browser (or print a browser URL) for opening up your console. It’ll typically be something
like: https://console.hasura.io/local?engine=localhost:3280&promptql=localhost:3282.