This is a viewer only at the moment see the article on how this works.
To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk
This is a preview from the server running through my markdig pipeline
ब्लाजोर और स्थानीय एलएलएम्स के साथ निर्धारात्मक आवाज फॉर्म
Monday, 05 January 2026
एक दस आदेश
जिसमें हम एक आवाज बनाते हैं '-' से '-' के रूप में प्रणाली जो नहीं है कि '' AI राज्य को कुंजियाँ दे
यहाँ ध्वनि इंटरफेस के बारे में बात है
अधिकतर आवाज फॉर्म उस समय असफल होते हैं जब मॉडल एक तारीख को गलत सुनता है या यह तय करता है कि "helpfullyM SK1 skip ahead. आप कहते हैं "May SSK4th MSSK5 और एलएलएम बाहर निकालता है | " | May \ 2014" | और अगले क्षेत्र में आगे बढ़ता है इससे पहले कि आप इसे सुधार कर सकते हैं |. | या बुरी तरह से | МSK9 | यह आत्मविश्वास का भ्रम पैदा करता है और स्वतः | एमएसके10 | आपके फॉर्म को गलत डेटा के साथ प्रस्तुत करता है
जब आप एक LLM को अनुमति देते हैं "control" अपने फ़ॉर्म फ्लो को चलाने के लिए
यह hypothetical नहीं है मैकडोनाल्ड ' AI चलाता है - powered drive - के ordering अमेरिका के स्थानों पर 100+ यह नियमित रूप से बुनियादी संशोधनों को समझने में विफल रहा है।
लेकिन क्या अगर हम अपनी रोटी ले सकते हैं और इसे भी खा सकते है निर्णायक कोड हर चीज़ के लिए जो वास्तव में महत्वपूर्ण है
जो हम आज निर्माण कर रहे हैं, यह है-'-हम क्या बना रहे हैंः'---a "-Ten कमांडों का अनुपालन करते हुए-MSC4-Blazor सर्वर का उपयोग करने वाली आवाज फार्म सिस्टम। ,-स्थानीय भाषण के लिए हिस्पर;- से- तक;पाठ;, और क्षेत्र निष्कर्षण हेतु स्थानीय ओलामा।
दस आदेशों को लागू करना
यह परियोजना निम्नलिखित है एलएलएम का उपयोग करने के दस आदेशयदि आपने अभी तक यह नहीं पढ़ा है, तो LLM संभाव्य इंजन हैं।
ध्वनि फ़ॉर्मों के लिए प्रासंगिक कमांड हैं
- I. Don't let the LLM own state - राज्य मशीन ट्रैक प्रगति के रूप में बनाता है
- II. Don'LLM को side-effects के कारण नहीं छोड़ें - यह निष्कर्ष सिफारिश करता है
- III. कथानक से अलग कारणात्मकता - LLM बताता है जो उसने सुनी है
- IV. LLMs का प्रयोग करें जहाँ संभाव्यता स्वीकार्य है - उद्धरण | " | मई |12 |th | МSK3 | भाषण से अस्पष्ट है
आवाज फ़ॉर्म डिजाइन लक्ष्य
आदेशों के अलावा यह प्रणाली विशिष्ट सिद्धांतों का अनुसरण करती है
- भाषण हानिकारक इनपुट है क्षेत्रों को आबाद करने का एक तरीका
- यकीन पॉलिसी के driven है - कॉन्फ़िग में थ्रेसहोल्ड्स
- उपयोक्ता हमेशा अधिरोहित कर सकता है आवाज सुविधा है
- सब कुछ स्थानीय रूप से चलता है - Whisper और ओललामा
- असफलता शालीन है - जब आवाज असफल होता है तो टाइपिंग अभी भी काम करता है
यहाँ यह कैसे लगता है व्यवहार में
flowchart LR
A[User Speaks] --> B[Whisper STT]
B --> C[Raw Transcript]
C --> D[Ollama LLM]
D --> E[Extracted Value]
E --> F{Validation}
F -->|Pass| G{Policy Check}
F -->|Fail| H[Show Error]
G -->|High Confidence| I[Auto-Confirm]
G -->|Low Confidence| J[Ask User]
J --> K{User Confirms?}
K -->|Yes| L[State Machine: Next Field]
K -->|No| M[Retry Recording]
I --> L
H --> M
style D stroke:#f96,stroke-width:2px
style F stroke:#6f6,stroke-width:2px
style G stroke:#ff9,stroke-width:2px
क्या यह करता है
स्कोप के बारे में स्पष्ट करें
- कोई प्राकृतिक वार्तालाप नहीं यह एक चैटबोट नहीं है
- कोई अनुकूलन प्रश्न पूछना नहीं - फ़ॉर्म स्कीमा स्थिर है
- कोई "assistant" व्यक्तित्व LLM मूल्य निकालता है
- क्षेत्रों के बीच कोई संदर्भ नहीं प्रत्येक निष्कर्ष स्वतंत्र है
ये अवरोध विशेषताएँ हैं।
अगर आप एक वार्तालाप एजेंट चाहते हैं, तो Build a conversational agent
परियोजना संरचना
हम एक स्टैंडलोन Blazor सर्वर एप्लिकेशन बना रहे हैं
Mostlylucid.VoiceForm/
├── Config/
│ └── VoiceFormConfig.cs # Configuration binding
├── Models/
│ ├── FormSchema/ # Form definitions
│ ├── State/ # Session state
│ └── Extraction/ # LLM input/output
├── Services/
│ ├── Stt/ # Speech-to-text (Whisper)
│ ├── Extraction/ # Field extraction (Ollama)
│ ├── Validation/ # Type-based validators
│ ├── StateMachine/ # Form flow control
│ └── Orchestration/ # Coordinates everything
├── Components/
│ └── Pages/ # Blazor UI
└── wwwroot/js/
└── audio-recorder.js # Web Audio API capture
निर्भरता नियम सेवाएं केवल उनके नीचे के आक्षेपों पर निर्भर करती हैं
बुनियादी ढांचा तैयार करना
पहले, आप'Whisper और Ollama स्थानीय रूप से चलाने की जरूरत होगी devdeps-docker-compose.yml:
services:
whisper:
image: onerahmet/openai-whisper-asr-webservice:latest
container_name: whisper-stt
ports:
- "9000:9000"
environment:
- ASR_MODEL=base.en
- ASR_ENGINE=faster_whisper
volumes:
- whisper-models:/root/.cache/huggingface
restart: unless-stopped
ollama:
image: ollama/ollama:latest
container_name: ollama
ports:
- "11434:11434"
volumes:
- ollama-models:/root/.ollama
restart: unless-stopped
volumes:
whisper-models:
ollama-models:
स्पिनिंग करने के बाद Ollama के लिए एक मॉडल खींचें
docker exec -it ollama ollama pull llama3.2:3b
क्यों स्थानीय? परीक्षण सक्षमता + निर्णायकता | + | डेटा स्थानीयता \ . | आईसी एक ही कन्टेनरों को चलाती है |. | परीक्षण एक ही अंत बिन्दुओं पर आ जाती हैं |
नोट base.en विस्पर मॉडल अंग्रेजी के लिए तेजी से और सही है small.en या medium.en अधिक शुद्धता के लिए.
फार्म योजना: घोषणात्मक फार्म परिभाषाएं
प्रारूपों को JSON में परिभाषित किया जाता है
{
"id": "customer-intake",
"name": "Customer Intake Form",
"fields": [
{
"id": "fullName",
"label": "Full Name",
"type": "Text",
"prompt": "Please say your full name.",
"required": true
},
{
"id": "dateOfBirth",
"label": "Date of Birth",
"type": "Date",
"prompt": "What is your date of birth?",
"required": true,
"confirmationPolicy": {
"alwaysConfirm": true
}
},
{
"id": "email",
"label": "Email Address",
"type": "Email",
"prompt": "What is your email address?",
"required": true
},
{
"id": "phone",
"label": "Phone Number",
"type": "Phone",
"prompt": "What is your phone number?",
"required": false
},
{
"id": "notes",
"label": "Additional Notes",
"type": "Text",
"prompt": "Any additional notes?",
"required": false
}
]
}
C# मॉडल जो इस का प्रतिनिधित्व करते हैं
public record FormDefinition(
string Id,
string Name,
List<FieldDefinition> Fields);
public record FieldDefinition(
string Id,
string Label,
FieldType Type,
string Prompt,
bool Required = true,
ConfirmationPolicy? ConfirmationPolicy = null);
public enum FieldType
{
Text,
Date,
Email,
Phone,
Choice // Constrained vocabulary - especially important for voice
}
public record ConfirmationPolicy(
bool AlwaysConfirm = false,
double ConfidenceThreshold = 0.85);
क्योंकि स्कीमा घोषणात्मक है क्षेत्रों को जोड़ने के लिए कभी भी राज्य मशीन छूने की जरूरत नहीं है. JSON में एक नया क्षेत्र परिभाषा ड्रॉप करें और फार्म स्वचालित रूप से इसे उचित प्रवाह नियंत्रण के साथ शामिल करता है
राज्य मशीन: निर्धारित रूप प्रवाह
प्रतिरोध तंत्र जो हम इससे बच रहे हैं वह हैः मॉडल आउटपुट पर आधारित अग्रगामी रूप स्थिति
राज्य मशीन AI का उपयोग नहीं करता है यह शुद्ध सी सी एस सी 1 तर्क है जो स्पष्ट नियमों के आधार पर संक्रमण निर्धारित करता है
public class FormStateMachine : IFormStateMachine
{
private FormSession _session = null!;
private int _currentFieldIndex;
public FormSession StartSession(FormDefinition form)
{
_session = new FormSession
{
Id = Guid.NewGuid().ToString(),
Form = form,
Status = FormStatus.InProgress,
StartedAt = DateTime.UtcNow,
FieldStates = form.Fields.ToDictionary(
f => f.Id,
f => new FieldState { FieldId = f.Id, Status = FieldStatus.Pending })
};
// First field starts in progress
if (form.Fields.Count > 0)
{
_session.FieldStates[form.Fields[0].Id].Status = FieldStatus.InProgress;
}
return _session;
}
public FieldDefinition? GetCurrentField()
{
if (_currentFieldIndex >= _session.Form.Fields.Count)
return null;
return _session.Form.Fields[_currentFieldIndex];
}
}
राज्य संक्रमण स्पष्ट और परीक्षण योग्य हैं
public StateTransitionResult ProcessExtraction(
ExtractionResponse extraction,
ValidationResult validation)
{
var currentField = GetCurrentField();
if (currentField == null)
return new StateTransitionResult(false, "No current field");
var fieldState = _session.FieldStates[currentField.Id];
fieldState.AttemptCount++;
// Validation failed? Stay on current field
if (!validation.IsValid)
{
return new StateTransitionResult(
false,
$"Validation failed: {validation.ErrorMessage}");
}
// Store the pending value
fieldState.PendingValue = extraction.Value;
fieldState.PendingConfidence = extraction.Confidence;
// Check confirmation policy - this is rules, not AI
var policy = currentField.ConfirmationPolicy
?? new ConfirmationPolicy();
var needsConfirmation = policy.AlwaysConfirm
|| extraction.Confidence < policy.ConfidenceThreshold;
if (needsConfirmation)
{
fieldState.Status = FieldStatus.AwaitingConfirmation;
return new StateTransitionResult(
true,
"Please confirm this value",
RequiresConfirmation: true);
}
// Auto-confirm high confidence values
return ConfirmValue();
}
कुंजी बिंदु _currentFieldIndex केवल पुष्टिकरण पर अग्रिमें, कभी भी बाहर निकालने पर नहीं. इसका अर्थ है एक असफल बाहर निकालना या अस्वीकृत पुष्टिकरण आपको एक ही क्षेत्र में रखता है
पुष्टि तार्किक को ध्यान दें: यह' एक सरल नीति जाँच है alwaysConfirm कम विश्वसनीयता या संवेदनशील क्षेत्र
LLM's संविदा
ओललामा निष्कर्षक का एक काम है
यदि आप यह इंटरफेस बिना परेशानी के नहीं लिख सकते हैं, तो LLM बहुत ज्यादा कर रहा है
public interface IFieldExtractor
{
Task<ExtractionResponse> ExtractAsync(
ExtractionContext context,
CancellationToken ct = default);
}
public record ExtractionContext(
FieldDefinition Field,
string Prompt,
string Transcript);
public record ExtractionResponse(
string FieldId,
string? Value,
double Confidence,
bool NeedsConfirmation, // Suggestion only - policy has final say
string? Reason);
महत्वपूर्ण निष्कर्षक सुझाव दे सकता है NeedsConfirmation: trueलेकिन पुष्टि नीति में हमेशा अंतिम बात होती है
और कार्यान्वयन
public class OllamaFieldExtractor : IFieldExtractor
{
private readonly HttpClient _httpClient;
private readonly string _model;
public async Task<ExtractionResponse> ExtractAsync(
ExtractionContext context,
CancellationToken ct = default)
{
var systemPrompt = BuildSystemPrompt(context.Field);
var userPrompt = $"User said: \"{context.Transcript}\"";
var request = new
{
model = _model,
messages = new[]
{
new { role = "system", content = systemPrompt },
new { role = "user", content = userPrompt }
},
format = "json",
stream = false,
options = new { temperature = 0.1 } // Low = deterministic
};
var response = await _httpClient.PostAsJsonAsync(
"/api/chat", request, ct);
return ParseResponse(response, context.Field.Id);
}
}
क्यों तापमान 0.1? हम चाहते हैं कि एलएलएम नीरस और भविष्यवाणी योग्य हो।
तंत्र प्रवर्धन LLM के बारे में स्पष्ट है
private string BuildSystemPrompt(FieldDefinition field)
{
return $"""
You are a data extraction assistant. Extract the {field.Label}
from the user's speech.
Field type: {field.Type}
Return JSON only:
{{
"fieldId": "{field.Id}",
"value": "<extracted value or null>",
"confidence": <0.0-1.0>,
"needsConfirmation": <true/false>,
"reason": "<brief explanation>"
}}
Rules:
- For dates, output ISO format (YYYY-MM-DD)
- For emails, output lowercase
- For phones, output digits only
- If you can't extract, set value to null
- Be conservative with confidence scores
DO NOT:
- Ask follow-up questions
- Suggest next steps
- Make assumptions beyond the transcript
""";
}
LLM बाहर निकालता है, टाइप फ़ॉर्मेट को वैध करता है।
ऑडियो रिकार्डर को WAV में ब्राउज़र
जावास्क्रिप्ट साइड माइक्रोफोन ऑडियो को पकड़ता है और इसे 16kHz मोनो WAV: में बदल देता है
window.voiceFormAudio = (function () {
let mediaRecorder = null;
let audioChunks = [];
let audioContext = null;
let dotNetRef = null;
async function startRecording() {
const stream = await navigator.mediaDevices
.getUserMedia({ audio: true });
audioContext = new AudioContext();
audioChunks = [];
const options = { mimeType: 'audio/webm;codecs=opus' };
mediaRecorder = new MediaRecorder(stream, options);
mediaRecorder.ondataavailable = (event) => {
if (event.data.size > 0) {
audioChunks.push(event.data);
}
};
mediaRecorder.onstop = async () => {
stream.getTracks().forEach(track => track.stop());
const audioBlob = new Blob(audioChunks, { type: 'audio/webm' });
const wavBlob = await convertToWav(audioBlob);
const wavBytes = await wavBlob.arrayBuffer();
// Send to Blazor
const uint8Array = new Uint8Array(wavBytes);
await dotNetRef.invokeMethodAsync(
'OnRecordingComplete',
Array.from(uint8Array));
};
mediaRecorder.start(100);
}
return { initialize, startRecording, stopRecording };
})();
क्यों WAV? 16kHz मोनो WAV पर हिस्सों को प्रशिक्षित किया जाता है
convertToWav फ़ंक्शन रिसाम्प्लिंग ह्यान्डल करता है
Blazor UI: Two-Column Layout
यूआई वर्तमान क्षेत्र को बाएं ओर स्पष्ट रूप से दिखाता है किनारा पट्टी कोशमेटिक नहीं है उपयोगकर्ता प्रगति को देख सकते हैं
graph LR
subgraph "Left Panel"
A[Current Field Prompt]
B[Record Button]
C[Transcript Display]
D[Confirmation Dialog]
end
subgraph "Right Sidebar"
E[Field 1: Full Name ✓]
F[Field 2: DOB - Active]
G[Field 3: Email - Pending]
H[Field 4: Phone - Pending]
end
style F stroke:#36f,stroke-width:2px
style E stroke:#6f6,stroke-width:2px
यहाँ Blazor पृष्ठ संरचना है
@page "/voiceform/{FormId}"
@inject IFormOrchestrator Orchestrator
@rendermode InteractiveServer
<div class="top-bar">
<h1>Voice Form</h1>
<button class="theme-toggle" onclick="voiceFormTheme.toggle()">
Dark Mode
</button>
</div>
<main>
<div class="voice-form-layout">
<!-- Left: Active Field -->
<div class="active-field-panel">
@if (_currentField != null)
{
<div class="current-prompt">
<h2>@_currentField.Label</h2>
<p class="prompt-text">@_message</p>
</div>
<AudioRecorder OnAudioCaptured="HandleAudioCaptured"
IsRecording="_isRecording"
IsProcessing="_isProcessing" />
@if (!string.IsNullOrEmpty(_transcript))
{
<TranscriptDisplay Transcript="_transcript"
Confidence="_transcriptConfidence" />
}
@if (_showConfirmation)
{
<ConfirmationDialog ExtractedValue="_pendingValue"
OnConfirm="HandleConfirm"
OnReject="HandleReject" />
}
}
</div>
<!-- Right: Form Overview -->
<div class="form-sidebar">
<h3>@_session.Form.Name</h3>
<div class="form-fields-list">
@foreach (var field in _session.Form.Fields)
{
var state = _session.GetFieldState(field.Id);
<div class="form-field-item @GetFieldClass(field, state)">
<div class="field-status-icon">
@GetStatusIcon(state.Status)
</div>
<div class="field-info">
<div class="field-name">@field.Label</div>
<div class="field-value">
@(state.Value ?? "Waiting")
</div>
</div>
</div>
}
</div>
</div>
</div>
</main>
Orchestrator: यह सब एक साथ ला रहा है
वाद्यकार सेवाओं को समन्वयित करता है अपना कोई शाखात्मक तर्क नहींयह सिर्फ अनुक्रम में सेवाओं को बुलाता है और परिणामों के साथ पास करता है
public class FormOrchestrator : IFormOrchestrator
{
private readonly ISttService _sttService;
private readonly IFieldExtractor _extractor;
private readonly IFormValidator _validator;
private readonly IFormStateMachine _stateMachine;
private readonly IFormEventLog _eventLog;
public async Task<ProcessingResult> ProcessAudioAsync(byte[] audioData)
{
var currentField = _stateMachine.GetCurrentField();
if (currentField == null)
return ProcessingResult.Error("No current field");
// Step 1: Speech to text
var sttResult = await _sttService.TranscribeAsync(audioData);
await _eventLog.LogAsync(new TranscriptReceivedEvent(
currentField.Id, sttResult.Transcript, sttResult.Confidence));
// Step 2: Extract structured value
var context = new ExtractionContext(
currentField, currentField.Prompt, sttResult.Transcript);
var extraction = await _extractor.ExtractAsync(context);
await _eventLog.LogAsync(new ExtractionAttemptEvent(
currentField.Id, extraction));
// Step 3: Validate
var validation = _validator.Validate(currentField, extraction.Value);
// Step 4: State machine decides next step
var transition = _stateMachine.ProcessExtraction(extraction, validation);
return new ProcessingResult(
Success: transition.Success,
Message: transition.Message,
Session: _stateMachine.GetSession(),
RequiresConfirmation: transition.RequiresConfirmation,
PendingValue: extraction.Value);
}
}
प्रत्येक चरण स्वतंत्र और परीक्षण योग्य है. राज्य मशीन नेटवर्क को कभी नहीं छूता है. एलएलएम राज्य को कभी नहीं छूता.
गाढा मोड: विन के लिए सीएसएस चर
सीएसएस मनपसंद गुणों के साथ अंधेरा मोड लागू किया जाता है
:root {
--bg-primary: #f8fafc;
--bg-secondary: #ffffff;
--text-primary: #1e293b;
--accent-blue: #3b82f6;
--accent-green: #22c55e;
}
[data-theme="dark"] {
--bg-primary: #0f172a;
--bg-secondary: #1e293b;
--text-primary: #f1f5f9;
--accent-blue: #60a5fa;
--accent-green: #4ade80;
}
body {
background: var(--bg-primary);
color: var(--text-primary);
}
विषयवस्तु टॉगल स्थानीय स्टोरेज के माध्यम से बना रहता है
window.voiceFormTheme = (function () {
const THEME_KEY = 'voiceform-theme';
function toggle() {
const current = document.documentElement
.getAttribute('data-theme') || 'light';
const newTheme = current === 'dark' ? 'light' : 'dark';
document.documentElement.setAttribute('data-theme', newTheme);
localStorage.setItem(THEME_KEY, newTheme);
}
// Initialize from saved preference or system preference
function init() {
const saved = localStorage.getItem(THEME_KEY);
const systemDark = window.matchMedia(
'(prefers-color-scheme: dark)').matches;
const theme = saved || (systemDark ? 'dark' : 'light');
document.documentElement.setAttribute('data-theme', theme);
}
return { toggle, init };
})();
परीक्षण: इकाई परीक्षण + ब्राउज़र इंटीग्रेशन
निर्णायक संरचना परीक्षण में लाभदायक होती है।
[Fact]
public void ProcessExtraction_HighConfidence_AutoConfirms()
{
// Arrange
var form = CreateTestForm();
var stateMachine = new FormStateMachine();
stateMachine.StartSession(form);
var extraction = new ExtractionResponse(
FieldId: "fullName",
Value: "John Smith",
Confidence: 0.95, // High confidence
NeedsConfirmation: false,
Reason: "Clear speech");
var validation = ValidationResult.Success();
// Act
var result = stateMachine.ProcessExtraction(extraction, validation);
// Assert
result.Success.Should().BeTrue();
result.RequiresConfirmation.Should().BeFalse();
var fieldState = stateMachine.GetSession()
.GetFieldState("fullName");
fieldState.Status.Should().Be(FieldStatus.Confirmed);
fieldState.Value.Should().Be("John Smith");
}
और यहाँ-' एक नकारात्मक परीक्षण है-- कम विश्वास शक्तियां LLM क्या सिफारिश करता है के बावजूद पुष्टि
[Fact]
public void ProcessExtraction_LowConfidence_RequiresConfirmation()
{
// Arrange
var form = CreateTestForm();
var stateMachine = new FormStateMachine();
stateMachine.StartSession(form);
var extraction = new ExtractionResponse(
FieldId: "fullName",
Value: "John Smith",
Confidence: 0.65, // Below threshold
NeedsConfirmation: false, // LLM says no, but policy overrides
Reason: "Noisy audio");
var validation = ValidationResult.Success();
// Act
var result = stateMachine.ProcessExtraction(extraction, validation);
// Assert
result.RequiresConfirmation.Should().BeTrue(
"Policy threshold (0.85) should override LLM suggestion");
var fieldState = stateMachine.GetSession()
.GetFieldState("fullName");
fieldState.Status.Should().Be(FieldStatus.AwaitingConfirmation);
}
और एक पुppeteerSharp ब्राउज़र परीक्षण जो वस्तुओं को वास्तव में क्लिक करता है
[Fact]
public async Task HomePage_ThemeToggle_ShouldSwitchTheme()
{
await _page!.GoToAsync(BaseUrl);
await _page.WaitForSelectorAsync(".theme-toggle");
var initialTheme = await _page.EvaluateFunctionAsync<string?>(
"() => document.documentElement.getAttribute('data-theme')");
// Click toggle
await _page.ClickAsync(".theme-toggle");
await Task.Delay(100);
var newTheme = await _page.EvaluateFunctionAsync<string?>(
"() => document.documentElement.getAttribute('data-theme')");
newTheme.Should().NotBe(initialTheme);
}
[Fact]
public async Task VoiceFormPage_Sidebar_ShouldShowAllFields()
{
await _page!.GoToAsync($"{BaseUrl}/voiceform/customer-intake");
await _page.WaitForSelectorAsync(".form-fields-list");
var fieldItems = await _page.QuerySelectorAllAsync(".form-field-item");
fieldItems.Should().HaveCount(5, "Customer intake form has 5 fields");
}
पूरा परीक्षण सूट व्यावसायिक तर्क के लिए 98 परीक्षणों को चलाता है
महत्वपूर्ण बात स्वयं परीक्षण नहीं है
इस वास्तुकला का महत्व क्यों है
हम इसे इस तरह बनाया क्यों फिर से देखने के लिए चलो
graph TD
subgraph "Traditional Voice Form"
A1[User Speaks] --> B1[LLM]
B1 --> C1[LLM decides field]
C1 --> D1[LLM validates]
D1 --> E1[LLM confirms]
E1 --> F1[LLM advances form]
end
subgraph "Ten Commandments Approach"
A2[User Speaks] --> B2[Whisper STT]
B2 --> C2[Ollama Extract]
C2 --> D2[C# Validator]
D2 --> E2[Policy Check]
E2 --> F2[State Machine]
end
style B1 stroke:#f96,stroke-width:2px
style C1 stroke:#f96,stroke-width:2px
style D1 stroke:#f96,stroke-width:2px
style E1 stroke:#f96,stroke-width:2px
style F1 stroke:#f96,stroke-width:2px
style C2 stroke:#f96,stroke-width:2px
style D2 stroke:#6f6,stroke-width:2px
style E2 stroke:#6f6,stroke-width:2px
style F2 stroke:#6f6,stroke-width:2px
पारंपरिक दृष्टिकोण में सब कुछ एलएलएम हैप्रत्येक निर्णय गैर है
हर बग है "it बस कभी-कभी ऐसा करता है कि
हमारे दृष्टिकोण में-,-एलएलएम करता है एक बात: मौखिक को संगठित मानों में अनुवाद करें।
यह कमांडमेंट्स II है। ,; III; ,; और IV क्रिया में हैं।:; LLM अनुवाद करता है। (; कोई भी पक्ष नहीं।
स्वयं चलाना
- निर्भरता प्रारंभ करें
docker compose -f devdeps-docker-compose.yml up -d
docker exec -it ollama ollama pull llama3.2:3b
- एप्लिकेशन चलाएँ
cd Mostlylucid.VoiceForm
dotnet run
में नेविगेट करें
http://localhost:5000क्लिक करें "Customer Intake
निष्कर्ष
ध्वनि इंटरफेसों को ब्लैक बक्से नहीं होना चाहिए
- पूर्वानुमानित व्यवहार - समान इनपुट
- परीक्षण योग्य तर्क - व्यापार नियमों के लिए इकाई परीक्षण
- लेखापरीक्षित निर्णय - प्रत्येक राज्य संक्रमण लॉग किया जाता है
- अनुग्रही अवनति आवाज विफल है
- स्थानीय ऑपरेशन - कोर कार्यात्मकता के लिए कोई क्लाउड निर्भरताएँ नहीं
दस आदेशों के बारे में नहीं है अपने उचित स्थान में एआई लगानाएक शक्तिशाली उपकरण है जो मानव की अव्यवस्थिति और कंप्यूटर सूक्ष्मता के बीच अनुवाद करता है
अस्पष्टता को कम करने के लिए जब AI अपना स्थान अर्जित करता है
अब कुछ बनाओ जहां आप-- न कि मॉडल-- decide what happens next
भाग में आने वाला 2: ध्वनि फीडबैक
अभी, उपयोक्ता प्रवर्धन पढ़ता है और प्रतिक्रियाओं को बोलता है जवाब देनाभाग 2 पाठ को जोड़ेगा | - |- | स्पीच फीडबैक \ , | इसे एक पूर्ण आई वीआर में बदलता है
- ठ̧à¥à¤°à¥à¤ कृपया अपना पूरा नाम बतायें
- निष्कर्षों को पुष्टि करें मैंने सुना है।
- ऑडियो स्थिति संकेत - रिकॉर्डिंग आरंभ के लिए ध्वनि
- हाथ-free ऑपरेशन - स्क्रीन को देखने के बिना फार्मों को पूरा करें
संरचना पहले से ही तैयार है
भाग में आने वाले 3: नीति प्रवर्तन
वर्तमान वैधीकरण प्रकार है-आधारितM SK1 ईमेल ईमेलों की तरह लगते हैं, तारीख को तिथि के रूप में पदवर्णन करें।
भाग 3 जोड़ेगा
- नियम---आधारित सत्यापन - स्कीमा में घोषणात्मक नीतियाँ
- क्रॉस-फ़ील्ड प्रतिबंध यदि देश अमरीका है तो फोन को 10 अंक होना चाहिए
- LLM-समर्थित नीति जांच - संभावित मुद्दों को फ्लैग करने के लिए मॉडल का उपयोग करता है
- लेखापरीक्षा ट्रेल्स - कौन सी नीति ने ट्रिगर किया है
वही सिद्धांत: LLM सलाह देता है, कोड decides.
आगे पढ़ने
- एलएलएम का उपयोग करने के दस आदेश - इस वास्तुकला के पीछे दर्शन
- विकास निर्भरताओं के लिए डॉकर compose का उपयोग करना - स्थानीय सेवाओं की स्थापना
- ASP.NET कोर के साथ HTMX - सर्वर
पूर्ण स्रोत कोड में है Mostlylucid.VoiceForm रिपो में परियोजना