upython_mqtt.py 747 B

12345678910111213141516
  1. from evaluator import *
  2. DESCRIPTION = "Test if a model can write upython code with an obscure module."
  3. TAGS = ['python', 'code']
  4. question = """
  5. Write a python program that I can use to run on my raspberry pi pico w zero that will check for mqtt messages. Don't block, and blink the LED on every loop iteration so I know it's polling. When it gets a message then set the LED solid for a second.
  6. """
  7. # crude testing because there isn't an actual pico w to run this on...
  8. TestUPythonMQTT = question >> LLMRun() >> (SubstringEvaluator("check_msg") & SubstringEvaluator("MQTTClient") & SubstringEvaluator("set_callback") & SubstringEvaluator('WLAN') & SubstringEvaluator("STA_IF"))
  9. if __name__ == "__main__":
  10. print(run_test(TestUPythonMQTT))