You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
str_questions = [x.replace(' ', '_').replace('?', '') for x in str_questions]
fields = {q: (Optional[dict], Field(default=None, description=f"Provide an answer to this questions based on the context. Must be a dictionary of the form {Answer.model_json_schema()}")) for q in str_questions}
model = create_model("Response", **fields) # type: ignore
return model
except KeyError as e:
raise KeyError("Questions must contain a column named 'questions'") from e