Using an external URL as Context

Hi All,

I got an external public URL, which has got inside a JSON, where I have to do some research.
Is it possible to use that JSON as a context in a prompt?

Ex.
the url www.testtest.it/exaple.json has this structure

[
  {
    "name": "Hidrogênio-1 (Prótio)",
    "protons": 1,
    "neutrons": 0,
    "electrons": 1
  },
  {
    "name": "Hidrogênio-2 (Deutério)",
    "protons": 1,
    "neutrons": 1,
    "electrons": 1
  },
  {
    "name": "Hidrogênio-3 (Trítio)",
    "protons": 1,
    "neutrons": 2,
    "electrons": 1
  },
  {
    "name": "Hélio-3",
    "protons": 2,
    "neutrons": 1,
    "electrons": 2
  }
]

I’d like to ask 2 random value with 1 as value for protons

Thanks

Hi,

Yes, you can just paste JSON strings in raw, the AI understands how to decode them and extract data directly.

2 Likes

Hi,
the problem is exacly this: the URL contain a json who can be changed every time, so put the content inside the prompt is not valid

If you’re using the API you can fetch the contents of the URL every time (or better, use some sort of caching system) and include the text in your prompt.

GPT cannot browse the web or access the URL itself.