
Writing a Chatbot Powered by Google Gemini Part II
We introduced the basic operations of a Telegram bots and how to create, configure a Telegram bot and how to use it to interact with users. This time, we talk about how to use Gemini to generate responses. Quick Start We can test Gemini api directly using the official website: We can modify some settings on the run: Modifying Model Parameters Model: which model we’re using. Different models are suitable for different tasks. Temperature: Controls the balance between creativity and focus in the generated output. Higher temperature leads to more adventurous output and vice versa. Stop Sequence: Generation will stop when specified output is generated. Useful for controlling output length and creating a clear ending. Safety Settings: Adjusts the restriction regarding harmful and explicit content. Top K: Controls the tokens at each step of the generation. Only top k words are considered. Top P: Only considers tokens whose cumulative probability falls within a certain threshold. Integration with Telegram We can refer to the quickstart to familiarize ourselves with the api. As said before, we’re only interested in handling text and image messages. ...
