Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI-based time selectors #8536

Open
linear bot opened this issue May 10, 2024 · 2 comments
Open

AI-based time selectors #8536

linear bot opened this issue May 10, 2024 · 2 comments

Comments

@linear
Copy link

linear bot commented May 10, 2024

i.e. convert "from last monday to the end of day yesterday" to a proper time stamp.

Copy link
Author

linear bot commented May 10, 2024

Copy link

greptile-apps bot commented May 10, 2024

To implement AI-based time selectors for converting phrases like 'from last monday to the end of day yesterday' into proper timestamps, you'll need to integrate natural language processing for date and time. This feature isn't directly supported in the current codebase, but you can achieve it by following these steps:

  1. Integrate a Date Parsing Library: Use libraries like chrono-node or date-fns to parse natural language into dates. These libraries can interpret phrases like 'last Monday' and 'end of day yesterday'.

  2. Extend Existing Date Utilities: In /frontend/src/pages/LogsPage/useGetLogs.ts, where dates are handled for log fetching, integrate the natural language date parsing. This will allow you to convert user input directly into the timestamp parameters required for fetching logs.

  3. Create a Natural Language Input Component: Develop a new React component that allows users to input date ranges in natural language. This component should use the date parsing library to convert input into a structured date range.

  4. Update Date Selection UI: Integrate the new natural language input component into existing UIs where date selection is required. This could be in the logs page, analytics dashboards, or anywhere date filters are used.

  5. Test Thoroughly: Ensure to add tests for various natural language phrases to confirm that the date parsing works as expected across different scenarios.

References

/frontend/src/pages/Home/utils/HomeCharts.tsx
/frontend/src/pages/Player/RightPlayerPanel/components/ErrorDetails/ErrorDetails.tsx
/frontend/src/pages/Player/RightPlayerPanel/components/SessionInsights/SessionInsights.tsx
/frontend/src/pages/Player/PlayerHook/utils/index.tsx
/frontend/src/pages/Player/Toolbar/DevToolsWindowV2/NetworkPage/NetworkPage.tsx
/frontend/src/pages/Player/MetadataBox/RelatedResourceButtons.tsx
/frontend/src/pages/Player/PlayerCommentCanvas/PlayerSessionComment/PlayerSessionComment.tsx
/frontend/src/pages/Player/PlayerHook/PlayerState.ts
/frontend/src/pages/Player/PlayerHook/PlayerHook.tsx
/frontend/src/pages/LogsPage/useGetLogs.ts

Ask Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants