How can I add information about movies from 2021-2023 to the OpenAI API?

I’m currently working on developing a chatbot website and I need to incorporate information about movies released between 2021 and 2023 into the OpenAI API. I’m looking for guidance on how to achieve this.

I’ve considered a couple of options but I’m unsure about the best approach:

TMDb API: I’m thinking of using the TMDb API, but I’m not sure how to query it in conjunction with the OpenAI API. Can someone provide guidance on integrating the TMDb API with the OpenAI API for retrieving movie information?

LlamaIndex and IMDb database: Another option I’m considering is utilizing the LlamaIndex and IMDb non-commercial dataset. However, I’m unclear on what exactly LlamaIndex is and whether it’s appropriate to load different TSV files with different information using LlamaIndex.

I would appreciate any insights or recommendations on the best approach to add movie information from 2021-2023 to the OpenAI API.

Hi @eonryan :wave:

Welcome to the OpenAI community.

Here are some approaches:

  1. Use embeddings with the non-commercial dataset.
  2. Build a plugin, if you have dev access and it will be able to query the IMDB API.
  3. Build a custom solution that takes user messages, extracts the intent and necessary params using model(s) on OpenAI API, makes a call to the IMDB API and then display the results in a user-friendly formant.
1 Like

Llamaindex and embeddings would be the better approach now because the first option may require plugins and the API does not easily allow plugins at the moment.

For embeddings or llamaindex the approach would be similar, you divide the dataset into sections, create embeddings for each section, then create embeddings for the user input and compare the input-embeddings with the dataset-embeddings and find the closest matching dataset-embeddings for the input. You then copy those dataaset sections into your prompt and then send the combination of dataset section and user input to the LLM. That should be good enough for it to respond.

1 Like

The third option from @sps is a good approach too tbh, nice one! You can provide the api syntax to a separate LLM agent along with the user input so that it can produce the right query to send to the IMDB API, and then call the API, then get the results, combine results with user input and send it to your main LLM.

1 Like