diff --git a/alembic/versions/482cd6517ce4_add_default_user.py b/alembic/versions/482cd6517ce4_add_default_user.py index 92429e1e4..d85f0f146 100644 --- a/alembic/versions/482cd6517ce4_add_default_user.py +++ b/alembic/versions/482cd6517ce4_add_default_user.py @@ -12,6 +12,8 @@ from sqlalchemy.util import await_only from cognee.modules.users.methods import create_default_user, delete_user +from fastapi_users.exceptions import UserAlreadyExists + # revision identifiers, used by Alembic. revision: str = "482cd6517ce4" @@ -21,7 +23,10 @@ depends_on: Union[str, Sequence[str], None] = "8057ae7329c2" def upgrade() -> None: - await_only(create_default_user()) + try: + await_only(create_default_user()) + except UserAlreadyExists: + pass # It's fine if the default user already exists def downgrade() -> None: diff --git a/cognee-frontend/src/modules/ingestion/DatasetsView/DatasetsView.tsx b/cognee-frontend/src/modules/ingestion/DatasetsView/DatasetsView.tsx index 13965230b..577a27d63 100644 --- a/cognee-frontend/src/modules/ingestion/DatasetsView/DatasetsView.tsx +++ b/cognee-frontend/src/modules/ingestion/DatasetsView/DatasetsView.tsx @@ -95,10 +95,10 @@ export default function DatasetsView({ ))} - + {dataset?.name} - + diff --git a/cognee-frontend/src/ui/Partials/SearchView/SearchView.tsx b/cognee-frontend/src/ui/Partials/SearchView/SearchView.tsx index 664a46fad..bea5e1277 100644 --- a/cognee-frontend/src/ui/Partials/SearchView/SearchView.tsx +++ b/cognee-frontend/src/ui/Partials/SearchView/SearchView.tsx @@ -3,7 +3,7 @@ import { v4 } from 'uuid'; import classNames from 'classnames'; import { useCallback, useEffect, useState } from 'react'; -import { CTAButton, Stack, Text, DropdownSelect, TextArea, useBoolean } from 'ohmy-ui'; +import { CTAButton, Stack, Text, DropdownSelect, TextArea, useBoolean, Input } from 'ohmy-ui'; import { fetch } from '@/utils'; import styles from './SearchView.module.css'; import getHistory from '@/modules/chat/getHistory'; @@ -33,8 +33,15 @@ export default function SearchView() { }, { value: 'RAG_COMPLETION', label: 'Completion using RAG', + }, { + value: 'GRAPH_COMPLETION_COT', + label: 'Cognee\'s Chain of Thought search', + }, { + value: 'GRAPH_COMPLETION_CONTEXT_EXTENSION', + label: 'Cognee\'s Multi-Hop search', }]; const [searchType, setSearchType] = useState(searchOptions[0]); + const [rangeValue, setRangeValue] = useState(10); const scrollToBottom = useCallback(() => { setTimeout(() => { @@ -90,6 +97,7 @@ export default function SearchView() { body: JSON.stringify({ query: inputValue.trim(), searchType: searchTypeValue, + topK: rangeValue, }), }) .then((response) => response.json()) @@ -108,7 +116,7 @@ export default function SearchView() { .catch(() => { setInputValue(inputValue); }); - }, [inputValue, scrollToBottom, searchType.value]); + }, [inputValue, rangeValue, scrollToBottom, searchType.value]); const { value: isInputExpanded, @@ -122,6 +130,10 @@ export default function SearchView() { } }; + const handleRangeValueChange = (event: React.ChangeEvent) => { + setRangeValue(parseInt(event.target.value)); + }; + return ( @@ -146,9 +158,15 @@ export default function SearchView() {
- +