关于@sys-time时间识别不一致问题的技术问询
Hey Bruno,
Thanks for flagging this inconsistency with @sys-time in your Brazilian Portuguese workspace—this does look like a quirky edge case in the entity's parsing logic. Let’s break down what might be going on here:
Your Test Recap
First, let’s confirm the behavior you observed:
- Successfully recognized as
@sys-time:9h,09h08:30,08:30:0009:00:00h
- Not recognized as
@sys-time:9,09(treated as plain numbers)08:30h
Why This Might Be Happening
The
08:30hGap:
It seems like the parser handles single-hour suffixes (09h) fine, but struggles when thehis appended directly to a time with minutes. My guess is that the Brazilian Portuguese locale’s time parsing rules are set to expect either a time without a suffix (like08:30) or an hour-only value withh(like09h), but haven’t been updated to account for[hour]:[minute]hformats. This feels like an oversight that should be fixed.Pure Numbers as Times:
When you input just9or09in a slot expecting@sys-time, the system plays it safe and treats them as numeric values instead of times. Without an explicit marker likehor a phrase like "às 9 horas", the parser can’t be sure you mean "9 o’clock" rather than the number itself. This is a common design choice to prevent false positives, but it’s not ideal if your use case relies on numeric-only time inputs.
What You Can Do Next
- For
08:30h: Definitely reach out to the platform’s support team with all your test cases. This looks like a bug specific to the Brazilian Portuguese locale, and providing clear examples will help them prioritize fixing it. - For pure numeric inputs: If you need these to be recognized as times, try adding training phrases like "às 9" or "9 horas" mapped to your
@sys-timeslot. You could also add a small post-processing step in your bot logic—if a numeric value lands in the time slot, automatically convert it to a time entity (e.g.,9→9h).
Hope this helps make sense of the behavior, and good luck getting this resolved!
内容的提问来源于stack exchange,提问作者Bruno Braga

