summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/tones/ToneSelectorClient.tsx14
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>
);