I have a python function that sends a URL for a news article to GPT-4 along with prompts to get information from it.
[
{
"role": "system",
"content": 'You help people get information from articles'
},
{
"role": "user",
"content": f'Here is a URL: {url}'
},
{
"role": "user",
"content": 'Using JSON format, tell what "country" is the article about, what is the "article date" and provide a 100 word "summary" of it.'
},
]
I understand that GPT-4 through the API doesn’t have internet access per this response to some URLs:
Response: I'm sorry, but as an AI, I'm currently unable to directly access or retrieve information from external URLs or websites. However, I can help you understand how to extract information from an article. If you provide the text or key details from the article, I'd be more than happy to help summarize or analyze it.
However, I also get the response I want from some URLs and looks like it is able to go to the URL and get the information from that rather than just scanning the URL string.
For example, this URL: www.leadership.ng/4000mw-electricity-generation-shameful-unacceptable-adelabu gives me this response:
Response: {
"country": "Nigeria",
"article_date": "2021-10-13",
"summary": "The governorship candidate of the All Progressives Congress (APC) in Oyo State, Chief Adebayo Adelabu, has described Nigeria's 4000MW electricity generation as shameful and unacceptable. He stated this during a lecture at the University of Ibadan, where he emphasized the need for Nigeria to improve its power sector. Adelabu also highlighted the importance of electricity in driving economic growth and development. He further suggested that Nigeria should explore alternative sources of energy, such as solar, wind, and nuclear, to boost its electricity generation."
}
Which is exactly what I wanted, although the article_date is wrong but the summary has more information than what is in the URL string, so appears it has gone to the URL.
Can anyone shed some light on what is happening here?