{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "llama3-chat"
      },
      "id": "WebhookTrigger",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [200, 300]
    },
    {
      "parameters": {
        "authentication": "none",
        "url": "http://localhost:11434/api/chat",
        "method": "POST",
        "responseFormat": "json",
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={\n  \"model\": \"llama3\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"{{$json[\"body\"][\"message\"]}}\"\n    }\n  ]\n}"
      },
      "id": "HTTP_Request",
      "name": "Ollama - LLaMA 3",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [450, 300]
    },
    {
      "parameters": {
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "WebhookResponse",
      "name": "Webhook Response",
      "type": "n8n-nodes-base.webhookResponse",
      "typeVersion": 1,
      "position": [700, 300]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Ollama - LLaMA 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ollama - LLaMA 3": {
      "main": [
        [
          {
            "node": "Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
