image.png

This is the tutorial on how to set up NLP-SQL Chatbot in Dify on Shakudo Platform

Prerequisites:

  1. User’s need to have access to the Dify tool API codebase here: https://github.com/devsentient/shakudo-examples/tree/main/backend-dify-opensource

  2. Stack Components required/deployed - Dify, Ollama.

  3. Configuration step:

    (Only needed if you want to use Open Source Ollama Model)

    We need to pull the model on Ollama first and then register it to the Dify models.

    To pull a model in Ollama, you can run below command from sessions -

    curl <http://ollama.hyperplane-ollama.svc.cluster.local:11434/api/pull> -d '{
      "name": "qwen2.5:14b-instruct-q4_K_S"
    }
    

And then register a model in Dify like below

Screenshot 2024-11-27 at 11.16.39 AM.png

Step 1: Creating Dify Tool Micro service

Step 2: Creating a Workflow ChatBot

  1. Go to Dify → Studio, and create a chatbot by importing DSL File.

    You can find DSL File in the codebase named as helloSQL.yml . For reference, link here.

    Screenshot 2024-11-27 at 11.23.39 AM.png

  2. Open the helloSQL chatbot.

  3. You can define your dify_tool_api endpoint in the return of Code node as bydefault value or can pass everytime when you chat with the chatbot as parameter.