instructor icon indicating copy to clipboard operation
instructor copied to clipboard

Pydantic includes URLs with validation errors which aren't useful for the LLM

Open mwildehahn opened this issue 11 months ago • 2 comments

Is your feature request related to a problem? Please describe.

Pydantic includes a URL by default to look up more information on the error which isn't useful for the LLM and also takes up token space.

1 validation error for Boop
name
  Value error, 'bla' is not a valid boop. [type=value_error, input_value='bla', input_type=str]
    For further information visit https://errors.pydantic.dev/2.6/v/value_error

Describe the solution you'd like It'd be nice to have more control over what happens here. Pydantic let's you dump the errors if you catch the exception via errors( and then specify include_url. It feels like the default should be to not include that.

Describe alternatives you've considered Just giving more control over the reask flow could let people solve this themselves.

mwildehahn avatar Mar 18 '24 07:03 mwildehahn

Totally agree.

Throwing data+garbage to the Model is not very smart/economical.

I tried to open the discussion here regarding that, but it seems like only Issues are attended (or maybe I don't know how to use Github :o)

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

happy to take a PR

jxnl avatar Mar 23 '24 00:03 jxnl