diff options
author | polwex <polwex@sortug.com> | 2025-08-17 02:20:42 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-08-17 02:20:42 +0700 |
commit | 9be51e192fca8901d47328875d9e0c690d4b2b99 (patch) | |
tree | 926151e075c539019c5eb65e2140678acb383c5f /src/components/tones/ToneSelectorClient.tsx | |
parent | c505750ab36f8164256a91830fc83a807a9d6984 (diff) |
Diffstat (limited to 'src/components/tones/ToneSelectorClient.tsx')
-rw-r--r-- | src/components/tones/ToneSelectorClient.tsx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/tones/ToneSelectorClient.tsx b/src/components/tones/ToneSelectorClient.tsx index 438fc8a..3335015 100644 --- a/src/components/tones/ToneSelectorClient.tsx +++ b/src/components/tones/ToneSelectorClient.tsx @@ -29,6 +29,7 @@ import { Skeleton } from "@/components/ui/skeleton"; // For loading state import { MutationOrder, PhoneticData, ToneQuery } from "@/lib/types/phonetics"; import { ProsodySyllable } from "@/lib/types/cards"; import { ArrowLeft, ArrowRight, Volume2, FlipHorizontal2 } from "lucide-react"; +import { LLM } from "@/lib/services/llm"; function getColorByTone(tone: string): string { if (tone === "mid") return "blue"; @@ -96,6 +97,18 @@ const ProminentToneDisplay = ({ word }: { word: any }) => { return () => window.removeEventListener("keydown", onKeyDown); }, [playAudio]); + async function testLM() { + const lm = new LLM({ + openai: { + url: "http://localhost:1234/v1", + apiKey: "", + model: "openai/gpt-oss-20b", + allowBrowser: true, + }, + }); + const res = await lm.chat("hey man something great happened to me today"); + console.log("llm res", res); + } return ( <div className="flex flex-col items-center mb-4"> <h1 className="text-6xl font-bold mb-2"> @@ -123,6 +136,7 @@ const ProminentToneDisplay = ({ word }: { word: any }) => { <audio ref={audioRef} /> <p className="ipa text-xl text-gray-700 mt-2">{word.frequency}</p> <p className="ipa text-xl text-gray-700 mt-2">{word.word_id}</p> + <button onClick={testLM}>Test</button> </div> </div> ); |