OpenAI
See how you can use OpenAI models to do many operations which will help you to handle simple and more complex daily quests. Explore example notebooks with OpenAI use cases created in MLJAR Studio.
Connection with OpenAI Client using Python
Learn how to load your **OpenAI API** key from an environment using Python built-in **dotenv** and **os** libraries. This example also includes creating a client instance and handling authentication errors using the **OpenAI** package.
OpenAI Chat Completion in Python Notebook
See how to create chat completions using **OpenAI models** in Python. This notebook covers sending a user prompt and system, assistant role messages setting a model and token limit, and printing the response.
How to search the cosine similarity using ...
See how to find text most similar to a user query using OpenAI modules in Python. This notebook covers creating embeddings, calculating cosine similarity and returning the most similar chunk with text.
How to generate text embeddings using OpenAI ...
See how to generate text embeddings using OpenAI models in Python. This notebook covers generating embeddings with a specified model and the given text and printing the result.
Generate embeddings for whole files using ...
Generate embeddings for PDF and DOCX files using OpenAI models in Python. In this notebook, you will learn how to read the files, divide their content into chunks and generate embeddings for each of them.
Generate images using OpenAI models in Python
Learn how to generate images using **OpenAI DALL-E 3** model in Python. The notebook covers generating an image with specific parameters, saving it locally and displaying it using the **PIL** library.
Transcribe the speech using OpenAI in Python
Learn how to transcribe audio to text using OpenAI models in Python. This notebook covers sending transcription requests, processing audio files, handling the response, and printing the transcription results efficiently.
Translate the speech using OpenAI in Python
Discover how to translate any audio to English text using the OpenAI model in Python. This notebook covers opening an audio file, sending a translation request, and printing the response.
Generate speech from the given text using ...
See how to generate and play speech from text using OpenAI in Python. This notebook covers setting a file path, creating an API request, saving the response as an MPR3 file and playing the audio.
OpenAI vision with local images in Python
Learn how to use local images in OpenAI's Chat Completions API. This notebook covers encoding images, creating a payload with text and image content, making the API request, and printing the response content.
OpenAI vision with URL images in Python
Discover how to use OpenAI API to create chat completions with text and images given from URL in Python. This notebook covers creating API request with user message and URL image and printing the response.
Build RAG App using OpenAI in Python
Learn how to build a Retrieval-Augmented Generation (RAG) app using the OpenAI API in Python. This notebook explains combining knowledge retrieval and language models to create intelligent and dynamic applications.