-
Notifications
You must be signed in to change notification settings - Fork 320
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 command bar #8593
Comments
To implement the AI-based command bar:
// utils.ts
export function parseNaturalLanguageQuery(query: string): string {
if (query.includes('first time users')) {
return JSON.stringify({ isAnd: true, rules: [['user_first_time', 'is', true]] });
}
// Add more parsing rules as needed
return '';
}
// CommandBar.tsx
import { parseNaturalLanguageQuery } from './utils';
const handleSearch = (query: string) => {
const parsedQuery = parseNaturalLanguageQuery(query);
if (parsedQuery) {
setQuery(parsedQuery);
}
};
// Use handleSearch function where the search is triggered
// HighlightSessions.tsx
useEffect(() => {
if (called) {
setLoadingState(AppLoadingState.LOADED);
}
}, [called, setLoadingState]);
const query = parseNaturalLanguageQuery('Show me all the sessions for first time users');
setQuery(query); This will enable the command bar to interpret and execute natural language queries. References/frontend/src/components/CommandBar/CommandBar.tsx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
None yet
0 participants
Allow users to ask a command bar to search for something and convert the ask to a query and link
"Show me all the sessions for first time users"
The text was updated successfully, but these errors were encountered: