GithubHelp home page GithubHelp logo

lagairogo-gai / openai-zendesk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cweems/openai-zendesk

0.0 0.0 1.0 102 KB

A express app that Zendesk App Framework that uses GPT-3 to triage and summarize tickets.

Shell 0.62% JavaScript 91.76% HTML 7.62%

openai-zendesk's Introduction

OpenAI Zendesk Integration

An Node Express app for Zendesk that uses GPT-3 to triage and summarize tickets.

Features

๐Ÿšฆ Ticket Triage: Use GPT-3 to triage new incoming tickets to include a priority, summary note, and group assignee.

๐Ÿ“ Summarize Tickets: reduce long ticket discussions for use-cases like agent handoff.

Demo Video

openai-zendesk-header

Pre-Requisites

  • Zendesk Support: You can create a free trial by following these instructions.
  • Zendesk CLI: Follow these instructions.
  • OpenAI account: You can create one here.
  • Ngrok: If you're running the app locally, you'll need a tunnel service like Ngrok so that Zendesk webhooks can reach your localhost.

Running Locally

App Setup

Clone the sample app, install dependencies, and create a .env file to store API keys:

# Clone the repository:
$ git clone [repo name]

# Switch to the app's directory:
$ cd openai-zendesk

# Install dependencies:
$ npm install

# Copy the example .env file:
$ cp .env.example .env

Adding Secrets to your .env

Configure four values in your .env file:

  • Zendesk Email: This can be your email or someone else's. You might want to create a separate user account named "Agent Assist Bot" so it's clear who is posting on the tickets.
  • Zendek API Key: You can create one in the Zendesk Admin portal under Apps & Integrations > Zendesk API.
  • Zendesk Remote URI: The API URL for your Zendesk instance. It will look like: https://{{your_custom_subdomain}}.zendesk.com/api/v2.
  • OpenAI API Key: you can create one here.

Running Your App

When running locally, the app uses the Zendesk CLI to serve the front-end assets folder to an iframe in Zendesk. The express app runs as a back-end and connects Zendesk to the GPT-3 API.

Use NPM to start up your app backend like this:

# Restart automatically if you make changes:
$ npm run dev

# Just run the app:
$ npm run start

You can serve the app's front-end using the Zendesk CLI:

$ zcli apps:server

Now open a Zendesk Support ticket, adding ?zcli_apps=true to the end of the URL, for example: https://{{your_custom_subdomain}}.zendesk.com/agent/tickets/1?zcli_apps=true

If all goes well, you'll see the Ticket Summary interface loaded in the sidebar. If you click on the "Summarize Ticket" button a note should appear on the ticket summarizing the conversation.

Screen Shot 2023-02-19 at 3 15 59 PM

Triaging New Tickets

The openai-zendesk integration can auto-triage tickets so that each ticket receives a priority, group assignee, and summary comment. This process has three steps:

  1. Run Ngrok as a tunnel to your local environment
  2. Create a Zendesk Webhook
  3. Create a Zendesk Trigger that calls your webhook

To receive webhooks locally, you'll need to spin up Ngrok pointed at your express app:

$ ngrok http 3000

Once Ngrok is running, create a Zendesk Webhook:

  • In Zendesk Admin go to Apps & Integrations > Webhooks.
  • Click on Create Webhook and then click on Trigger or Automation.

Screen Shot 2023-02-19 at 3 35 44 PM


  • Give your webhook a name, and set {{your-ngrok-url}}/triage as the Endpoint URL.
  • Then, click create webhook.

Screen Shot 2023-02-19 at 3 40 04 PM

---

To create a Zendesk Trigger, follow these steps:

  • Go to Zendesk Admin > Objects and Rules > Triggers > Click on Add Trigger
  • Under conditions, determine when you want the trigger to fire. In our case, we fire the trigger when the ticket is new, has no priority, and doesn't have an owner.

Screen Shot 2023-02-19 at 3 41 43 PM


  • Under the Actions section, select Notify active webhook and then select the name of the webhook you created.
  • Set the JSON body of the request to include the ticket id:
{
   "ticket_id": "{{ticket.id}}" 
}

Screen Shot 2023-02-19 at 3 42 09 PM


To test our your webhook integration, create a new ticket. Your app should receive a webhook within 3 - 5 seconds triggering the ticket to be processed and triaged.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.