You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
preprompt:'only output json. Do not output anything that is not json. Do not use markdown format. Must begin with {.'
But llama is not smart enough to output json form. It always begin with Here is the JSON answer or begin with ```(markdown format) for give me unvalid json string.
It seems preprompt is not enough to force json format. Could you provide an easy way to output just json. Or maybe the method is in tools.
The text was updated successfully, but these errors were encountered:
The prompt depends on the model you are using, different models can return different results for the same prompt. You can find some good general information about prompt engineering here: https://www.promptingguide.ai/introduction/tips.
As for returning json, you have to state that the output should be returned as "valid JSON" and that no additional text other than json must be included. Also you need to tell what format the returned json should have. Following works with Llama:
List 5 funny jokes. Format the output as valid JSON array, each element of the array should contain the joke type in property "type" and the joke in property "joke". The output must not contain any other text than the JSON.
Using the format in the prompt as example:
List 5 funny jokes. Format the output as valid JSON array. The output must not contain any other text than the JSON. Example of the returned format: "[{"type": "sarcasm", "joke":"some sarcastic joke"}]"
current I use
preprompt:'only output json. Do not output anything that is not json. Do not use markdown format. Must begin with {.'
But llama is not smart enough to output json form. It always begin with Here is the JSON answer or begin with ```(markdown format) for give me unvalid json string.
It seems preprompt is not enough to force json format. Could you provide an easy way to output just json. Or maybe the method is in tools.
The text was updated successfully, but these errors were encountered: