Replies: 2 comments
-
In case it helps someone/somehow ... [not really an answer I can use] To modify the prompt that begins with "Recall the function correctly" as a user of the library without modifying the source code, you can utilize the library's functionality for customization, if available. In this specific case, since the source code is not to be altered directly, you can look for any configuration options or settings within the library that allow for prompt customization.
Without specific details from the search results provided, it is recommended to refer to the library's documentation, community forums, or reach out to the library maintainers for guidance on how to achieve prompt customization without modifying the source code directly. Citations: |
Beta Was this translation helpful? Give feedback.
-
Documentation |
Beta Was this translation helpful? Give feedback.
-
Ability to control/edit the additional prompt that is generated when using max_retries and the initial response fails to pass the pydantic validation.
In this example:
The initial response from LLM
which is
fails the pydantic validation
And there is a retry (if max_retries > 0 ).
In that retry, the initial request is sent again, joining in the received response
With this additional "prompt"
Note: The source code shows
errors and exceptions
but that is verbatim what I got from the openai logs. But that is irrelevant in this question.Questions:
Q1: Is there an easy way to edit/modify the 'retry prompt' ?
I have seen that you have modified it a few times in the source code.
Q2: This part 'For further information visit https://errors.pydantic.dev/2.6/v/value_error"' is rather useless (I think) and removing it would reduce the number of tokens, thus reducing the amount of useless input the LLM has to go through.
Apologies if it is responded somewhere. I searched in many places but couldn't find anything around it.
Note: instructor is an amazing library. It's simply and astonishingly beautiful because it is almost transparent.
Beta Was this translation helpful? Give feedback.
All reactions