fac29b / MapXplore

Transport to a random UK postcode and explore. With information on weather, location and chat function to provide interactive local information!
http://18.170.214.75:3000/
0 stars 0 forks source link

Add openai access and obtain paragraph about postcode #13

Closed JamesRobertSutcliffe closed 8 months ago

JamesRobertSutcliffe commented 8 months ago

Hey!

A paragraph about the random postcode now appears under the 'About' section which a chat GPT response to a query about the random postcode.

Screenshot 2024-01-21 183119

Currently this is the only functionality with no ability to respond. We can develop this in a later branch.

I also refacored the 'fetchRandomPostcode' function, splitting up the google API code into a seperate function, similar to how you did with the fetch weather API. I did this so we can test eash function and also because the data was displaying at different times, now I can run each function asynchronously, with the chat GPT response first (which takes the longest) so everytihng appears at once.

Screenshot 2024-01-21 191228

As the GPT response it is quite slow to load, so we should probably add a loading screen which appears while all data is fetched, I will add to the project board.

Going forwards I will make other branches to test what I have added and try to add conversation ability with OPEN AI API. So should be good to pull in if all works on your end! Let me know of any questions or if you spot any issues! :)

Feargh commented 8 months ago

Hey,

This looks good! I had a look at the branch it works well for me! I can see the chatGPT info and google is still loading on my page.

Screenshot 2024-01-21 at 23 15 21

I see what you mean about it being a bit slower, it would definetly be nice to have some sort of indication that it was loading.

Also nice one on adding prettier!

I have merged the branch into main.