Yes the second request body is correct here! The values for the parameterInputs field use the ParameterValue union type (see API reference here), which requires specifying if the parameter is a string or objectSet type.
You can find an example for passing an objectSet variable in the docs here, copying over for reference:
Request body with objectSet variable
{"userInput":{"text":"What is the status of my order?"},"parameterInputs":{"currentCustomerOrders":{"type":"objectSet","ontology":"example-ontology","objectSet":{"type":"filter","objectSet":{"type":"base","objectType":"customerOrder"},"where":{"type":"eq","field":"customerId","value":"123abc"}}}}}
Request body with string variable
{"userInput":{"text":"What is the status of my order?"},"parameterInputs":{"customerId":{"type":"string","value":"123abc"}}