mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-06 01:06:28 +08:00
add atc styled response to readbacks
This commit is contained in:
@@ -75,5 +75,8 @@ bun run preview
|
||||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
||||
|
||||
|
||||
# TTS Config
|
||||
# Piper TTS local
|
||||
if you want to use local tts, install and run pip install "piper-tts[http]" on port 5001, then set USE_PIPER=true in .env
|
||||
|
||||
# Whisper Tiny local
|
||||
if you want to use local whisper tiny implement it #TODO
|
||||
|
||||
@@ -27,6 +27,7 @@ interface PTTResponse {
|
||||
accuracy: number; // Text similarity
|
||||
keywordMatch: number; // Keyword matching
|
||||
recommendation: 'excellent' | 'good' | 'retry' | 'listen_again';
|
||||
atcResponse?: string; // Antwort des ATC (vom LLM generiert)
|
||||
feedback: string;
|
||||
mistakes?: string[];
|
||||
};
|
||||
@@ -129,11 +130,13 @@ Evaluate the readback and provide:
|
||||
1. Brief feedback (max 2 sentences)
|
||||
2. Specific mistakes if any
|
||||
3. Overall assessment
|
||||
4. A short ATC-style response to the pilot's readback (if appropriate)
|
||||
|
||||
Be constructive and educational. Focus on aviation safety and standard phraseology.
|
||||
|
||||
Response format:
|
||||
FEEDBACK: [your feedback]
|
||||
ATC_RESPONSE: [your response via ATC phraseology to the pilot]
|
||||
MISTAKES: [list mistakes or "None"]
|
||||
ASSESSMENT: [excellent/good/needs_improvement/unacceptable]`;
|
||||
|
||||
@@ -141,12 +144,13 @@ ASSESSMENT: [excellent/good/needs_improvement/unacceptable]`;
|
||||
const completion = await openai.chat.completions.create({
|
||||
model: LLM_MODEL,
|
||||
messages: [{ role: "user", content: prompt }],
|
||||
max_tokens: 300,
|
||||
temperature: 0.3
|
||||
});
|
||||
|
||||
const response = completion.choices[0]?.message?.content || "";
|
||||
console.log("LLM Evaluation Response:", response);
|
||||
|
||||
const feedback = response.match(/FEEDBACK: (.+?)(?=MISTAKES:|$)/)?.[1]?.trim() || "Good attempt.";
|
||||
const atcResponse = response.match(/ATC_RESPONSE: (.+?)(?=MISTAKES:|$)/)?.[1]?.trim() || "Noted.";
|
||||
const mistakes = response.match(/MISTAKES: (.+?)(?=ASSESSMENT:|$)/)?.[1]?.trim();
|
||||
const assessment = response.match(/ASSESSMENT: (.+)/)?.[1]?.trim() || "good";
|
||||
|
||||
@@ -170,6 +174,7 @@ ASSESSMENT: [excellent/good/needs_improvement/unacceptable]`;
|
||||
accuracy,
|
||||
keywordMatch,
|
||||
recommendation,
|
||||
atcResponse,
|
||||
feedback,
|
||||
mistakes: mistakes && mistakes !== "None" ? [mistakes] : undefined,
|
||||
playAgain
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0ed0f4170d058d7160aab0b3bb4ef21bb1f16dc48a64ddbf8d082db080a14154
|
||||
size 598
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:765af0058f555524aa0be4e48c849b301d5f8c7cd7674f12bf9ffdd9d76afb68
|
||||
size 92640
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b385a79c504d5ca4faf42a17510a2d19fbcfe3f398330143c5a83e43dca59ee6
|
||||
size 533
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:111d77baef73c93f584ecfa6b7bf7c08d7d2c71de9a58d09b59cda155e38da6b
|
||||
size 48960
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8bf7514d34d4d5f2ea7c1e1b50026b9d287296be384587cc0dff45685916bdb6
|
||||
size 533
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:32c45f9ff6a054ffbdcdb6348f418c75d96abdeb3f671a44678bafd696405233
|
||||
size 49920
|
||||
Reference in New Issue
Block a user