OWIS ChatGPT Plugin

In the ever-evolving landscape of digital technology, the ability to access information swiftly and efficiently has become a necessity. As developers of the OWIS system, we recognized the potential of leveraging artificial intelligence to enhance the user experience. This led us to the creation of our ChatGPT plugin, designed to provide real-time information about the OWIS system.

Our plugin serves as a bridge between ChatGPT and the OWIS system, enabling users to retrieve system-specific data directly through their ChatGPT interface.

In this post, we'll delve into the technical aspects of our plugin, exploring its creation, functionality, and the unique value it brings to the users of the OWIS system.

The Need for the Plugin

In the vast realm of artificial intelligence, ChatGPT stands as a powerful tool capable of understanding and generating human-like text. However, its knowledge is based on a diverse range of pre-existing data up until a certain point in time, and it doesn't have the ability to access real-time, system-specific information. This is where our plugin comes into play.

The OWIS system, with its intricate functionalities and extensive capabilities, is a complex entity. Users often have questions about its modules, workflow management, document handling, and more. While ChatGPT is an excellent conversational AI, without our plugin, it lacks the specific knowledge about the OWIS system to answer these questions accurately and in real-time.

In essence, our plugin transforms ChatGPT into a knowledgeable guide for the OWIS system, enhancing user experience and making information retrieval as simple as having a conversation.

How it works

One of the popular types of plugins is „ChatGPT Retrieval plugin“. This type of plugin is used to provide real-time information about a specific domain.

In summary, a user of the ChatGPT application can install available plugins as extensions for ChatGPT application. A plugin represents a set of APIs that are accessible to ChatGPT application. When a user asks a question, ChatGPT application behind the scenes invokes one of the available APIs. The API is responsible for returning text to the ChatGPT application, which contains the answer to the user's question. This text serves as context based on which ChatGPT provides a response to the user.

ChatGPT plugins are currently not available to regular users, but only to ChatGPT Plus subscribers and developers. It is possible to install an unlimited number of plugins, but at any given time, only three plugins can be active.

By activating desired plugins, we make them accessible to the ChatGPT application, where ChatGPT decides based on the conversation whether to use any of the plugins.

How does ChatGPT know which plugin to use based on the user's input?

When publishing a plugin on the plugin store, it is necessary to define a manifest file, which should be located at yourdomain.com/.well-known/ai-plugin.json

The file's content is in the following format:

{

  "schema_version": "v1",

  "name_for_model": "owis",

  "name_for_human": "OWIS",

  "description_for_model": "Your description for model",

  "description_for_human": "Your description for human",

  "auth": {

    "type": "service_http",

    "authorization_type": "bearer",

    "verification_tokens": {

      "openai": ""

    }

  },

  "api": {

    "type": "openapi",

    "url": "yourdomain.com/.well-known/openapi.yaml",

    "has_user_authentication": false

  },

  "logo_url": "yourdomain.com/.well-known/logo.png",

  "contact_email": "",

  "legal_info_url": ""

}

As you can see, one of the fields in this file is 'description_for_model'. In this field, it is necessary to provide a description or instructions to the ChatGPT application about what the plugin represents and when it can be used.

Example:

„Plugin for retrieving information about the OWIS system. OWIS represents an integrated solution...

ChatGPT stores the value of this field in an embedding or vector format. When user asks a question, ChatGPT creates a query embedding of the question and calculates the cosine similarity between query embedding and the embeddings of the descriptions of active plugins. Based on this cosine similarity, ChatGPT determines whether to use any plugin and, if so, which one to use.

How does ChatGPT determine which API to use?

We have seen how ChatGPT determines which plugin to use based on the user's question. Since a plugin can provide multiple APIs available to ChatGPT, the question arises of how ChatGPT knows which API to use?

In addition to the manifest file, developer is required to define the available APIs in the file: yourdomain.com/.well-known/openapi.yaml, using the OPENAPI specification.

This file needs to provide a clear description of the API and all parameters. These descriptions serve as guidelines for the ChatGPT application in determining which API to invoke and with which parameters.

For example, let's suppose we are developing a Todo plugin which, among others, contains an API for creating todo with payload: {„text“: string, „due_date“: Date}.

If a user of ChatGPT application has the Todo plugin activated, they can initiate its call with the following message:

User: Create a todo for me: "Respond to email by 08.12.2023."

Based on this message, ChatGPT will assume that the creation API should be called and will call it with the following parameters: {"text": "Respond to email", "due_date": 08.12.2023}.

Another example of a message could be:             

User: Create a todo for me: "Respond to email by Friday."

In this case, ChatGPT will send the date of the next upcoming Friday for due_date. 

ChatGPT transforms the parameters based on the conversation to match the invoked API.

For example, if the user asks the initial question:

User: "What are actions in OWIS?"

ChatGPT will invoke the API and most likely pass the text unchanged:

ChatGPT calls API with query: "What are actions in OWIS?"

However, if the user asks the subsequent question,

User: "And actions?"

ChatGPT will transform that text into a form that better suits the API, something like:

ChatGPT calls API with query: "What are actions in OWIS system?"

This leads us to the idea that we can also instruct ChatGPT on what to do with a parameter before passing it to the API.

For example, the OWIS ChatGPT plugin contains an API endpoint called api/query with a parameter named queries: string [ ]

Given that the OWIS knowledge base is currently in Bosnian language, it was necessary to transform the parameter and translate it into Bosnian language. Therefore, in the OpenAPI specification, we provided instructions to ChatGPT to translate the question into Bosnian, if the user asks the question in another language. This enables the OWIS ChatGPT plugin to be accessible to all users regardless of their language. 

required:
        - queries
      type: object
      properties:
        queries:
          type: array

 

          description: …
Query list MUST be in Bosnian language. Translate if not in Bosnian…

OWIS ChatGPT plugin

The image below shows the design of the OWIS ChatGPT plugin. It also demonstrates the mode of communication between the ChatGPT application and the plugin. 

As we can see, when a user asks the question: "What are actions in the OWIS system?", ChatGPT application decides to use OWIS plugin, specifically its „/api/search“ API which has one parameter: queries: string[]. Based on the instruction we gave for this parameter (in openapi.yaml), ChatGPT translates queries into Bosnian and calls the API with translated value.

This API performs the following actions:

  1. Creates a query embedding of the text that ChatGPT forwarded: "Šta su akcije u OWIS sistemu?". For this, the OpenAI API and embedding model "text-embedding-ada-002" is used.

  2. Searches the vector base (Qdrant) and finds the most similar paragraphs using cosine similarity (more about Qdrant vector base and filling the knowledge base in the next blog).

  3. Returns the N most similar paragraphs to the ChatGPT application.

Based on these paragraphs, ChatGPT generates its response to the user. 

 

Use Cases

The OWIS ChatGPT plugin brings a new level of functionality and convenience to the ChatGPT application, allowing users to seamlessly access real-time information from the OWIS system.

Below are a few examples of using OWIS plugin in the ChatGPT application:

Example 1:

User: What are actions in OWIS system?

ChatGPT response (with OWIS plugin):

In the OWIS system, actions can be defined as steps in a defined process that are executed as part of a procedure with the aim of achieving a certain outcome or result.

The OWIS system allows the addition of one or more documents and the creation of forms with additional data in actions related to the process, as well as the addition of additional data such as deadlines at the activity level or at the level of the complete request.

ChatGPT response (without OWIS plugin):

In the context of an OWIS system, "OWIS" likely refers to the Optical Waveguide Inspection System, which is used for the automated inspection of optical waveguides. However, if you are referring to a different OWIS system, please provide more details so that I can give you accurate information

Example 2:

User: How to attach a document in the OWIS system.

ChatGPT response (with OWIS plugin):

In the OWIS system, there are several ways you can attach documents:

  1. You can add them from your computer.

  2. You can add them directly from the "Cases" or "DMS" modules.

  3. You can add them from an email.

  4. You can add them from a scanner or fax machine.

Documents within the OWIS "Cases" module are digital records that are added as part of the documentation of a case. It is possible to add documents that are the result of creating a procedure or are in some other way related to the case. Also, there is the possibility of typing the documentation that is attached, which means that certain types of documents can only be added in a certain step, once or more times, and can be mandatory.

Please note that all data about documents are stored in the database and can be checked through the application itself.

ChatGPT response (without OWIS plugin):

I apologize, but as of my knowledge cutoff in September 2021, I am not familiar with an OWIS system that involves attaching documents. It's possible that the system you are referring to was developed or updated after that time. Can you provide more context or details about the OWIS system you are using? This will help me provide you with more accurate information or suggestions on how to attach a document if possible

As we can see, when a user asks the question: "What are actions in the OWIS system?", ChatGPT application decides to use OWIS plugin, specifically its „/api/search“ API which has one parameter: queries: string[]. Based on the instruction we gave for this parameter (in openapi.yaml), ChatGPT translates queries into Bosnian and calls the API with translated value.

This API performs the following actions:

  1. Creates a query embedding of the text that ChatGPT forwarded: "Šta su akcije u OWIS sistemu?". For this, the OpenAI API and embedding model "text-embedding-ada-002" is used.

  2. Searches the vector base (Qdrant) and finds the most similar paragraphs using cosine similarity (more about Qdrant vector base and filling the knowledge base in the next blog).

  3. Returns the N most similar paragraphs to the ChatGPT application.

Based on these paragraphs, ChatGPT generates its response to the user. 

Use Cases

The OWIS ChatGPT plugin brings a new level of functionality and convenience to the ChatGPT application, allowing users to seamlessly access real-time information from the OWIS system.

Below are a few examples of using OWIS plugin in the ChatGPT application:

Example 1:

User: What are actions in OWIS system?

ChatGPT response (with OWIS plugin):

In the OWIS system, actions can be defined as steps in a defined process that are executed as part of a procedure with the aim of achieving a certain outcome or result.

The OWIS system allows the addition of one or more documents and the creation of forms with additional data in actions related to the process, as well as the addition of additional data such as deadlines at the activity level or at the level of the complete request.

ChatGPT response (without OWIS plugin):

In the context of an OWIS system, "OWIS" likely refers to the Optical Waveguide Inspection System, which is used for the automated inspection of optical waveguides. However, if you are referring to a different OWIS system, please provide more details so that I can give you accurate information

Example 2:

User: How to attach a document in the OWIS system.

ChatGPT response (with OWIS plugin):

In the OWIS system, there are several ways you can attach documents:

  1. You can add them from your computer.

  2. You can add them directly from the "Cases" or "DMS" modules.

  3. You can add them from an email.

  4. You can add them from a scanner or fax machine.

Documents within the OWIS "Cases" module are digital records that are added as part of the documentation of a case. It is possible to add documents that are the result of creating a procedure or are in some other way related to the case. Also, there is the possibility of typing the documentation that is attached, which means that certain types of documents can only be added in a certain step, once or more times, and can be mandatory.

Please note that all data about documents are stored in the database and can be checked through the application itself.

ChatGPT response (without OWIS plugin):

I apologize, but as of my knowledge cutoff in September 2021, I am not familiar with an OWIS system that involves attaching documents. It's possible that the system you are referring to was developed or updated after that time. Can you provide more context or details about the OWIS system you are using? This will help me provide you with more accurate information or suggestions on how to attach a document if possible

Conclusion

In this article, we explored a new feature called plugins for ChatGPT. These plugins are important for improving ChatGPT's ability to understand and generate human-like language.

With ChatGPT Retrieval plugin, we can now perform semantic searches and retrieve individual or group documents with ease. No more endless scrolling or searching through piles of files, notes, or emails. This plugin understands your questions and requests in everyday language, making it simple for you to locate the most relevant snippets of information from your data sources.

In this article, we explored a new feature called plugins for ChatGPT. These plugins are important for improving ChatGPT's ability to understand and generate human-like language.

With ChatGPT Retrieval plugin, we can now perform semantic searches and retrieve individual or group documents with ease. No more endless scrolling or searching through piles of files, notes, or emails. This plugin understands your questions and requests in everyday language, making it simple for you to locate the most relevant snippets of information from your data sources.

Previous
Previous

OWIS Q : AI-Powered OWIS

Next
Next

Your Organization Has Grown from a Startup. What Now?