A Telegram bot powered by Azure Cognitive Services
MIT License
Why don't you ask the magic conch?
magic-conch is a Telegram bot powered by Azure Cognitive Services.
/chat
to trigger magic conch's response./reset
to reset the conversation history. Each chat maintains its own conversation context./role
to update the system prompt (the role of assistant)./draw
to generate an image using DALL-E and /redraw
to regenerate using previous prompt.EXAMPLE_config.json
as config.json
and fill in with your own information. You must have a valid Azure model deployment. Please see Prerequisite section of Azure documentation. An example is like:{
// Whether to print / send debug information.
"is_debug": false,
// This value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. Alternatively, you can find the value in the Azure OpenAI Studio > Playground > Code View
"base_url": "https://EXAMPLE.openai.azure.com",
// Deployment ID for the model.
"deployment_id": "gpt-35-turbo",
// This value can be found in the Keys & Endpoint section when examining your resource from the Azure portal. You can use either KEY1 or KEY2.
"api_key": "AZURE_API_KEY_HERE",
// Telegram Bot API token.
"telegram_api_key": "TELEGRAM_API_KEY_HERE",
// Telegram chat ID numbers that you want to have access to this bot. Left empty ([]) if you don't want any limitation.
"allowed_chat_ids": [],
// How many messages can be included in one conversation. The more messages included, the better ChatGPT understands the context, however also more tokens it consumes.
"past_messages_included": 10,
// Max tokens can be used.
"max_tokens": 800,
// Controls randomness. Lowering the temperature means that the model produces more repetitive and deterministic responses. Increasing the temperature results in more unexpected or creative responses.
"temperature": 0.7
// Deployment name of the image generation model.
"image_deployment_name": "dall-e-3",
// Size of image. Supported values could differ by different models. Please see `azopenai.ImageSize` for references.
"image_size": "1024x1024"
}
config.json
.docker run -v ./config.json:/app/config.json -d ghcr.io/xnth97/magic-conch:latest
Clone this repo and cd
into directory.
Create a config.json
under the same directory following #2 in above Docker section.
Run with go run .
or build an executable go build .
magic-conch is available under MIT license. See the LICENSE file for more info.