3 ms·
> I need a typescript function which takes in an object with an id string property and a string message property, and also takes an array of search strings, and
by starbugs 3y ago
> I need a typescript function which takes in an object with an id string property and a string message property, and also takes an array of search strings, and returns a mapping of search strings to matching message ids
Your prompt is wrong. You want a function that takes an array of id/message objects, not an object.
It's quite impressive that GPT is just able to correct for that. As a human, I would first ask what you actually mean, because your prompt appears to be unclear.
- deleted 3y ago[deleted]
- mistercow 3y agoActually it was meant to be an object mapping of ids to messages, but yes, I phrased it weirdly. Both LLMs understood that part, though.