Googleai
This Telegram bot uses the PaLM API, an advanced language model, to generate creative and coherent text based on user-provided prompts. Built using the aiogram library, the bot offers an interactive and engaging way to generate written content for various purposes, such as story ideas, creative writing, or even conversation starters.
Install / Use
/learn @bisnuray/GoogleaiREADME
PaLM Telegram Bot
This repository contains the source code for a simple Telegram bot that uses the PaLM API to generate text based on user-provided prompts. The bot is built using the aiogram ↗ library for asynchronous handling of the Telegram bot API.
Features
- Accepts text prompts and generates text using the PaLM API.
- Provides generated text as a response in Telegram.
- Supports the
/startcommand for welcoming users and the/bardcommand for generating text.
Requirements
- Python 3.6 or higher
aiogramlibrarygoogle.generativeailibrary- PaLM API access: Obtain an API key from Google's GenerativeAI Developer Portal ↗
Installation
-
Clone the repository:
git clone https://github.com/bisnuray/googleai/ -
Change the current directory:
cd googleai -
Install the required Python packages:
pip install aiogram google-generativeai -
Replace the
API_KEYandTG_BOT_TOKENplaceholders in thebot.pyscript with your PaLM API key and Telegram bot token, respectively. -
Run the
bot.pyscript:python bot.py
Usage
- Start a conversation with your bot on Telegram.
- Send the
/startcommand to receive a welcome message. - Send the
/bardcommand followed by a text prompt, e.g.,/bard Once upon a time. - The bot will generate text based on the prompt and send it back as a message.
