Differences in API Response and ChatGPT Manual Web Response

I have tried like how many medals India won in Olympics and it returned me 2020 data. instead if i search manually in chatGPT prompt it gave me updated information.

{
    "model": "gpt-3.5-turbo",
    "messages":[{"role": "user", "content":"How many medals india won in olympics"}],
    "temperature": 0.7
}

Response:

{
    "id": "chatcmpl-A45SDVi4MuXb3JmhVoWVSN9eTiJG9",
    "object": "chat.completion",
    "created": 1725537641,
    "model": "gpt-3.5-turbo-0125",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "As of the 2020 Tokyo Olympics, India has won a total of 35 Olympic medals. This includes 10 gold, 8 silver, and 17 bronze medals.",
                "refusal": null
            },
            "logprobs": null,
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 16,
        "completion_tokens": 36,
        "total_tokens": 52
    },
    "system_fingerprint": null
}

How to fix this issue and get updated data through API

Welcome to our community!

ChatGPT has a built-in search feature that allows you to get the latest information, but if you are accessing the model via API, you will need to build your own internet search mechanism.

Google Custom Search and serpapi are well known, but they require some effort to implement.

You may also want to look at examples of people who have actually implemented this.

2 Likes