2025-03-25 Week 11 - Session 1 - TDS Jan 25#
Duration: 1h 17m
Here’s the live tutorial transcribed into an FAQ format:
Q1: I’m having trouble getting the endpoint to work. It seems like the question should be sent in form data, not JSON, is that right?
A1: Yes, you’re absolutely correct! My apologies, that was the issue. Thank you for pointing that out.
Q2: How do I handle sending this data programmatically, without using a client like Thunder Client?
A2: You can achieve that using Python’s requests library.
Q3: How would I catch that form data on the backend once it’s sent programmatically?
A3: My apologies, I made some changes earlier and am still debugging to show that live, but essentially, the backend needs to retrieve the form data. I’ve now fixed it, and you can see that the question is printed and the most similar question from our bank is returned.
Q4: Since the server is already running, shouldn’t the embeddings for the pre-defined questions already be created, making the process faster?
A4: You’re right, ideally they should be. My mistake, I’m not actually storing those embeddings. It’s crucial to store your embeddings, especially when working with LLMs, as recreating them repeatedly consumes both time and tokens. Always store your embeddings somewhere (e.g., in a file) to reuse them.
Q5: How much money will it cost to deploy on Azure, or is it free?
A5: If you’re a student, you can leverage the Azure Education Pack. With your student email, you can get $100 worth of credits for free for one year.
Q6: I used my credits last year and only have $23 left. Will that be enough, and do credits get consumed per API request or for server uptime?
A6: $23 should be sufficient if you use your credits economically. The server consumes credits whenever it’s running, regardless of whether API requests are actively being made or not. So, be mindful to shut down your server when it’s not in use. I recommend running your application locally first for development, and only deploying to Azure for trial runs or when needed, ensuring you turn it off when you’re done.
Q7: Could you please include a question that involves file upload in the next session on Thursday?
A7: Yes, absolutely. I can certainly demonstrate how to handle file uploads.
Q8: Can you also provide some general debugging help for our specific problems, similar to how you helped with the form data issue?
A8: Yes, I can do that. I’ll set up a Discord or Discourse post where you can list your specific issues related to the project. I’ll review those and try to address the most common or complex problems in our Thursday session.
Q9: I’m concerned about the time it takes for debugging and deployment, especially with other academic commitments like OPP/Vivas. Also, we might need to change code specifically for Azure deployment. This adds to the time pressure.
A9: I understand the time constraints and the challenges with adapting code for different deployment environments. My suggestion is to focus on preparing the functions for the questions you can tackle without major issues. For deployment, I will demonstrate a fully working application on Thursday using Azure, which you can use as a reference. This way, you’ll have a clear example of how to make your code deployment-ready.
Q10: I have a question regarding the output for GA3, Question 6. The API gives me an output in JSON format, but the portal doesn’t accept it, marking it as an incorrect answer. What should I do?
A10: Yes, that’s expected and completely fine. The API’s JSON output is correct for an API response. The portal likely expects a plain text answer, not a JSON string. So, you don’t have to modify your API to return a plain answer; the API’s response is valid for its purpose.
Q11: So we don’t have to provide a plain answer for the portal?
A11: Correct, you don’t have to.
Q12: Can you also include a question that involves file upload, where the code is passed for the file?
A12: Yes, I can do that. For larger files, it’s generally better to store them alongside your code or in blob storage and then reference them. For smaller files, passing them directly with the request can work.
Q13: Could you include in the Thursday session a question that requires uploading a file?
A13: Yes, I will definitely make sure to add a question that demonstrates file uploading for the Thursday session.
Instructor’s final notes:
- I encourage everyone to try building their applications.
- I will set up a Discord/Discourse post for you to list specific problems you encounter while building. I’ll review these and address common issues in the Thursday session.
- On Thursday, I will demonstrate a fully working application, which you can use as a reference.
- Keep trying, and you’ll likely succeed. You can even showcase your own application on Thursday if you manage to get it working!
- Thank you for joining, and we’ll meet again on Thursday!
