Search

blogia

Integrate the OpenAI o1-preview model into a Python script with LaTeX expression handling

Integrate the OpenAI o1-preview model into a Python script with LaTeX expression handling

Discover how to integrate the new OpenAI o1-preview model into a Python script to enhance your AI projects. This script lets you interact with the OpenAI API using the o1-preview model, with the possibility to include web content in prompts thanks to a web scraping feature. Additionally, it properly handles LaTeX math expressions in the model’s responses, converting them into readable Unicode text in the terminal.

Introduction

On September 12, 2024, OpenAI launched its new series of AI models called OpenAI o1. These models are designed to perform deeper reasoning before providing an answer, enabling them to solve complex problems in science, coding, and mathematics. The o1-preview model particularly excels in these areas, outperforming previous models like gpt-4o.

Key points of the script:

  • o1-preview model integration: The script uses the o1-preview model by default, providing advanced reasoning capabilities.
  • Built-in web scraping: It can extract content from web pages to enrich the prompt context.
  • LaTeX expression handling: Mathematical expressions in responses are converted to Unicode text for easy reading in the terminal.
  • Customizable: The script allows choosing the OpenAI model and can be adapted to various use cases.

In this article, I will detail the script code, explain how it works, and run a series of complex prompts.

Prerequisites

Before starting, make sure you have the following:

  • Python 3.x installed on your machine.
  • An OpenAI API key. You can get one by signing up on OpenAI’s website.
  • A Python virtual environment (recommended to isolate dependencies).
  • The required Python modules.

Setting up the virtual environment

To isolate this project’s dependencies, it is recommended to use a virtual environment. Here is how to create one and install the required dependencies:

python3 -m venv env
source env/bin/activate  # Sur Windows, utilisez env\Scripts\activate
pip install openai selenium webdriver-manager pylatexenc

Setting the OpenAI API key

Set your OpenAI API key as an environment variable:

export OPENAI_API_KEY='votre_clé_api_ici'

Replace 'votre_clé_api_ici' with your actual API key.

Complete script code

Here is the full Python script code:

#!/usr/bin/env python3
import os
import sys
import argparse
import re
from openai import OpenAI
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from pylatexenc.latex2text import LatexNodes2Text


def get_web_content(url):
    if not url:
        return ""

    try:
        # Configure les options de Chrome
        chrome_options = Options()
        # Ne pas utiliser le mode headless pour éviter les problèmes de vérification humaine

        # Utilise ChromeDriverManager pour gérer l\'installation de ChromeDriver
        driver = webdriver.Chrome(
            service=Service(ChromeDriverManager().install()), options=chrome_options
        )

        # Charge la page web
        driver.get(url)

        # Récupère le contenu textuel de la page
        web_content = driver.execute_script("return document.documentElement.innerText")

        # Ferme le navigateur
        driver.quit()

        return web_content if web_content else None
    except Exception as e:
        return None


def convert_latex_to_text(latex_str):
    # Convertit les expressions LaTeX en texte Unicode
    return LatexNodes2Text().latex_to_text(latex_str)


def clean_output(content):
    # Trouve toutes les expressions LaTeX dans le contenu et les convertit
    patterns = [r"\\\\[.*?\\\\]", r"\\\(.*?\\\)", r"\$\$.*?\$\$", r"\$.*?\$"]

    for pattern in patterns:
        matches = re.findall(pattern, content, flags=re.DOTALL)
        for match in matches:
            plain_text = convert_latex_to_text(match)
            content = content.replace(match, plain_text)
    return content


def get_response(prompt, client, model="o1-preview"):
    urls = re.findall(r"(https?://\S+)", prompt)
    for url in urls:
        web_content = get_web_content(url)
        if web_content:
            prompt = prompt.replace(url, web_content)
        else:
            return f"Erreur: Le contenu web pour {url} ne peut être récupéré."

    try:
        response = client.chat.completions.create(
            model=model,
            messages=[
                {
                    "role": "user",
                    "content": prompt,
                },
            ],
        )
        first_choice_message = response.choices[0].message
        content = first_choice_message.content
        # Convertit les expressions LaTeX en texte lisible
        cleaned_content = clean_output(content)
        return cleaned_content
    except Exception as e:
        return f"Une erreur est survenue : {e}"


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("prompt", nargs="?", help="Le prompt contenant des URLs")
    parser.add_argument(
        "--model",
        default="o1-preview",
        choices=["gpt-4o", "o1-preview", "o1-mini"],
        help="Le modèle OpenAI à utiliser (par défaut o1-preview)",
    )
    args = parser.parse_args()

    openai_api_key = os.getenv("OPENAI_API_KEY")
    if not openai_api_key:
        raise ValueError(
            "La clé API OPENAI_API_KEY n'est pas définie dans les variables d\'environnement."
        )

    with OpenAI(api_key=openai_api_key) as client:
        prompt = args.prompt or sys.stdin.read()
        response = get_response(prompt, client, model=args.model)
        print(response)


if __name__ == "__main__":
    main()

Code explanation

Importing required modules

The script starts by importing the essential modules:

  • os, sys, argparse, re: Standard modules to manage environment variables, command-line arguments, and regular expressions.
  • openai: Module to interact with the OpenAI API.
  • selenium and webdriver_manager: To perform web scraping.
  • pylatexenc: To convert LaTeX expressions into readable Unicode text.

Function get_web_content

This function retrieves the textual content of a web page.

def get_web_content(url):
    if not url:
        return ""

    try:
        # Configure les options de Chrome
        chrome_options = Options()
        # Ne pas utiliser le mode headless pour éviter les problèmes de vérification humaine

        # Utilise ChromeDriverManager pour gérer l\'installation de ChromeDriver
        driver = webdriver.Chrome(
            service=Service(ChromeDriverManager().install()), options=chrome_options
        )

        # Charge la page web
        driver.get(url)

        # Récupère le contenu textuel de la page
        web_content = driver.execute_script("return document.documentElement.innerText")

        # Ferme le navigateur
        driver.quit()

        return web_content if web_content else None
    except Exception as e:
        return None

Key points:

  • Chrome options: The script does not use headless mode to avoid human-check challenges some pages impose on headless browsers.
  • ChromeDriverManager: Automatically handles installation and updates of ChromeDriver.
  • Content extraction: Uses JavaScript to extract the page’s full text.
  • Exception handling: In case of an error, the function returns None.

Function convert_latex_to_text

This function converts LaTeX expressions to Unicode text.

def convert_latex_to_text(latex_str):
    # Convertit les expressions LaTeX en texte Unicode
    return LatexNodes2Text().latex_to_text(latex_str)

Key points:

  • Uses the pylatexenc library to convert LaTeX expressions, making math formulas readable in the terminal.

Function clean_output

This function processes the model’s response to convert LaTeX expressions.

def clean_output(content):
    # Trouve toutes les expressions LaTeX dans le contenu et les convertit
    patterns = [r"\\\\[.*?\\\\]", r"\\\(.*?\\\)", r"\$\$.*?\$\$", r"\$.*?\$"]

    for pattern in patterns:
        matches = re.findall(pattern, content, flags=re.DOTALL)
        for match in matches:
            plain_text = convert_latex_to_text(match)
            content = content.replace(match, plain_text)
    return content

Key points:

  • Finding LaTeX expressions: Uses regular expressions to identify formulas.
  • Conversion: Each formula is converted to Unicode text.
  • Replacement: LaTeX formulas are replaced by their readable equivalents.

Function get_response

Prepares the prompt, handles web scraping if necessary, calls the OpenAI API, and cleans the response.

def get_response(prompt, client, model="o1-preview"):
    urls = re.findall(r"(https?://\S+)", prompt)
    for url in urls:
        web_content = get_web_content(url)
        if web_content:
            prompt = prompt.replace(url, web_content)
        else:
            return f"Erreur: Le contenu web pour {url} ne peut être récupéré."

    try:
        response = client.chat.completions.create(
            model=model,
            messages=[
                {
                    "role": "user",
                    "content": prompt,
                },
            ],
        )
        first_choice_message = response.choices[0].message
        content = first_choice_message.content
        # Convertit les expressions LaTeX en texte lisible
        cleaned_content = clean_output(content)
        return cleaned_content
    except Exception as e:
        return f"Une erreur est survenue : {e}"

Key points:

  • URL handling: If the prompt contains URLs, the content is extracted and inserted.
  • OpenAI API call: Sends the modified prompt to the specified model.
  • Response cleaning: LaTeX expressions are converted for easy reading.

Function main

Handles command-line arguments and runs the script.

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("prompt", nargs="?", help="Le prompt contenant des URLs")
    parser.add_argument(
        "--model",
        default="o1-preview",
        choices=["gpt-4o", "o1-preview", "o1-mini"],
        help="Le modèle OpenAI à utiliser (par défaut o1-preview)",
    )
    args = parser.parse_args()

    openai_api_key = os.getenv("OPENAI_API_KEY")
    if not openai_api_key:
        raise ValueError(
            "La clé API OPENAI_API_KEY n'est pas définie dans les variables d\'environnement."
        )

    with OpenAI(api_key=openai_api_key) as client:
        prompt = args.prompt or sys.stdin.read()
        response = get_response(prompt, client, model=args.model)
        print(response)

Key points:

  • Arguments: The script accepts a prompt and a model as arguments.
  • API key: Checks that the API key is set.
  • Execution: Calls get_response and prints the response.

Running the script

if __name__ == "__main__":
    main()

Usage examples

Ask a question requiring reasoning

./openai_poc.py "Dans un triangle rectangle, si les côtés adjacents à l'angle droit mesurent 3 cm et 4 cm, calcule la longueur de l'hypoténuse."

To calculate the length of the hypotenuse in a right triangle where the legs adjacent to the right angle measure 3 cm and 4 cm, we use the Pythagorean theorem:

Hypotenuse2=(Side 1)2+(Side 2)2\text{Hypotenuse}^2 = (\text{Side 1})^2 + (\text{Side 2})^2

Replacing with the given values:

Hypotenuse2=32+42=9+16=25\text{Hypotenuse}^2 = 3^2 + 4^2 = 9 + 16 = 25

Taking the square root of both sides:

Hypotenuse=25=5 cm\text{Hypotenuse} = \sqrt{25} = 5 \text{ cm}

Therefore, the length of the hypotenuse is 5 cm.

The length of the hypotenuse is 5 cm.

Generate a summary of a web page

./openai_poc.py "Fais-moi un résumé de cette page : https://openai.com/index/introducing-openai-o1-preview/"

On September 12, 2024, OpenAI announced the introduction of a new series of AI models called OpenAI o1, designed to take more time to think before answering. These models are capable of reasoning through complex tasks and solving harder problems than previous models in science, coding, and mathematics.

The first model in this series, o1-preview, is now available on ChatGPT and via the OpenAI API. A lighter and more cost-effective version called OpenAI o1-mini is also offered, providing efficient coding capabilities at a reduced cost of 80% compared to o1-preview.

Solve a simple multiplication

./openai_poc.py "Quel est le résultat de 15 x 12 ?"

The result of 15×1215 \times 12 is 180.

Solve a simple equation

./openai_poc.py "Résous l'équation 2x + 5 = 15."

To solve the equation 2x+5=152x + 5 = 15, follow these steps:

  1. Subtract 5 from both sides to isolate the term with the variable:
2x+55=1552x=10\begin{aligned} 2x + 5 - 5 &= 15 - 5 \\ 2x &= 10 \end{aligned}
  1. Divide both sides by 2 to solve for xx:
2x2=102x=5\begin{aligned} \frac{2x}{2} &= \frac{10}{2} \\ x &= 5 \end{aligned}

Solution: x=5x = 5.

Calculate a percentage

./openai_poc.py "Quel est 20% de 250 ?"

20%20\% of 250250 equals 50.

Calculation:

20%×250=(20100)×250=0.2×250=5020\% \times 250 = \left( \frac{20}{100} \right) \times 250 = 0.2 \times 250 = 50

Calculate the area of a circle

./openai_poc.py "Calcule l'aire d'un cercle de rayon 5 cm."

To calculate the area of a circle with radius 5 cm, use the area formula:

A=πr2A = \pi r^2

where:

  • AA is the area of the circle,
  • rr is the radius of the circle.

Replacing rr with 5 cm:

A=π(5 cm)2=π(25 cm2)=25π cm2\begin{aligned} A &= \pi (5 \text{ cm})^2 \\ &= \pi (25 \text{ cm}^2) \\ &= 25\pi \text{ cm}^2 \end{aligned}

So, the area of the circle is 25π cm225\pi \text{ cm}^2.

If you want an approximate value, using π3.1416\pi \approx 3.1416:

A25×3.1416 cm278.54 cm2\begin{aligned} A &\approx 25 \times 3.1416 \text{ cm}^2 \approx 78.54 \text{ cm}^2 \end{aligned}

Thus, the area of the circle is approximately 78.54 cm².

Compute a simple integral

./openai_poc.py "Calcule l'intégrale de 0 à 1 de x^2 dx."

To compute the integral from 0 to 1 of the function x2x^2, we integrate x2x^2 with respect to xx and evaluate the resulting expression between 0 and 1.

Steps:

  1. Integrate x2x^2:
x2dx=x33+C\int x^2 \, dx = \frac{x^3}{3} + C

where C is the constant of integration.

  1. Evaluate between 0 and 1:
01x2dx=[x33]01=(133)(033)\int_0^1 x^2 \, dx = \left[ \frac{x^3}{3} \right]_0^1 = \left( \frac{1^3}{3} \right) - \left( \frac{0^3}{3} \right)
  1. Compute the boundary values:
133=13and033=0\frac{1^3}{3} = \frac{1}{3} \quad \text{and} \quad \frac{0^3}{3} = 0
  1. Subtract the values to get the final result:
01x2dx=130=13\int_0^1 x^2 \, dx = \frac{1}{3} - 0 = \frac{1}{3}

Conclusion:

The value of the integral from 0 to 1 of x2dxx^2 \, dx is 1/31/3.

Calculate an average speed

./openai_poc.py "Si une voiture parcourt 150 km en 3 heures, quelle est sa vitesse moyenne ?"

To calculate the average speed of a car that travels 150 km in 3 hours, use the average speed formula:

Average speed=Total distanceTotal time\text{Average speed} = \frac{\text{Total distance}}{\text{Total time}}

Applying the given values:

Average speed=150 km3 hours=50 km/h\text{Average speed} = \frac{150 \text{ km}}{3 \text{ hours}} = 50 \text{ km/h}

The car’s average speed is therefore 50 km/h.

Classical mechanics

./openai_poc.py "Un bloc de 5 kg est tiré sur une surface sans frottement par une force de 20 N. Calcule son accélération."

To calculate the acceleration of the block, we use Newton’s second law, which states that the net force acting on an object equals the object’s mass multiplied by its acceleration (F=m×aF = m \times a).

Given:

  • Mass of the block, m=5 kgm = 5 \text{ kg}
  • Applied force, F=20 NF = 20 \text{ N}
  • Frictionless surface (so no opposing friction force)

Rearranging the formula to solve for acceleration (aa):

a=Fma = \frac{F}{m}

Plugging in the values:

a=20 N5 kg=4 m/s2a = \frac{20 \text{ N}}{5 \text{ kg}} = 4 \text{ m/s}^2

Answer: The block’s acceleration is 4 meters per second squared (4 m/s24 \text{ m/s}^2).

Solving differential equations

./openai_poc.py "Résous l'équation différentielle dy/dx = x^2 + y^2 avec la condition initiale y(0) = 1."

To solve the differential equation:

dydx=x2+y2\frac{dy}{dx} = x^2 + y^2

with the initial condition y(0)=1y(0) = 1, note that this equation is nonlinear and cannot be solved by elementary methods such as separation of variables or standard integrating factors. However, we can try to transform the equation into a more solvable form.

Step 1: Recognize the equation type

The given equation is a Riccati differential equation of general form:

dydx=q0(x)+q1(x)y+q2(x)y2\frac{dy}{dx} = q_0(x) + q_1(x) y + q_2(x) y^2

In our case:

dydx=x2+0y+1y2\frac{dy}{dx} = x^2 + 0 \cdot y + 1 \cdot y^2

Step 2: Transform into a second-order linear equation

To solve a Riccati equation, use the substitution:

y=uuy = -\frac{u'}{u}

where u=u(x)u = u(x) is a function to determine, and uu' is its derivative with respect to xx.

Compute yy' in terms of uu:

y=uuy = -\frac{u'}{u} y=ddx(uu)y' = -\frac{d}{dx}\left( \frac{u'}{u} \right)

Applying the quotient rule:

y=(uu(u)2u2)y' = -\left( \frac{u'' \cdot u - (u')^2}{u^2} \right)

Step 3: Substitute into the original equation

Substitute yy and yy' into the original differential equation:

y=x2+y2y' = x^2 + y^2 (uu(u)2u2)=x2+(uu)2-\left( \frac{u'' u - (u')^2}{u^2} \right) = x^2 + \left( -\frac{u'}{u} \right)^2

Simplify:

(uu(u)2u2)=x2+(u)2u2-\left( \frac{u'' u - (u')^2}{u^2} \right) = x^2 + \frac{(u')^2}{u^2}

Multiply both sides by u2u^2 to eliminate denominators:

(uu(u)2)=x2u2+(u)2-( u'' u - (u')^2 ) = x^2 u^2 + (u')^2

Simplify:

uu+(u)2=x2u2+(u)2-u'' u + (u')^2 = x^2 u^2 + (u')^2 uu=x2u2-u'' u = x^2 u^2 uu=x2u2u'' u = -x^2 u^2

Divide by uu (assuming u0u \neq 0):

u=x2uu'' = -x^2 u

Step 4: Solve the second-order linear equation

We obtain a homogeneous second-order linear differential equation:

u+x2u=0u'' + x^2 u = 0

This is a linear differential equation with variable coefficients. It is known in relation to Airy-type equations. The solutions are not expressible in elementary functions but are given in terms of special functions called Airy functions.

Solutions:

The general solutions of u+x2u=0u'' + x^2 u = 0 are:

u(x)=C1Ai(ix)+C2Bi(ix)u(x) = C_1 \cdot \text{Ai}(i x) + C_2 \cdot \text{Bi}(i x)

where Ai\text{Ai} and Bi\text{Bi} are Airy functions of the first and second kind, and ii is the imaginary unit with i2=1i^2 = -1.

Step 5: Return to y(x)y(x)

Recall:

y=uuy = -\frac{u'}{u}

Knowing u(x)u(x), we can find y(x)y(x) by computing the derivative of uu and taking the quotient.

Step 6: Apply the initial condition

To determine the integration constants C1C_1 and C2C_2, apply the initial condition y(0)=1y(0) = 1. However, due to the complexity of Airy functions with complex arguments, the explicit calculation is delicate.

Conclusion

The solution of the differential equation dydx=x2+y2\frac{dy}{dx} = x^2 + y^2 with y(0)=1y(0) = 1 is expressed in terms of special functions (Airy functions) and cannot be written explicitly using elementary functions.

Final answer:

The solution of the differential equation dydx=x2+y2\frac{dy}{dx} = x^2 + y^2 with y(0)=1y(0) = 1 is given implicitly in terms of Airy functions and cannot be expressed explicitly with elementary functions.

Electromagnetism

./openai_poc.py "Calcule le champ électrique à une distance r d'une charge ponctuelle Q."

The electric field EE created by a point charge QQ at a distance rr is given by Coulomb’s law. The formula to calculate the electric field is:

E=14πϵ0×Qr2E = \frac{1}{4\pi\epsilon_0} \times \frac{Q}{r^2}

where:

  • EE is the electric field (in volts per meter, V/m),
  • QQ is the point charge (in coulombs, C),
  • rr is the distance to the charge (in meters, m),
  • ϵ0\epsilon_0 is the vacuum permittivity, approximately 8.854×1012 C2/Nm28.854 \times 10^{-12} \text{ C}^2/\text{N}\cdot\text{m}^2.

Example calculation:

Suppose you have a charge Q=2×106 CQ = 2 \times 10^{-6} \text{ C} (2 microcoulombs) and you want to calculate the electric field at a distance r=0.5 mr = 0.5 \text{ m}.

  1. Compute the constant in front of the fraction:
14πϵ0=14π×8.854×10128.988×109 Nm2/C2\frac{1}{4\pi\epsilon_0} = \frac{1}{4\pi \times 8.854 \times 10^{-12}} \approx 8.988 \times 10^9 \text{ N}\cdot\text{m}^2/\text{C}^2
  1. Apply the formula:
E=(8.988×109)×2×106(0.5)2E = (8.988 \times 10^9) \times \frac{2 \times 10^{-6}}{(0.5)^2} E=(8.988×109)×2×1060.25E = (8.988 \times 10^9) \times \frac{2 \times 10^{-6}}{0.25} E=(8.988×109)×8×106E = (8.988 \times 10^9) \times 8 \times 10^{-6} E=71904 V/mE = 71\,904 \text{ V/m}

Conclusion:

The electric field at a distance r=0.5 mr = 0.5 \text{ m} from a point charge Q=2×106 CQ = 2 \times 10^{-6} \text{ C} is E=71904 V/mE = 71\,904 \text{ V/m}.

Thus, to calculate the electric field at a given distance from a point charge, use the formula above, replacing QQ and rr with the specific values for the problem.

Chemical equilibrium

./openai_poc.py "Explique comment le principe de Le Chatelier s'applique à l'équilibre suivant : N2 + 3H2 ⇌ 2NH3."

Le Chatelier’s principle states that when a system at equilibrium is subjected to an external change (stress), it responds in a way that minimizes that disturbance and establishes a new equilibrium. Applied to the following chemical equilibrium:

N2(g)+3H2(g)2NH3(g)N_2(g) + 3H_2(g) \rightleftharpoons 2NH_3(g)

one can analyze how different changes influence the position of equilibrium.

1. Concentration changes: - Increase in reactant concentration (N₂ or H₂): If nitrogen (N₂) or hydrogen (H₂) is added to the system, the concentration of these reactants increases. According to Le Chatelier’s principle, the equilibrium will shift in the direction that consumes the added reactants, i.e., to the right, favoring the formation of ammonia (NH₃).

  • Decrease in product concentration (NH₃): If ammonia is removed from the system, the concentration of NH₃ decreases. The equilibrium will then shift to the right to compensate for this decrease, again favoring the formation of ammonia.

  • Increase in product concentration (NH₃): If ammonia is added to the system, the equilibrium will shift to the left to reduce the excess NH₃, favoring the formation of N₂ and H₂.

2. Change in pressure:

  • Increase in the total pressure of the system: For gases, an increase in pressure (by decreasing volume) favors the reaction that produces the fewer gaseous moles. In this reaction, we go from 4 moles of gas (1 N₂ + 3 H₂) to 2 moles of gas (2 NH₃). Therefore, increasing pressure shifts the equilibrium to the right, favoring the formation of ammonia.

  • Decrease in the total pressure of the system: Conversely, a decrease in pressure will favor the reaction producing the greater number of gaseous moles, shifting the equilibrium to the left and favoring the dissociation of NH₃ into N₂ and H₂.

3. Change in temperature:

  • Exothermic nature of the reaction: The synthesis of ammonia is an exothermic reaction (ΔH<0\Delta H < 0), meaning it releases heat.

  • Increase in temperature: By increasing temperature, heat is supplied to the system. According to Le Chatelier’s principle, the equilibrium will shift in the direction that absorbs this additional heat, therefore to the left (the endothermic reaction), favoring the dissociation of NH₃ into N₂ and H₂.

  • Decrease in temperature: By lowering the temperature, the system responds by producing heat to compensate for this loss. The equilibrium therefore shifts to the right (the exothermic reaction), favoring the formation of ammonia.

4. Presence of a catalyst:

  • Effect of the catalyst: Adding a catalyst (such as finely divided iron with promoters) increases the rate at which equilibrium is reached, but does not change the position of the equilibrium. It accelerates both the forward and reverse reactions equally.

Summary:

Le Chatelier’s principle allows one to predict the direction in which a chemical equilibrium will shift in response to a change in the system’s conditions. For the synthesis of ammonia:

  • High pressure favors the formation of NH₃ (fewer gaseous moles).
  • Low temperature favors the formation of NH₃ (exothermic reaction).
  • Increase in N₂ or H₂ concentrations favors the formation of NH₃.
  • Removal of NH₃ from the system favors the production of more NH₃.

These principles are applied in the Haber-Bosch process to optimize industrial ammonia production.

Conclusion

This Python script offers a practical integration of the OpenAI o1-preview model, allowing you to leverage its advanced reasoning capabilities for a wide range of questions, from the simplest to the most complex. Whether you are a curious beginner or an expert looking to test the model’s limits, this script is a handy tool for your AI projects.

Resources

This document was translated from the fr version into the en language using the gpt-5-mini model. For more information on the translation process, see https://gitlab.com/jls42/ai-powered-markdown-translator