I faced something like this. Here is a suggestion:
- Retrieve the Schema using the get_fn_schema_from_fn_name method to get the schema for the function you plan to call. This schema is a Pydantic model that defines the structure and types of data expected by the function.
- Share the Schema with the User : The agent can ask the user to fill in / confirm schema
- Validate User Data: Before calling the function, validate the user's data against the schema. Pydantic models can be used to parse and validate data structures, ensuring that the data conforms to the expected structure.