ChatGpt - EDI Integration Tests

This is still very experimental, but I managed to get native ChatGPT, without any plugins, to autonomously execute commands in EDI.

To make it work, you first need to pass ChatGPT the list of galleries so it knows which ones to use. It could also be useful to generate a self-descriptive list of strokes, so ChatGPT can reference them more effectively.

The process is simple: you provide it with the Swagger file or an example of how to interact with EDI using JavaScript, then ask it to control the sequence of galleries from a basic HTML page. ChatGPT generates the code, which you then send to the editing section.

In the top right corner, there’s a Preview button—clicking it runs the page and starts sending commands to EDI. The best part is that the page remains loaded and updates automatically as ChatGPT generates new versions.

It’s still a bit challenging if you’re not familiar with coding, but hopefully, someone will come up with a solid prompt and share it!



Api Edi Definition to GPT

http://localhost:5000/

{
  "openapi": "3.0.1",
  "info": {
    "title": "Edi Rest",
    "version": "v1"
  },
  "paths": {
    "/Devices": {
      "get": {
        "tags": [
          "Devices"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeviceDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeviceDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeviceDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Devices/{deviceName}/Range/{min}-{max}": {
      "post": {
        "tags": [
          "Devices"
        ],
        "parameters": [
          {
            "name": "deviceName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 100,
              "minimum": 0,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "max",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 100,
              "minimum": 0,
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Edi/Play/{name}": {
      "post": {
        "tags": [
          "Edi"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "seek",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Edi/Stop": {
      "post": {
        "tags": [
          "Edi"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Edi/Pause": {
      "post": {
        "tags": [
          "Edi"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Edi/Resume": {
      "post": {
        "tags": [
          "Edi"
        ],
        "parameters": [
          {
            "name": "AtCurrentTime",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Edi/Intensity/{max}": {
      "post": {
        "tags": [
          "Edi"
        ],
        "parameters": [
          {
            "name": "max",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 100,
              "minimum": 0,
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Edi/Definitions": {
      "get": {
        "tags": [
          "Edi"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DefinitionGallery"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DefinitionGallery"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DefinitionGallery"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DefinitionGallery": {
        "required": [
          "endTime",
          "fileName",
          "name",
          "type"
        ],
        "type": "object",
        "properties": {
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "type": {
            "minLength": 1,
            "pattern": "filler|gallery|reaction",
            "type": "string"
          },
          "fileName": {
            "minLength": 1,
            "type": "string"
          },
          "startTime": {
            "type": "integer",
            "format": "int64"
          },
          "endTime": {
            "type": "integer",
            "format": "int64"
          },
          "duration": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "loop": {
            "type": "boolean"
          },
          "variant": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DeviceDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "variants": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "isReady": {
            "type": "boolean"
          },
          "selectedVariant": {
            "type": "string",
            "nullable": true
          },
          "min": {
            "type": "integer",
            "format": "int32"
          },
          "max": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      }
    }
  }
}
6 Likes

A good idea would be to process many one stroke scripts in CSV format so that GPT can extract important information such as speed, zone, whether it contains vibrations, general intensity, secuence and organize it under a single unique name, like a self-descriptive catalog, for reuse across different sessions.

so how are you gonna interact with gpt?
or are you not trying to let gpt actively control your device?
sry I didn’t quite get it

In another software post I wrote, I managed to make it perform several edging algorithms based on a key you press when you’re on the edge. It can not only play sequences but also include interactive logic based on an erotic novel-style narrative. However, GPT is very limited, unlike Grok.

Oh, then this makes more sense to me.
Good stuff :+1: