@mulmochat-plugin/generate-image 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ import type { Component } from "vue";
9
9
  * Backend types that plugins can declare they use.
10
10
  * App layer manages actual provider/model settings for each type.
11
11
  */
12
- export type BackendType = "textLLM" | "imageGen" | "audio" | "search" | "browse" | "map";
12
+ export type BackendType = "textLLM" | "imageGen" | "audio" | "search" | "browse" | "map" | "mulmocast";
13
13
  /**
14
14
  * Context passed to plugin execute function
15
15
  */
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@mulmochat-plugin/ui-image"),o="generateImage",i={type:"function",name:o,description:"Generate an image based on the prompt and display it on the screen. Be descriptive and specify the concrete details of the images in the prompt. Each call generates one image.",parameters:{type:"object",properties:{prompt:{type:"string",description:"A detailed prompt describing the image to generate"}},required:["prompt"]}},p=[{name:"Sunset Beach",args:{imageData:"https://picsum.photos/id/28/800/600",prompt:"A beautiful sunset over a calm ocean beach with palm trees"}},{name:"Mountain Lake",args:{imageData:"https://picsum.photos/id/29/800/600",prompt:"A serene mountain lake surrounded by pine trees and snow-capped peaks"}},{name:"City Skyline",args:{imageData:"https://picsum.photos/id/43/800/600",prompt:"A modern city skyline at night with glowing skyscrapers"}},{name:"Forest Path",args:{imageData:"https://picsum.photos/id/15/800/600",prompt:"A winding path through an enchanted forest with sunlight filtering through the leaves"}}],c=e.defineComponent({__name:"View",props:{selectedResult:{},sendTextMessage:{type:Function}},emits:["updateResult"],setup(t){const n=t,a=e.ref(null);return e.watch(()=>n.selectedResult,s=>{s?.toolName===o&&s.data&&(a.value=s)},{immediate:!0,deep:!0}),(s,h)=>a.value?(e.openBlock(),e.createBlock(e.unref(r.ImageView),{key:0,selectedResult:a.value},null,8,["selectedResult"])):e.createCommentVNode("",!0)}}),m=e.defineComponent({__name:"Preview",props:{result:{}},setup(t){return(n,a)=>(e.openBlock(),e.createBlock(e.unref(r.ImagePreview),{result:t.result},null,8,["result"]))}}),u=async(t,n)=>{const{prompt:a}=n;return t.app?.generateImage?t.app.generateImage(t,a):{message:"generateImage function not available"}};function l(t,n,a){return{toolName:o,data:{imageData:t,prompt:a},message:"",title:n}}const g={toolDefinition:i,execute:u,generatingMessage:"Generating image...",isEnabled:()=>!0,viewComponent:c,previewComponent:m,fileUpload:{acceptedTypes:["image/png","image/jpeg"],handleUpload:l},systemPrompt:`When you are talking about places, objects, people, movies, books and other things, you MUST use the ${o} API to draw pictures to make the conversation more engaging.`,backends:["imageGen"],samples:p},d={plugin:g};exports.default=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("@mulmochat-plugin/ui-image"),o="generateImage",i={type:"function",name:o,description:"Generate an image based on the prompt and display it on the screen. Be descriptive and specify the concrete details of the images in the prompt. Each call generates one image.",parameters:{type:"object",properties:{prompt:{type:"string",description:"A detailed prompt describing the image to generate"}},required:["prompt"]}},p=[{name:"Sunset Beach",args:{imageData:"https://picsum.photos/id/28/800/600",prompt:"A beautiful sunset over a calm ocean beach with palm trees"}},{name:"Mountain Lake",args:{imageData:"https://picsum.photos/id/29/800/600",prompt:"A serene mountain lake surrounded by pine trees and snow-capped peaks"}},{name:"City Skyline",args:{imageData:"https://picsum.photos/id/43/800/600",prompt:"A modern city skyline at night with glowing skyscrapers"}},{name:"Forest Path",args:{imageData:"https://picsum.photos/id/15/800/600",prompt:"A winding path through an enchanted forest with sunlight filtering through the leaves"}}],c=e.defineComponent({__name:"View",props:{selectedResult:{},sendTextMessage:{type:Function}},emits:["updateResult"],setup(t){const n=t,a=e.ref(null);return e.watch(()=>n.selectedResult,s=>{s?.toolName===o&&s.data&&(a.value=s)},{immediate:!0,deep:!0}),(s,h)=>a.value?(e.openBlock(),e.createBlock(e.unref(r.ImageView),{key:0,selectedResult:a.value},null,8,["selectedResult"])):e.createCommentVNode("",!0)}}),m=e.defineComponent({__name:"Preview",props:{result:{}},setup(t){return(n,a)=>(e.openBlock(),e.createBlock(e.unref(r.ImagePreview),{result:t.result},null,8,["result"]))}}),u=async(t,n)=>{const{prompt:a}=n;return t.app?.generateImage?t.app.generateImage(a):{message:"generateImage function not available"}};function l(t,n,a){return{toolName:o,data:{imageData:t,prompt:a},message:"",title:n}}const g={toolDefinition:i,execute:u,generatingMessage:"Generating image...",isEnabled:()=>!0,viewComponent:c,previewComponent:m,fileUpload:{acceptedTypes:["image/png","image/jpeg"],handleUpload:l},systemPrompt:`When you are talking about places, objects, people, movies, books and other things, you MUST use the ${o} API to draw pictures to make the conversation more engaging.`,backends:["imageGen"],samples:p},d={plugin:g};exports.default=d;
package/dist/index.js CHANGED
@@ -73,7 +73,7 @@ const s = "generateImage", d = {
73
73
  }
74
74
  }), _ = async (e, a) => {
75
75
  const { prompt: t } = a;
76
- return e.app?.generateImage ? e.app.generateImage(e, t) : { message: "generateImage function not available" };
76
+ return e.app?.generateImage ? e.app.generateImage(t) : { message: "generateImage function not available" };
77
77
  };
78
78
  function k(e, a, t) {
79
79
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulmochat-plugin/generate-image",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Image generation plugin for MulmoChat",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",