In several places in the instructions for example 18 it says to “Replace the content with the code below” (with “the content” referring to the contents of the example 18 Python file). That’s incorrect. If you do that you will end up with a useless piece of code that does nothing. What the instructions should say is “Replace the first part of the content up through the definition of llm with the content below.” That way the rest of the file, which doesn’t change and is necessary for the code to work, will be maintained.
Thank you very much for taking the time to go through the PiCar-X Example 18 (Connecting to Online LLMs) tutorial and for pointing out this issue — we’re sorry for the confusion it caused.
You are correct: in the Example 18 Python file, only the first part (up through the definition of llm) needs to be replaced with the code for the LLM provider you choose. The rest of the file (the conversation loop, voice input/output, etc.) stays unchanged and is required for the code to work. Replacing the entire file as the current wording suggests would indeed leave you with a script that does nothing. Your suggested wording — “Replace the first part of the content up through the definition of llm with the content below” — is more accurate.
We have forwarded your feedback to our documentation team to verify and correct the Example 18 page:
Until the page is updated, you can proceed exactly as you proposed: replace only the beginning of the file up through the llm definition with the code given in the tutorial, and keep the rest of the original code. The example should then run correctly.
Thank you again for your careful feedback — it really helps us improve our documentation. If you run into any further issues after making this change, or spot any other inaccurate instructions, please feel free to let us know.