3 ms·
So I gave it this prompt: > I need a typescript function which takes in an object with an id string property and a string message property, and also takes an a
by mistercow 3y ago
So I gave it this prompt:
> 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
The response I got was close, but it assumed that each search string would match only one message, so it returned Record<string, string>. I fed this to GPT-3.5 and it answered 10x faster with the correct return type.
This is a slightly tricky example, because it requires the model to infer that multiple message matches are possible. But I think that it’s interesting that ChatGPT nailed it despite not using any chain of thought.
- 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.