FastAPI & Gradio Versioning: 'FieldInfo' object has no attribute 'in_'

I’ve had a gradio interfaces running smoothly for a bit. Today I tried launching it and got this error:

fastapi/dependencies/utils.py:462, in add_param_to_fields(field, dependant)
460 def add_param_to_fields(*, field: ModelField, dependant: Dependant) β†’ None:
461 field_info = cast(params.Param, field.field_info)
β†’ 462 if field_info.in_ == params.ParamTypes.path:
463 dependant.path_params.append(field)
464 elif field_info.in_ == params.ParamTypes.query:

Does anyone have any suggestions for versioning that may fix this? I’ve tried many, many combinations.

AttributeError: β€˜FieldInfo’ object has no attribute 'in_

2 Likes

Resolved, thanks for patch

Could you please let us know how you resolved this?

I did not change anything, I just ran it the next day and it launched. These were my installations:

%pip install fastapi --upgrade
%pip install pydantic --upgrade
%pip install gradio --use-deprecated=legacy-resolver

If you have pydantic version 2.0 or above you must have gradio version 3.36.0 or above

I was using 3.36.1 originally and getting this same error. It seemed like it was an issue under the hood, but I could be wrong. I hope everyone else having this issue figures it out :smiley: