instructor icon indicating copy to clipboard operation
instructor copied to clipboard

Give ability to change retry prompt and model/provider

Open aiseei opened this issue 11 months ago • 2 comments

Is your feature request related to a problem? Please describe. For complex queries mistral-intruct/others on ollama dont work and multiple retries still dont give a parseble soln.

Describe the solution you'd like Allow n retries on the same model else give a Callaback where in i can swicth the model/provider. ie from mistral/ollama to gpt4/Azure and prompt if needed.

Describe alternatives you've considered None - other than custom

Additional context Add any other context or screenshots about the feature request here.

aiseei avatar Mar 21 '24 03:03 aiseei

do you have a proposal for what that looks like?

jxnl avatar Mar 21 '24 13:03 jxnl

Would this work? (no need to change Instructor)

try:
    call_model1()
except Exception:
    try:
        call_model2()
    except Exception:
        call_model3()
        

Allow n retries on the same model

This is already possible with max_retries

I am very interested in being able to edit the 'retry prompt' as mentioned here

Mr-Ruben avatar Mar 22 '24 15:03 Mr-Ruben

Hmm @Mr-Ruben I think that retries with multiple models should be handled by the user itself. The main philosophy of instructor is to provide a wrapper over the main client APIs so I think this isn't something we should support.

ivanleomk avatar Jun 13 '24 01:06 ivanleomk