instructor icon indicating copy to clipboard operation
instructor copied to clipboard

Expose the internal system prompts so they can be configured if the defaults aren't sufficient

Open skyler1537 opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. Internal system prompts are currently hard coded into the library. This is fine, but we should also expose these prompts as variables that the user can change if need be

Describe the solution you'd like

client = instructor.patch(OpenAI())
client.retry_prompt = "my custom retry prompt"

skyler1537 avatar Dec 06 '23 19:12 skyler1537

this is interesting cause right now patch only updates the create call, so the create call does not have self

to access the client.

could do some something like

client = instructor.patch(OpenAI(), config=...)

and having some additional stuff in the config?

jxnl avatar Dec 06 '23 20:12 jxnl

Another approach could be to supply a default Jinja2 template for the prompts, which could be forked and modified by the user.

indigoviolet avatar Jan 24 '24 08:01 indigoviolet

Hello, is a solution to this facilitated by the new 1.x approach to instantiating the client? Being able to customise system prompts would be especially helpful when integrating with, e.g., ollama.

alexclaydon avatar May 18 '24 05:05 alexclaydon

Been too busy with work on configuration just yet.

jxnl avatar May 20 '24 16:05 jxnl