Activity
Mon
Wed
Fri
Sun
Oct
Nov
Dec
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
What is this?
Less
More

Memberships

University of Code

Public โ€ข 3.3k โ€ข Free

14 contributions to University of Code
AI SaaS Challenge - snapshot length 0 causing map issue
Hello Papafam I hope you are very well Finally getting through the 5 day challenge and I've hit an issue I think the query in the useCollection might not be retreiving the correct data? firebase looks OK as per the first image I've uploaded, however the terminal is showing the following --- Creating a retriever... --- --- Fetching chat history from the firestore database... --- --- fetched last 0 messages sucessfully --- langchain file const chats = await adminDb .collection("users") .doc(userId) .collection("files") .doc(docId) .collection("chat") .orderBy("createdAt", "desc") //.limit(LIMIT) .get(); const [snapshot, loading, error] = useCollection( user && query( collection(db, "users", user?.id, "files", id, "chat"), orderBy("createdAt", "asc") ) ); ----------------------------------------------------------------------------------------------------- useEffect snippet useEffect(() => { if (!snapshot) return; console.log("updated snapshot", snapshot.docs); console.log("snapshot docs", snapshot.docs.length); // get second last message to check if the AI is thinking const lastMessage = messages.pop(); if (lastMessage?.role === "ai" && lastMessage.message === "Thinking...") { // return as this is a dummy placeholder message return; } const newMessages = snapshot.docs.map((doc) => { const { role, message, createdAt } = doc.data(); return { id: doc.id, role, message, createdAt: createdAt.toDate(), }; }); setMessages(newMessages); // Ignore messages dependancy warning here... we don't want an infinite loop }, [snapshot]); the console shows the length of the snapshot.docs to be 0 which implies to me that nothing was actually retrieved and therefore I get the following error warning: each child in a list should have a unique "key" prop check the render method of 'chat'..... I've tried to find the message.id via console.log and also I rendered the result in the chat and it showed no results but three ,
3
7
New comment 2d ago
AI SaaS Challenge - snapshot length 0 causing map issue
0 likes โ€ข 3d
@Steven Watkins Hi Steven. apologies for the late reply, please see the below link https://github.com/JohnAnt833/chat-with-pdf-challenge Let me know if you find anything, basically the terminal gets the response but it's not rendering it in the chat file, the mapping of messages doesn't find the message.id due to messages having a length of 0, so it mustn't be sending the result to the chat file correctly? Thank you in advance for any help you can give.
1 like โ€ข 2d
@Steven Watkins Honestly really appriecate this!
Now LIVE Building a Zoom Clone with REACT NATIVE!
Watch the LIVE here ๐Ÿ‘‰ https://youtube.com/live/fql4ew5KO1s You'll learn the following in this build: ๐Ÿ‘‰ How to implement Real-time Seamless Audio and Video calling Functionality using GetStream. ๐Ÿ‘‰ Build real iOS & Android apps that can be launched on the Apple App Store and Google Play Store! ๐Ÿ‘‰ Secure User Authentication and Sessions with Clerk Integration ๐Ÿ‘‰ Learn my top Debugging and Troubleshooting Tips for a Seamless Developer Experience when coding in React Native ๐Ÿ‘‰ Learn how to use EAS to create development builds with Expo so you can leverage iOS/Android Native dependancies ๐Ÿ‘‰ How to use TypeScript to reduce the overall number of Bugs and Errors ๐Ÿ‘‰ How to implement Group Calling with Dynamic Participant Management and Layouts ๐Ÿ‘‰ Implement a 'Join Room' functionality so users can send Room ID's to other users they want to Video call with! ๐Ÿ‘‰ And Much More! I'll see you all tomorrow PAPAFAM! โœŒ๏ธ
25
17
New comment 11d ago
Now LIVE Building a Zoom Clone with REACT NATIVE!
2 likes โ€ข 13d
Managed to get some of my lunch hour to catch the live stream, will be doing this later on! Another great build, learning so much! New whiteboard installed today, lots of react and nextJs stuff will be going up!
MIA recently
Hey everyone, Iโ€™ve been super quiet recently due to very poor health. I have an ongoing โ€˜lack of energyโ€™ issue and itโ€™s proving to be difficult to find a solution with my doctor. Because of this, I havenโ€™t been able to engage with the community in over a week and I had some really good momentum going. This week is just a chill and recharge week for me, though I am spending a few hours each day (when possible) on my admin dashboard. The reason for this is because my dashboard is going to manage my daily routine for me. So I try to work on it whenever I can. Additionally, the multi-ai library project that I mentioned the other week has started. I havenโ€™t created a GitHub repository for it yet but Iโ€™ll keep you all posted with my progress and those of you that are interested in contributing towards it, Iโ€™ll post a link with all the relevant info once I have more of it put together. I hope youโ€™re all doing good. PS; @Sonny Sangha, I hope you and your mum both enjoyed Japan. It looked unreal ๐Ÿ‘Œ๐Ÿป Take care of yourselves & keep crushing it! #PAPAFAM ๐Ÿ”ฅ
8
15
New comment 25d ago
2 likes โ€ข 28d
Hope you get better soon! Take a step back for a bit and enjoy something different, even if it's doing nothing! Something I do is watch my favourite sci-fi comedy Red Dwarf! Always makes me laugh. My great grandma who lived till 110 said You need to have a laugh and then you will be OK
Last Week's Success Coaching Call has been Uploaded!
Last Friday's Success Coaching Call by @Aydin Joshi has been uploaded and can be watched here ๐Ÿ‘‰ #From Code to Cash by Aydin Joshi Let us know in the comments if the call taught you something new!
Complete action
16
6
New comment Aug 19
Last Week's Success Coaching Call has been Uploaded!
1 like โ€ข Aug 14
Amazing well done! Keep doing what your doing, a mini Sonny in the making!
OpenAI GPT-4o help please
Hello everyone, I hope all is well I've nearly done the notion clone build, however I don't seem to have access to gpt-4o for the chat to document ai. I've signed up for OpenAI but I only see the following models My head is full on with my code today, so hoping I've missed something and I can sort it after work. Any help would be much appreciated! Many thanks :)
3
7
New comment Aug 12
OpenAI GPT-4o help please
1 like โ€ข Aug 9
@Steven Watkins Hey Steven sorry for the delay in replying Yes its the notion clone ๐Ÿ”ด Letโ€™s build an AI NOTION Clone with NEXT.JS 14! (Realtime Collab, Cloudflare, Clerk, Firebase) (youtube.com) It's all up and running and I'm demoing it to my collegues at work, however I will be breaking it down by tech, as it was a big build and want to concreate my understanding! Yeah it's odd, I log in and get access to all the others, openai I think are in the middle of altering their site, maybe it will appear back or have an alternative way to gain access. I even looked at opengpt which is meant to work alongside openai...
0 likes โ€ข Aug 12
@Steven Watkins Good call Steven! I will take a look, I've built a knowledge base for the company I work for, I used a 3rd party feature called prosemirror. I wanted to use markdown and then convert that into text as an option, so the user if they know markdown, could use that side of it. So when I saw the notion clone, I wanted to see if I could use some things from that, however, the feature I've built is in MVC land, back when I did the knowledge base, I had no experience in React, so I choose not to do it in React. One day I will look at a rebuild and it will use tech, similar to the notion build, as I've got a demo with my senior dev to show off, all this tech etc.. So glad I went down the route to train in react and next.js Have a good week!
1-10 of 14
John Gill
3
34points to level up
@john-gill-5532
Software Dev for 8 years, never had any real exposure to frontend dev before, since watching Sonny's vids I've grown so much!

Active 2d ago
Joined Apr 23, 2024
powered by