Making your own Chat with Open AI ChatGPT in Telegram Using InterSystems Interoperability
Hi Community!
Just want to share with you an exercise I made to create "my own" chat with GPT in Telegram.
It became possible because of two components on Open Exchange: Telegram Adapter by @Nikolay Solovyev and IRIS Open-AI by @Kurro Lopez 
So with this example you can setup your own chat with ChatGPT in Telegram.
Let's see how to make it work!
Prerequisites
Create a bot using @BotFather account and get the Bot Token. Then add bot into a telegram chat or channel and give it admin rights. Learn more at https://core.telegram.org/bots/api
Open (create if you don't have it) an account on https://platform.openai.com/ and get your Open AI API Key and Organization id.
Make sure you have IPM installed in your InterSystems IRIS. if not here is one liner to install:
USER> sr=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config"dr.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")Or you can use community docker image with IPM onboard like this:
$ docker run --rm --name iris-demo -d -p 9092:52797 -e IRIS_USERNAME=demo -e IRIS_PASSWORD=demo intersystemsdc/iris-community:latest $ docker exec -it iris-demo iris session iris -U USER USER>
Installation
Install the IPM package in a namespace with Interoperability enabled.
USER>zpm "install telegram-gpt"
Usage
Open the production.

Put your bot's Telegram Token into Telegram business service and Telegram Business operation both:

Also initialize St.OpenAi.BO.Api.Connect operation with your Chat GPT API key and Organization id:

Start the production.
Ask any question in the telegram chat. You'll get an answer via Chat GPT. Enjoy!

And in visual trace:

Details
This example uses 3.5 version of Chat GPT Open AI. It could be altered in the data-transformation rule for the Model parameter.
Comments
pic 1 didnt show up
How about now?
It looks like that organization field for Open AI integration is not mandatory, so only Telegram Token and ChatGPT key needed.
Great!!! Good job
Thank you, @Kurro Lopez! And thanks for introducing chatGPT package to the community!
A new version is coming soon... New features 😉
Looking forward!
In a new version can also be installed as:
USER>zpm "install telegram-gpt -D TgToken=your_telegram_token -D GPTKey=your_ChatGPT_key"
so you can pass the Telegram Token and ChatGPT API keys as production parameters.