-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve code organization and fix voice input bug
This commit refactors the frontend chat components to improve code organization and readability. It also fixes a bug in the voice input functionality where the transcript was not being properly cleared when stopping voice input.
- Loading branch information
Showing
10 changed files
with
10,366 additions
and
8,102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"typescript.enablePromptUseWorkspaceTsdk": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
import { ModelTags } from '@/graphql/type'; | ||
import client from '@/utils/client'; | ||
import { gql } from '@apollo/client'; | ||
|
||
export function getSelectedModel(): string { | ||
if (typeof window !== 'undefined') { | ||
client | ||
.query<ModelTags>({ | ||
query: gql` | ||
query { | ||
modelTags { | ||
tags | ||
} | ||
} | ||
`, | ||
}) | ||
.then((result) => { | ||
console.log(result.data.tags); | ||
}); | ||
const storedModel = localStorage.getItem('selectedModel'); | ||
return storedModel || 'gemma:2b'; | ||
} else { | ||
// Default model | ||
return 'gemma:2b'; | ||
return 'default'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,5 +26,8 @@ | |
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": ">=18" | ||
}, | ||
"dependencies": { | ||
"typescript": "5.6.2" | ||
} | ||
} |
Oops, something went wrong.