Replies: 1 comment
-
disclaimerI think it depends greatly on the domain you are working. I am not sure about my answer either, I did not test this thoroughly, so everything below is both intuition and experience guided. invalid
|
Beta Was this translation helpful? Give feedback.
-
Context: Prompt Eng. / Design.
In prompts with structured output, what recommendations/techniques are out there to handle cases where a correct output cannot be provided because the input is wrong and/or a valid answer cannot be provided?
Example:
Input has correct values, but they don't make sense. (e.g. what the numeric result of 3 + K ? )
Therefore an output that correctly considers the Input is not possible.
The output is processed by Pydantic.
I can think on one:
In the prompt, specify that if any kind of error is found, the answer can be None. Being None a value that would not occur otherwise.
What approaches have you seen or used?
Note:
Union[str,None] = None
is the same asOptional[str] = None
Beta Was this translation helpful? Give feedback.
All reactions