How to pass data to FoundationModels with a stable identifier

For example:

I have a list of to-dos, each with a unique id (a GUID). I want to feed them to the LLM model and have the model rewrite the items so they start with an action verb.

I'd like to get them back and identify which rewritten item corresponds to which original item. I obviously can't compare the text, as it has changed.

I've tried passing the original GUIDs in with each to-do, but the extra GUID characters pollutes the input and confuses the model.

I've tried numbering them in order and adding an originalSortOrder field to my generable type, but it doesn't work reliably.

Any suggestions?

I could do them one at a time, but I also have a use case where I'm asking for them to be organized in sections, and while I've instructed the model not to rename anything, it still happens. It's just all very nondeterministic.

Answered by Sly66 in 846507022

Try formatting your input text in specific way like for example json or csv and instruct the model to only work on one column. Provide 1 or 2 example as part of the prompt. Experiment with #playground. You can test this with any smaller model on ollama to get the hang of it.

hi! could you try invoking the model for each TODO one at a time?

it may be a bit more difficult to get thematic consistency between items, but you'll definitely get that one-to-one correspondence between inputs and outputs.

Accepted Answer

Try formatting your input text in specific way like for example json or csv and instruct the model to only work on one column. Provide 1 or 2 example as part of the prompt. Experiment with #playground. You can test this with any smaller model on ollama to get the hang of it.

How to pass data to FoundationModels with a stable identifier
 
 
Q