Update the prompt and add useful onscreen messages
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Late Night Defender 2025-05-15 16:50:55 +07:00
parent cf25c9fc35
commit c488a79f0a

View file

@ -44,7 +44,7 @@ function App() {
body: JSON.stringify({ body: JSON.stringify({
model: 'gpt-4o', model: 'gpt-4o',
messages: [ messages: [
{ role: 'system', content: 'You are a helpful English tutor speaking with a learner.' }, { role: 'system', content: 'You are an English tutor that is kind, fun to be around and can teach English language lessons through adventurous stories very well. You are assigned to talk with a primary school EFL student about a movie they watched yesterday.' },
{ role: 'user', content: text } { role: 'user', content: text }
] ]
}) })
@ -87,17 +87,25 @@ function App() {
return ( return (
<div className="min-h-screen bg-gray-100 flex flex-col justify-end p-4"> <div className="min-h-screen bg-gray-100 flex flex-col justify-end p-4">
<div className="mb-auto text-center text-xl font-bold p-4">AI English Tutor</div> <h1>AI English Tutor</h1>
<div className="mb-2 bg-white rounded-2xl p-4 shadow text-sm"> <div>เวบไซตเปนการทำ Proof of concept ของการใช AI ในการสอนภาษาองกฤษ โดยเนนไปทการจำลองการสอสารดวยเสยง</div>
<div><strong>You:</strong> {transcript}</div> <div>ครกษะเสรมสรางจนตนาการ สน ตลก ใหอค สามารถสอนเนอหาผานเรองราวการผจญภยได เช คำศพท หรอขอค คำถามปลายเป เปนต</div>
<div className="mt-2"><strong>Tutor:</strong> {aiReply}</div> <div>AI ไดบบทใหดคยกบนกเรยนในเรองภาพยนตรไดบชมไปเมอวาน</div>
</div>
<h3>ใชงาน</h3>
<div>กดป Speak านลาง อนญาตใหใชไมโครโฟน ดคยก AI เปนภาษาองกฤษ แลวกด Stop</div>
<div>เรมจากการทกทายก AI แลวเลาใหงวาเมอวานรบชมภาพยนตรเรองใดมา AI จะถามคณเกยวกบภาพยนตรเรองน</div>
<button <button
onClick={isRecording ? stopRecording : startRecording} onClick={isRecording ? stopRecording : startRecording}
className={`mt-4 p-3 rounded-xl font-semibold text-white ${isRecording ? 'bg-red-500' : 'bg-blue-500'}`} className={`mt-4 p-3 rounded-xl font-semibold text-white ${isRecording ? 'bg-red-500' : 'bg-blue-500'}`}
> >
{isRecording ? 'Stop' : 'Speak'} {isRecording ? 'Stop' : 'Speak'}
</button> </button>
<div className="mb-2 bg-white rounded-2xl p-4 shadow text-sm">
<div><strong>You:</strong> {transcript}</div>
<div className="mt-2"><strong>Tutor:</strong> {aiReply}</div>
</div>
</div> </div>
); );
} }