We study ChatGPT web services and try to program

We study ChatGPT web services and try to program

As you know, there is no direct access to OpenAI services in the Russian Federation. To work with ChatGPT, many people use Telegram bots, most often free. For the most part, requests to them are undemanding. Users practice English and, without annoying anyone with spaces in spelling, receive a list of all their mistakes. You can ask bots relatively simple questions.

But, the vast majority of robots work on the GPT3.5 version, the capabilities of which are limited. So even a good but not relevant query can get a very strange answer that starts with something like “Yes, I’m just a language model and I can’t do what you want me to…” etc. Don’t forget and that a Telegram bot is unlikely to be able to store a context larger than 4000 tokens.

Therefore, in some cases, it is more convenient to use web services, they have richer functions.


There are, of course, Telegram bots with ChatGPT4, but there are many problems with both of them. They limit you to a limit of 10-20 messages per day, are simply filled with advertisements, constantly require subscription to new Telegram channels, and sometimes even to their groups or registration in other bots. Your message may not be sent to the model without you knowing. The chat will simply “cut” the excess.

The “native” web interface allows you to save not one dialogue context, but several. You can also return to them later, continue working with them, switch from one to another. Of course, robots do not have this functionality. It is good that Telegram saves at least the history of requests. Work in this mode, if it can be called work, is quite inconvenient.

But these are not all “cons”. Not only is all profile data and correspondence stored by Open Ai and Telegram servers or its applications, the chatbot may be specifically designed to steal it from you and, other things being equal, you should not forget about it.

There are available developments based on other AI models. For example, Google Bard looks for an answer in Google output, Perplexity AI uses quotes, Anthropic Claude retells Youtube videos and various texts, the length of which does not exceed 75 thousand words. But these are experimental models and everything is difficult with them so far.

To varying degrees, the original ChatGPT is also included in various available resources. But in this case it may not always be useful. For example, on the Bing.com site, its functionality is cut to the brim. When asked about writing a simple application, he responded with general words such as: “Building such an application can be a complex process, but there are many resources on the Internet that can help you get started.”

In short, it is better to find the right service for regular work with AI.

Web Services: Load oranges tokens in barrels

One important, empirically derived rule of thumb to consider when using paid resources that provide access to artificial intelligence (good web services are all paid) is that one token usually corresponds to about four characters of standard English text, or three quarter of a word One hundred tokens is about 75 words.

Another subtle point is related to the fact that ChatGPT was developed for the English language and (with equal context) is able to remember and process about five times more information in English than in Russian. This can be checked using tokenizers (at the same time, remember that they are different for GPT-3.5 and 4).

There are already quite a few services that provide access to artificial intelligence services from the Russian Federation. Some directly duplicate each other, some copy the OpenAI interface. Only a few go their own way, adding convenience and various features to users.

TheB.AI

Answers the questions quite correctly. Uses up-to-date information and data. Provides access to other AI models and is essentially a service. Unfortunately, not all of the announced features are currently available. Therefore, most of the models are inactive. The service provides the possibility of trial use. You can get some practical benefit from it by investing at least 1000 or more. Daily limit: five requests. And this is not a Russian service, so there may be difficulties with payment.

GPTunnel

A good web service that provides access to ChatGPT and the popular image creation resource Midjourney. Offers a number of roles, which are divided into sections: graphics, audio, training, development, life, content. You can use ChatGPT 3.5 services on a free tariff. The price varies depending on the chat model and the type of message: everything is simple, concise and clear. Only used resources are paid, which is very bribery. In the future, we will use it to generate the code.

ChatGPT.ru

The authors of the service slyly gave it the name of the original. The functionality is the same as in the ChatGPT model — creation and analysis of text information. The service generates quite adequate texts. Its functionality includes the creation of images, but here you should not wait for the “wow effect”: instead of the necessary pictures, some nonsense appears. ChatGPT version is unknown. The limit is up to ten requests per day. The service (or, rather, the chat) is free.

GPT-OPEN

The minimalistic interface hints at ease of use. In the foreground – roles that can be used: programmer, copywriter, marketer – etc. Image creation is available in the premium version. The possibility of creating audio and video files has been announced. The cost of a premium account is 1000 rubles. Like the previous resource, this is rather not a service in the full sense of the word, but more of an online chat.

Neuro Texter

Announced as a service, but there are not many opportunities. Image generation is worthless. The limit is 1100 tokens, the price is 299₽/month. Of course, ChatGPT4 is not bad, but I wanted more from the “service of the future”. Although the prices are affordable.

Chad

There is access to create images. But this feature is paid. Gives an opportunity to receive answers to ten free requests once and then up to three times daily. Prices start from 290₽. There are even smartphone apps for IOS and Android. It seems that this is the oldest such service in the Russian Federation and the leader in visits (1.1 million visitors per month), but the data there has not been updated for several months. It feels like he was abandoned.

GOGPT

The advantage of this service is a free tariff for 60,000 tokens, which allows you to send up to five requests every day, although it is conditioned by waiting for a response from 10 to 30 seconds. Most likely, actually more. Everything would be fine, but the tariff with access to ChatGPT4 in this service will cost from 699 ₽, and the generation of pictures is not yet available.

SEOPTIMUS

An interesting resource for SEO-optimizers. There are special prompt templates and a function to check the text for uniqueness using the corresponding built-in API. You can try the service for free, then you will have to use tariffs from 299₽. This service will be useful for specialists in the field of SEO. It will be incomprehensible to an ordinary user.

We generate… software

We open GPTunnel as the most optimal service for our task (in terms of price/quality ratio) — and enter the necessary requests in our native language. We offer models to generate a program on Arduino. It should control a water electric boiler with three heaters, maintain a room temperature of 20 to 25 ⁰C. At the same time, it is necessary to prevent overheating of the boiler, periodically accidentally turn off one of the heaters to save resources and display basic information on the display. The service issued the following, well-documented fragment, which was immediately compiled in the Arduino IDE:

// Импортируем библиотеки
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal_I2C.h>
#include <Tone.h>

// Подключение пинов для управления тэнами
const int ten1Pin = 2;
const int ten2Pin = 3;
const int ten3Pin = 4;

// Подключение пинов для датчиков температуры
const int roomTempPin = 5;
const int waterTempPin = 6;

// Подключение пинов для дисплея
const int lcdAddr = 0x27;
const int lcdCols = 16;
const int lcdRows = 2;

// Подключение пина для звукового сигнала
const int speakerPin = 7;

// Инициализация объектов для работы с датчиками температуры
   OneWire oneWireRoom(roomTempPin);
   OneWire oneWireWater(waterTempPin);
   DallasTemperature roomTempSensor(&oneWireRoom);
   DallasTemperature waterTempSensor(&oneWireWater);

// Инициализация объекта для работы с дисплеем
     LiquidCrystal_I2C lcd(lcdAddr, lcdCols, lcdRows);

// Инициализация объекта для работы со звуковым сигналом
     Tone speaker;

// Пороговые значения температуры для включения и выключения тэнов
     const float targetTemp = 25.0; // Желаемая температура в помещении
     const float minTemp = 20.0; // Минимальная температура в помещении для включения тэнов
     const float maxTemp = 25.0; // Максимальная температура в помещении для выключения тэнов
     const float waterMaxTemp = 85.0; // Максимальная температура воды в котле

// Флаги для отслеживания состояния нагревателей и перегрева котла
     bool ten1On = false;
     bool ten2On = false;
     bool ten3On = false;
     bool waterOverheated = false;

    void setup() {
    // Инициализация пинов для управления тэнами
         pinMode(ten1Pin, OUTPUT);
         pinMode(ten2Pin, OUTPUT);
         pinMode(ten3Pin, OUTPUT);

  // Инициализация пина для звукового сигнала
         pinMode(speakerPin, OUTPUT);

  // Запуск коммуникации с датчиками температуры
         roomTempSensor.begin();
         waterTempSensor.begin();

  // Инициализация дисплея
         lcd.begin(lcdCols, lcdRows);
         lcd.backlight();

  // Приветствие на дисплее
         lcd.setCursor(0, 0);
         lcd.print("Heating Control");
         lcd.setCursor(0, 1);
         lcd.print("System");

  delay(2000);

  // Очистка дисплея
         lcd.clear();
    }

     void loop() {
  // Получение температуры в помещении
              roomTempSensor.requestTemperatures();
              float roomTemp = roomTempSensor.getTempCByIndex(0);

  // Получение температуры воды в котле
              waterTempSensor.requestTemperatures();
              float waterTemp = waterTempSensor.getTempCByIndex(0);

  // Включение/выключение нагревателей в зависимости от температуры в помещении
         if (roomTemp < minTemp && !ten1On && !ten2On && !ten3On) {
                 ten1On = true;
                 digitalWrite(ten1Pin, HIGH);
                 } else if (roomTemp > maxTemp && (ten1On || ten2On || ten3On)) {
                 ten1On = false;
                 ten2On = false;
                 ten3On = false;
                 digitalWrite(ten1Pin, LOW);
                 digitalWrite(ten2Pin, LOW);
                 digitalWrite(ten3Pin, LOW);
  }

  // Проверка перегрева котла
         if (waterTemp > waterMaxTemp && !waterOverheated) {
                 waterOverheated = true;
                 digitalWrite(ten1Pin, LOW);
                 digitalWrite(ten2Pin, LOW);
                 digitalWrite(ten3Pin, LOW);
                 lcd.clear();
                 lcd.setCursor(0, 0);
                 lcd.print("Boiler Overheated!");
                 lcd.setCursor(0, 1);
                 lcd.print("Water Temp: ");
                 lcd.print(waterTemp);
                 speaker.play(NOTE_A4, 500);
                 }

  // Отображение информации на дисплее
                    lcd.clear();
                    lcd.setCursor(0, 0);
                    lcd.print("Room Temp: ");
                    lcd.print(roomTemp);
                    lcd.setCursor(0, 1);
                    lcd.print("Water Temp: ");
                    lcd.print(waterTemp);

  // Задержка перед следующей итерацией
                       delay(1000);
                   }

This, of course, is only a mockup and you will still have to work with it. Let’s go further and ask the service to create a program for remote control of our boiler via an Android phone, which will have several buttons – turning the boiler on and off, displaying its temperature and the temperature in the room. After several variations of the query, I got the following code:

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;


public class MainActivity extends AppCompatActivity {
    private TextView airTemperatureTextView;
    private TextView waterTemperatureTextView;
    private Button powerOnButton;
    private Button powerOffButton;

    // Предположим, что у нас есть объекты или методы для получения температуры воздуха и воды.
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        airTemperatureTextView = findViewById(R.id.air_temperature_text_view);
        waterTemperatureTextView = findViewById(R.id.water_temperature_text_view);
        powerOnButton = findViewById(R.id.power_on_button);
        powerOffButton = findViewById(R.id.power_off_button);

        // Установка обработчика нажатия на кнопку Включения котла
        powerOnButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // Здесь можно вызвать метод или действие для включения котла
            }
        });

        // Установка обработчика нажатия на кнопку Выключения котла
        powerOffButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // Здесь можно вызвать метод или действие для выключения котла
            }
        });

        // Обновление температуры на экране (в примере предполагается использование отдельного потока
        // для обновления значений температур)
        updateTemperatures();
    }

    private void updateTemperatures() {
        // Получение температуры воздуха и воды и обновление значений на экране
        /*
        double airTemperature = getAirTemperature();
        double waterTemperature = getWaterTemperature();
        airTemperatureTextView.setText("Air Temperature: " + airTemperature + "°C");
        waterTemperatureTextView.setText("Water Temperature: " + waterTemperature + "°C");
         */

        // В примере выше предполагается, что у вас есть объекты или методы для получения значений температур.
        // Если у вас нет таких объектов или методов, вы можете заменить комментарии в коде на нужный вам способ
        // получения значений температур.
    }
}

XML file:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="16dp">

    <TextView
        android:id="@+id/air_temperature_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Air Temperature: N/A"
        android:textAppearance="?android:textAppearanceMedium" />

    <TextView
        android:id="@+id/water_temperature_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Water Temperature: N/A"
        android:textAppearance="?android:textAppearanceMedium" />

    <Button
        android:id="@+id/power_on_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Power On" />

    <Button
        android:id="@+id/power_off_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Power Off" />

</LinearLayout>

There will be a lot more work to be done with this part of the program. Well, even so.

It remains to order the Midjourney boiler control program interface concept:

Apparently, you can’t Google that. Of course, it is not suitable for copying, but it will work as an idea for a design.

As you can see, in general, some services allow you to comfortably work with both ChatGPT and Midjourney, so you can try them in practice. The same GPTunnel shows a very good result.

Related posts