Forum in maintenance, we will back soon 🙂
I have complications - Need you assistance ASAP
I have started with the lesson Build Your 1st API. I have complications with the Build With AI lesson.
1. ChatGPT codes generated are not the same as your video tutorial sample/s (attached screenshot: file 3.5 ChatGpt generate code (1)) + file 3.5 ChatGpt copy code (1)(2)(3)(4)
2. Once I copied the code from ChatGPT, I do not get the same end results as your tutorial. Visual Studio screenshot attachment (file build with AI lesson)
Please advise. Thank you.
That's normal, ChatGPT will never generate the exact same output every time. This is how AI Lanaguge models work.
you can for example continue chatting with it, and tell it that the code didn't work, and giving this is or that error. and it will try to fix it for you.
anyway, here is the endpoint code:
@app.route('/<query>', methods=['GET']) def autocomplete(query): url = f"https://suggestqueries.google.com/complete/search?client=firefox&q={query}" response = requests.get(url) suggestions = response.json()[1] return jsonify(suggestions)
@abhinav-singh Hello friend, did you install openAI Module? If you didn't, copy and paste the below line into your terminal and run it:
pip install openai
@admin Hello Hassan. Appreciate your fast response. I will try your advice, asking chatGPT to rectify my codes for Python. I managed to do no code and I was successful with Xano. Can I build all future API models with Xano or is it advisable to get the know-how in Python?
@husein-aboul-hasan Hi. I appreciate you taking the time and interest in replying to my post (predicament). I will try to apply your advice. Thank you, friend.
@starnasrat theoretically, you can build complex APIs with Xano, yes. But requires some testing and a learning curve.
anyway, if you have an API idea, I will try my best to help
@admin Hi Hassan. Thank you for getting back to me so quickly. I have not got an API idea. I've decided to go through all 56 steps and learn before I build my 1st API. I highly appreciate your offer of assistance. At this moment I have a pressing issue which I would need your advice. I'm on lesson Exercise 2: String and List Operations = Task 2: Create two lists: list1
with elements 1, 2, 3
and list2
with elements 4, 5, 6
. Concatenate these lists and print the result. I've viewed your conclusion and I can't get the correct output. What am I doing wrong? I've attached a screenshot for your reference. Thank you in advance.
@starnasrat your line 17 isn't valid. Were you attempting to print the variable string instead?
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
@ssadvisor Hello Berney,
I am trying to print the list of variables in lines 19 + 20. What am I doing wrong?
@starnasrat in line 17, there is an error, are you trying to print? use print instead of string
string ("python" + rock")
@starnasrat you need to modify line 17; perhaps like so
print(string)
this will give you output based on line 16 of
pythonrocks
If you want a space between "python" and "rocks" you'll need to modify line 16 like so
string = "python " + "rocks"
or like so
string = "python" + " rocks"
etc, there are more ways to do this.
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
@ssadvisor Thank you, Earnie