update naming

This commit is contained in:
ned
2023-07-02 22:57:05 +02:00
parent ff8101b26c
commit 710f1eaaa7
5 changed files with 20 additions and 20 deletions

View File

@@ -112,16 +112,16 @@ Check out the [Budget Manual](https://github.com/n3d1117/chatgpt-telegram-bot/di
| `WORLDTIME_DEFAULT_TIMEZONE` | Default timezone to use, i.e. `Europe/Rome` (required only for the `worldtimeapi` plugin, you can get TZ Identifiers from [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) | - |
#### Available plugins
| Name | Description | Required environment variable(s) |
|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| `weather` | Daily weather and 7-day forecast for any location (powered by [Open-Meteo](https://open-meteo.com)) | - |
| `wolfram` | WolframAlpha queries (powered by [WolframAlpha](https://www.wolframalpha.com)) | `WOLFRAM_APP_ID` |
| `web_search` | Web search (powered by [DuckDuckGo](https://duckduckgo.com)) | - |
| `crypto` | Live cryptocurrencies rate (powered by [CoinCap](https://coincap.io)) - by [@stumpyfr](https://github.com/stumpyfr) | - |
| `spotify` | Spotify top tracks/artists, currently playing song and content search (powered by [Spotify](https://spotify.com)). Requires one-time authorization. | `SPOTIFY_CLIENT_ID`, `SPOTIFY_CLIENT_SECRET`, `SPOTIFY_REDIRECT_URI` |
| `translate` | Translate text to any language (powered by [DuckDuckGo](https://duckduckgo.com)) | - |
| `image_search` | Search image or GIF (powered by [DuckDuckGo](https://duckduckgo.com)) | - |
| `worldtimeapi` | Get latest world time (powered by [WorldTimeAPI](https://worldtimeapi.org/)) | `WORLDTIME_DEFAULT_TIMEZONE` |
| Name | Description | Required environment variable(s) |
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| `weather` | Daily weather and 7-day forecast for any location (powered by [Open-Meteo](https://open-meteo.com)) | - |
| `wolfram` | WolframAlpha queries (powered by [WolframAlpha](https://www.wolframalpha.com)) | `WOLFRAM_APP_ID` |
| `ddg_web_search` | Web search (powered by [DuckDuckGo](https://duckduckgo.com)) | - |
| `ddg_translate` | Translate text to any language (powered by [DuckDuckGo](https://duckduckgo.com)) | - |
| `ddg_image_search` | Search image or GIF (powered by [DuckDuckGo](https://duckduckgo.com)) | - |
| `crypto` | Live cryptocurrencies rate (powered by [CoinCap](https://coincap.io)) - by [@stumpyfr](https://github.com/stumpyfr) | - |
| `spotify` | Spotify top tracks/artists, currently playing song and content search (powered by [Spotify](https://spotify.com)). Requires one-time authorization. | `SPOTIFY_CLIENT_ID`, `SPOTIFY_CLIENT_SECRET`, `SPOTIFY_REDIRECT_URI` |
| `worldtimeapi` | Get latest world time (powered by [WorldTimeAPI](https://worldtimeapi.org/)) | `WORLDTIME_DEFAULT_TIMEZONE` |
Check out the [official API reference](https://platform.openai.com/docs/api-reference/chat) for more details.

View File

@@ -1,11 +1,11 @@
import json
from plugins.images import ImageSearchPlugin
from plugins.translate import TranslatePlugin
from plugins.ddg_image_search import DDGImageSearchPlugin
from plugins.ddg_translate import DDGTranslatePlugin
from plugins.spotify import SpotifyPlugin
from plugins.crypto import CryptoPlugin
from plugins.weather import WeatherPlugin
from plugins.web_search import WebSearchPlugin
from plugins.ddg_web_search import DDGWebSearchPlugin
from plugins.wolfram_alpha import WolframAlphaPlugin
from plugins.worldtimeapi import WorldTimeApiPlugin
@@ -21,10 +21,10 @@ class PluginManager:
'wolfram': WolframAlphaPlugin,
'weather': WeatherPlugin,
'crypto': CryptoPlugin,
'web_search': WebSearchPlugin,
'ddg_web_search': DDGWebSearchPlugin,
'ddg_translate': DDGTranslatePlugin,
'ddg_image_search': DDGImageSearchPlugin,
'spotify': SpotifyPlugin,
'translate': TranslatePlugin,
'image_search': ImageSearchPlugin,
'worldtimeapi': WorldTimeApiPlugin,
}
self.plugins = [plugin_mapping[plugin]() for plugin in enabled_plugins if plugin in plugin_mapping]

View File

@@ -6,7 +6,7 @@ from duckduckgo_search import DDGS
from .plugin import Plugin
class ImageSearchPlugin(Plugin):
class DDGImageSearchPlugin(Plugin):
"""
A plugin to search images and GIFs for a given query, using DuckDuckGo
"""
@@ -24,7 +24,7 @@ class ImageSearchPlugin(Plugin):
"type": {
"type": "string",
"enum": ["photo", "gif"],
"description": "The type of image to search for. Default to photo if not specified",
"description": "The type of image to search for. Default to `photo` if not specified",
}
},
"required": ["query", "type"],

View File

@@ -5,7 +5,7 @@ from duckduckgo_search import DDGS
from .plugin import Plugin
class TranslatePlugin(Plugin):
class DDGTranslatePlugin(Plugin):
"""
A plugin to translate a given text from a language to another, using DuckDuckGo
"""

View File

@@ -6,7 +6,7 @@ from duckduckgo_search import DDGS
from .plugin import Plugin
class WebSearchPlugin(Plugin):
class DDGWebSearchPlugin(Plugin):
"""
A plugin to search the web for a given query, using DuckDuckGo
"""