Skip to content

Commit

Permalink
feat: add Pollinations.ai image plugin #308
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark committed Nov 28, 2024
1 parent 6836b5c commit 16d043a
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/buildinfo.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/lib/core/src/config/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const BUILD_TIMESTAMP = 1732293307;
export const BUILD_VERSION = '2f6b657';
export const BUILD_TIMESTAMP = 1732772382;
export const BUILD_VERSION = '6836b5c';
5 changes: 2 additions & 3 deletions packages/lib/core/src/telegram/command/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ async function handlePluginCommand(message: Telegram.Message, command: string, r
DATA,
ENV: ENV.PLUGINS_ENV,
});
if (type === 'image') {
return sender.sendPhoto(content);
}
switch (type) {
case 'image':
return sender.sendPhoto(content);
case 'html':
return sender.sendRichText(content, 'HTML');
case 'markdown':
Expand Down
30 changes: 30 additions & 0 deletions plugins/pollinations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"url": "https://image.pollinations.ai/prompt/{{DATA}}",
"method": "GET",
"headers": {
"accept": "application/dns-json"
},
"input": {
"type": "text",
"required": true
},
"query": {
"width": "{{ENV.POLLINATIONS_IMAGE_WIDTH}}",
"height": "{{ENV.POLLINATIONS_IMAGE_HEIGHT}}",
"model": "{{ENV.POLLINATIONS_MODEL}}",
"nologo": "{{ENV.POLLINATIONS_NOLOGO}}",
"private": "{{ENV.POLLINATIONS_PRIVATE}}",
"enhance": "{{ENV.POLLINATIONS_ENHANCE}}"
},
"response": {
"content": {
"input_type": "blob",
"output_type": "image"
},
"error": {
"input_type": "text",
"output_type": "text",
"output": "Error: {{.}}"
}
}
}

0 comments on commit 16d043a

Please sign in to comment.