OpenAI
Chat with the OpenAI model about images from URLs in Python
Generate responses in Python using OpenAI’s API with both text and images. Simply add an image by providing its URL, include user messages, set a token limit, and print the result.
Required packages
You need below packages to use the code generated by recipe. All packages are automatically installed in MLJAR Studio.
openai>=1.35.14
Interactive recipe
You can use below interactive recipe to generate code. This recipe is available in MLJAR Studio.
In the below recipe, we assume that you have following variables available in your notebook:
- client (type OpenAI)
Python code
# Python code will be hereCode explanation
- Create the API request.
- Print the response.
Example Python notebooks
Please find inspiration in example notebooks
OpenAI cookbook
Code recipes from OpenAI cookbook.
- « Previous
- Vision with local images
- Next »
- Ollama