How to train Codex to use SCPI commands (custom APIs )

Hi all,

We have a manual which contains the commands and other parameters(such as example, command group), these commands are used to communicate with the Tektronix oscilloscope.

The URL of our manual is

Example of one such command is -

*RST: Resets the instrument to factory default settings.

My end goal is to generate python code for the tasks.

Sample Prompt:
“”“Write a python program to import Pyvisa and reset the scope .”""

Expected python code:

import visa

rm = visa.ResourceManager()
scope = rm.open_resource(“TCPIP::”)

For simple commands like *RST - plain text to python code generation works well but for many other commands like Horizontal settings or Recall (which take input parameters) - I am not able to generate python code using codex.

How do we train codex for all the commands - since some of the commands are not correctly generated?

Thank you