Closed thnguyendn closed 7 months ago
I think this article on validating LLM outputs using Guardrails AI might be helpful.
Hi, thanks for filing this ticket, it's on our roadmap to add forced json outputs.
thank you for all of your replies @aanaseer @elaineg. Looking forward to test it later...
Hello,
I do not really know if it is a right place to ask my question, but did not find any appropriate ones.
I would like to know if when we ask Cohere to generate text completion (or chat) through API, do we have a solution to force Cohere to generate only Json validated format without any introduction text at the beginning ?
I have used a prompt-engineering approach to require a Json validated-format in my prompt by adding either : "your output is only of json valid structure [{{'key1': value1, 'keys2': [values], 'key3': value3}}]" Or "your output is only of json valid structure [{{'key1': value1, 'keys2': [values], 'key3': value3}}], without any introduction text ..."
As result, Cohere always add an introduction text at the beginning as follows : "Here is the JSON format generated from the information provided: '''json [useful_information_situated_here] ''' "
What I really want to receive as output is only the Json valid format inside of parenthesis (i.e. useful_information_situated_here)