Skip to content

Commit

Permalink
change chabot launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanguage committed Dec 25, 2023
1 parent 0ba8c27 commit ceb6e09
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions public/chatbot-launcher.imjoy.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

<config lang="json">
{
"name": "Chatbot launcher",
"name": "chatbot-bioengine-client",
"type": "web-worker",
"tags": [],
"ui": "",
"version": "0.1.0",
"cover": "",
"description": "Launch chatbot with bioengine-web-client support",
"description": "Register bioengine web client to chatbot",
"icon": "extension",
"inputs": null,
"outputs": null,
Expand All @@ -25,14 +25,14 @@
<script lang="javascript">
class ImJoyPlugin {
async setup() {
api.log('initialized')
this.chatbot = await api.getWindow("BioImage.IO Chatbot")
if (this.chatbot) {
await this.registerExtensions()
}
}

async run(ctx) {
const chatbot = await api.createWindow({
src: "https://staging.chat.bioimage.io/public/apps/bioimageio-chatbot-client/index",
name: "BioImage.IO Chatbot",
});
async registerExtensions() {
const chatbot = this.chatbot
await chatbot.registerExtension({
_rintf: true,
name: "runImageJMacro",
Expand Down Expand Up @@ -158,6 +158,18 @@
return models;
},
})

api.log('initialized')
}

async run(ctx) {
if (!this.chatbot) {
this.chatbot = await api.createWindow({
src: "https://staging.chat.bioimage.io/public/apps/bioimageio-chatbot-client/index",
name: "BioImage.IO Chatbot",
});
}
await this.registerExtensions()
}
}

Expand Down

0 comments on commit ceb6e09

Please sign in to comment.