Biggest use case we've had for stop sequences is to prevent the model from generating more text after finishing some structured data, like XML.
It would be nice to have an option appendStopSequence to add it back on in the .text result, as that field is currently read-only.
Use Case
Sometimes the model will do something like
<root>
... content
</root>
I've generated this XML for you!
stopSequences: ['</root'>] is a good example. We know the model will always output this. We can't reliably predict what it will say after the XML, so is the best option.
However, it means the output we get always looks like this:
<root>
... content
For now, we just append the text back on, but it would be really nice to have this built in!
Feature Description
Biggest use case we've had for stop sequences is to prevent the model from generating more text after finishing some structured data, like XML.
It would be nice to have an option
appendStopSequence
to add it back on in the .text result, as that field is currently read-only.Use Case
Sometimes the model will do something like
stopSequences: ['</root'>]
is a good example. We know the model will always output this. We can't reliably predict what it will say after the XML, so is the best option.However, it means the output we get always looks like this:
For now, we just append the text back on, but it would be really nice to have this built in!
Additional context
No response