Improve Error Message for Non-Object Parameters in `typia.llm.application`
Contents
The typia.llm.application method requires the top-level parameter to be an object. This means that even if a string is part of a union with an object, it is still not allowed.
{
"code": "typia.llm.application",
"message": "unsupported type detected\n\n- PickNotionServicegetDatabaseInfo.getDatabaseInfo: unknown\n - LLM application's function (\"getDatabaseInfo\")'s parameter must be an object type.",
"name": "Error"
}
Strictly speaking, this error message is not incorrect, but I wonder if the phrase "must be an object type" might be unclear for those who are not deeply familiar with TypeScript's type system. It may not be immediately obvious that this means "a union with an object is not allowed."
Would you be open to modifying this error message? Or would it be okay if I made the change myself?
Reference
@luke0408 's code.
- https://github.com/luke0408/connectors/blob/8a186df7260104ddb9082ea80c8c644e85865609/packages/notion/src/notion/NotionService.ts#L738-L799
Wait for your contribution.
@luke0408 how do you think?
Good! I'll fix it
Would a message like "${prefix}'s parameter must be an object type. Union types (e.g., string | object) are not supported." be sufficient?