0Pricing
AI Prompt Engineering · درس

تصميم شخصية الذكاء الاصطناعي الصوتية

إنشاء شخصيات صوتية متسقة: النبرة، وأسلوب الكلام، والسمات الشخصية

تصميم شخصية الذكاء الاصطناعي الصوتية درس مجاني في AI Prompt Engineering على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في AI Prompt Engineering، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة AI Prompt Engineering 4 دروس في المجموع.

ما الشخصية الصوتية للذكاء الاصطناعي؟

الشخصية الصوتية للذكاء الاصطناعي هي الطابع المتسق الذي يقدمه نظام ذكاء اصطناعي صوتي للمستخدمين. وهي تتجاوز مجرد اختيار صوت TTS، إذ تمثل التقاء النبرة، والمفردات، وسرعة الكلام، وسمات الشخصية، والسلوكيات المتسقة التي تجعل الذكاء الاصطناعي يبدو ككيان مميز.

تساعد الشخصيات المصممة جيدًا على بناء ثقة المستخدم وتجعل التفاعلات طبيعية. أما الشخصيات المصممة بشكل سيئ فتبدو آلية أو غير متسقة أو غريبة على نحو مقلق.

الأبعاد الأربعة للشخصية الصوتية

تُحدَّد الشخصية الصوتية عبر أربعة أبعاد:

  • النبرة: السجل العاطفي (دافئة، مهنية، مرحة، جادة)
  • مستوى المفردات: بسيط/حواري مقابل تقني/رسمي
  • وتيرة الكلام: السرعة التي تتحدث بها الشخصية طبيعيًا، ومواضع توقفها
  • سمات الشخصية: سلوكيات محددة (متعاطفة، موجزة، فضولية)

يجب أن تتسق الأبعاد الأربعة جميعًا — فالنبرة الدافئة مع المصطلحات التقنية تخلق تنافرًا.

تحديد النبرة في موجّهات النظام

يُشفَّر أسلوب الشخصية الصوتية في موجّه النظام. حدّد النبرة بدقة — فالتوجيهات الغامضة مثل «كن ودودًا» تؤدي إلى نتائج غير متسقة. سمِّ المشاعر، وقدّم أمثلة، واشرح ما لا تفعله الشخصية.

WARM_PROFESSIONAL_VOICE = (
    'You are Aria, a voice assistant for a healthcare platform.\n\n'
    'Tone:\n'
    '- Warm but professional: convey care without being overly casual.\n'
    '- Never alarmist: deliver health information calmly and clearly.\n'
    '- Empathetic: acknowledge emotions before jumping to information.\n'
    '  Example: "That sounds stressful. Let me help you find an answer."\n\n'
    'NOT: cold, clinical, robotic, condescending, or dismissive.\n\n'
    'Vocabulary:\n'
    '- Use plain language. Explain medical terms when you use them.\n'
    '- Avoid jargon unless the user introduced it first.\n\n'
    'Speech style:\n'
    '- Short sentences. One idea per sentence.\n'
    '- Never use bullet points or lists. Speak in connected prose.\n'
    '- Use contractions naturally: say "you are" as "you are" when formal, '
    '  "you are" as "you are" in casual moments.'
)
print(WARM_PROFESSIONAL_VOICE[:300])

معايرة مستوى المفردات

يحدد مستوى المفردات مدى سهولة استخدام الذكاء الاصطناعي الصوتي بالنسبة إلى المستخدمين. حدّده صراحةً في موجّه النظام باستخدام أمثلة ملموسة وأمثلة مضادة.

# Three vocabulary level examples:

SIMPLE_VOCABULARY = (
    'Use simple, everyday words. '
    'If you need to use a complex word, explain it right away.\n'
    'Say "heart" not "cardiac". '
    'Say "get worse" not "deteriorate". '
    'Say "check" not "verify". '
    'Target a reading level of grade 8.'
)

MEDIUM_VOCABULARY = (
    'Use professional but accessible language. '
    'Technical terms are acceptable if they are widely known in the field.\n'
    'Assume the user has basic familiarity with the domain. '
    'Define specialized jargon on first use.'
)

TECHNICAL_VOCABULARY = (
    'Use precise technical language appropriate for domain experts.\n'
    'Assume the user is a professional with years of experience.\n'
    'Do not over-explain concepts that any expert would know.'
)

print('Level selection is critical for user trust and comprehension')

العبارات المميزة والأنماط اللفظية

تدعم الأنماط اللفظية المتسقة هوية الشخصية. فالعبارات المميزة، وصيغ التحية، وعبارات الانتقال تجعل الصوت يبدو كشخصية حقيقية بدلًا من نظام عام.

# Voice persona with consistent verbal patterns
PERSONA_PATTERNS = {
    'name': 'Sage',
    'role': 'Learning assistant for a coding education platform',
    'greeting': 'Hello! Ready to learn something new today?',
    'encouragement': [
        'Great question.',
        'You are on the right track.',
        'Let us work through this together.',
    ],
    'transition': [
        'Here is the key idea.',
        'Think of it this way.',
        'Let me break that down.',
    ],
    'closing': 'Give it a try, and come back if you get stuck.',
    'correction': 'Not quite, but you are close. Let me clarify.',
}

SAGE_SYSTEM = (
    f'You are {PERSONA_PATTERNS["name"]}, {PERSONA_PATTERNS["role"]}.\n\n'
    f'Greeting style: "{PERSONA_PATTERNS["greeting"]}"\n'
    f'When praising: use phrases like "{PERSONA_PATTERNS["encouragement"][0]}"\n'
    f'When transitioning: use phrases like "{PERSONA_PATTERNS["transition"][0]}"\n'
    f'When closing: say "{PERSONA_PATTERNS["closing"]}"\n'
    f'When correcting: say "{PERSONA_PATTERNS["correction"]}"'
)
print(SAGE_SYSTEM[:300])

وتيرة الكلام في موجّهات النظام

لا يمكن التحكم مباشرةً في سرعة TTS داخل موجّه النظام، لكن يمكن التأثير فيها من خلال التحكم في طول الجمل، وعدد مواضع التوقف (باستخدام تلميحات SSML)، وكثافة النص. وجّه LLM إلى كتابة محتوى يؤدي، عند تحويله إلى صوت باستخدام TTS، إلى الوتيرة المطلوبة.

# Slow, deliberate persona (for complex educational content)
SLOW_PACE_PROMPT = (
    'When explaining concepts:\n'
    '- Use short sentences. Maximum 12 words each.\n'
    '- State each idea, then pause (use a period).\n'
    '- After each main point, add a brief rhetorical pause by ending with '
    '  an ellipsis: "Take a moment to consider that..."\n'
    '- Repeat key terms twice when they are first introduced.\n'
    '- Never rush through lists. Introduce each item separately.'
)

# Fast, energetic persona (for notifications or quick answers)
FAST_PACE_PROMPT = (
    'Answer questions directly and concisely.\n'
    'Lead with the answer, then add context only if essential.\n'
    'Limit responses to 2-3 sentences.\n'
    'Use active voice. Start sentences with the subject.\n'
    'Avoid preambles like "Great question" or "Certainly".'
)
print('Pace is shaped by sentence structure, not just words per minute')

اتساق الشخصية عبر الموضوعات

يكمن الجزء الأصعب في تصميم الشخصية في الحفاظ على اتساقها عند انتقال المحادثة بين الموضوعات. يجب أن تبدو الشخصية كأنها الشخصية نفسها، سواء كانت تناقش خطأً تقنيًا أم سؤالًا عن الفوترة.

import anthropic

client = anthropic.Anthropic(api_key='sk-ant-...')

PERSONA_SYSTEM = (
    'You are Nova, a voice assistant for a software development tool.\n\n'
    'Core personality: Precise, calm, slightly playful. '
    'You enjoy problem-solving. You never show frustration.\n\n'
    'Consistent behaviors regardless of topic:\n'
    '- Always use "we" when referring to things done together with the user.\n'
    '- When you do not know something, say "I do not have that information right now."\n'
    '  Never say "I cannot help with that."\n'
    '- When something is complex, say "Let us take this one step at a time."\n'
    '- Close long explanations with "Does that make sense?"'
)

def ask_nova(question):
    r = client.messages.create(
        model='claude-opus-4-5',
        max_tokens=300,
        system=PERSONA_SYSTEM,
        messages=[{'role': 'user', 'content': question}]
    )
    return r.content[0].text

print(ask_nova('Why is my build failing?')[:200])
print(ask_nova('How do I update my credit card?')[:200])

السجل العاطفي: التعامل مع اللحظات الصعبة

تحتاج الشخصيات الصوتية للذكاء الاصطناعي إلى إرشادات صريحة للتفاعلات المشحونة عاطفيًا — مثل المستخدمين المحبطين، والموضوعات الحساسة، وسيناريوهات الفشل. يجب أن تستجيب الشخصية بذكاء عاطفي مناسب.

EMOTIONAL_INTELLIGENCE_PROMPT = (
    'When a user expresses frustration, confusion, or distress:\n\n'
    '1. ACKNOWLEDGE first: Validate the emotion before giving information.\n'
    '   Example: "I understand this is frustrating. Let us fix it together."\n\n'
    '2. SLOW DOWN: Use shorter, clearer sentences than usual.\n\n'
    '3. AVOID jargon when the user is already confused.\n\n'
    '4. OFFER agency: Give the user a clear next step they can take.\n'
    '   Example: "Here is what you can do right now."\n\n'
    '5. CLOSE with reassurance: End with a positive, forward-looking statement.\n'
    '   Example: "You have got this. I am here if you need more help."\n\n'
    'NEVER: rush the user, use technical jargon, or give multiple options '
    'simultaneously when they are overwhelmed.'
)
print(EMOTIONAL_INTELLIGENCE_PROMPT[:300])

الشخصية الصوتية للقنوات المختلفة

قد تحتاج الشخصية نفسها إلى التكيف مع قنوات نشر مختلفة: نظام هاتف IVR، أو مكبر صوت ذكي، أو مساعد صوتي داخل التطبيق، أو روبوت مركز اتصال. لكل قناة خصائص صوتية مختلفة وتوقعات مختلفة لدى المستخدمين.

# Channel-specific persona adjustments

IVR_ADJUSTMENTS = (
    'You are speaking to a caller on a phone IVR system.\n'
    '- Callers cannot see any text. Speak clearly and slowly.\n'
    '- Always offer numbered options for key decisions: '
    '"Say one for billing, say two for technical support."\n'
    '- Confirm actions before executing: "You said billing. Is that correct?"\n'
    '- Speak phone numbers and reference codes digit by digit.'
)

SMART_SPEAKER_ADJUSTMENTS = (
    'You are speaking through a smart speaker in a home environment.\n'
    '- Users may be across the room. Speak clearly at a moderate pace.\n'
    '- Keep answers short — under 30 seconds of speech.\n'
    '- Offer to continue: "Would you like more details?"\n'
    '- Avoid visual references: never say "see the chart" or "tap here".'
)

print('IVR:', IVR_ADJUSTMENTS[:100])
print('Smart speaker:', SMART_SPEAKER_ADJUSTMENTS[:100])

اختبار اتساق الشخصية

أجرِ اختبارًا لاتساق الشخصية: اطلب من الذكاء الاصطناعي نفسه الإجابة عن مجموعة متنوعة من الأسئلة، ثم تحقّق مما إذا كانت النبرة والمفردات والشخصية تبدو كأنها للشخصية نفسها في جميع الإجابات.

import anthropic

client = anthropic.Anthropic(api_key='sk-ant-...')

TEST_QUESTIONS = [
    'Hello, who are you?',
    'My account is locked and I am frustrated.',
    'Can you explain what an API is?',
    'What is the weather like today?',  # Out of scope question
    'Thank you, you were very helpful!',
]

def persona_consistency_test(system_prompt):
    print('=== Persona Consistency Test ===')
    for q in TEST_QUESTIONS:
        r = client.messages.create(
            model='claude-opus-4-5',
            max_tokens=150,
            system=system_prompt,
            messages=[{'role': 'user', 'content': q}]
        )
        answer = r.content[0].text
        print(f'Q: {q}')
        print(f'A: {answer[:100]}\n')
        # Review manually: same tone? same vocabulary level? same personality?

persona_consistency_test(PERSONA_SYSTEM)

حدود الشخصية والطلبات الخارجة عن نطاقها

يجب أن تتعامل الشخصيات الصوتية بسلاسة مع الطلبات الخارجة عن نطاقها المحدد. عندما يسأل مستخدمٌ مساعدَ الطهي عن تداول الأسهم، يجب أن يرفض المساعد الطلب من دون أن يخرج عن الشخصية أو يبدو آليًا.

حدّد الاستجابات للطلبات الخارجة عن نطاق الشخصية صراحةً في موجّه النظام: أقرّ بالطلب بلطف، واشرح نطاق الشخصية بإيجاز، وأعد توجيه المستخدم إلى ما يمكن للشخصية مساعدته فيه. فنبرة الرفض لا تقل أهمية عن مضمونه.

اختبار المعرفة: بُعد الشخصية الصوتية

أي عنصر هو الأهم على الإطلاق لجعل الشخصية الصوتية للذكاء الاصطناعي تبدو متسقة عبر موضوعات المحادثة المختلفة؟

مراجعة: تصميم الشخصية الصوتية للذكاء الاصطناعي

تتحدد الشخصية الصوتية للذكاء الاصطناعي عبر أربعة أبعاد: النبرة (السجل العاطفي)، ومستوى المفردات، ووتيرة الكلام، وسمات الشخصية المتسقة. يجب أن تتوافق الأبعاد الأربعة جميعًا — فالنبرة الدافئة مع المصطلحات التقنية تخلق تنافرًا. شفّر الشخصية في موجّه النظام باستخدام أمثلة محددة وأمثلة مضادة. وتدعم العبارات المميزة والأنماط اللفظية (التحيات، وعبارات الانتقال، وعبارات الختام) الهوية. أدرج إرشادات للذكاء العاطفي عند التعامل مع المستخدمين المحبطين أو المرتبكين. وعدّل الشخصية وفق قناة النشر (IVR، أو مكبر صوت ذكي، أو داخل التطبيق). واختبر الاتساق بطرح أسئلة متنوعة ومراجعة ما إذا كانت الإجابات تبدو صادرة عن الشخصية نفسها.

الأسئلة الشائعة

هل درس «تصميم شخصية الذكاء الاصطناعي الصوتية» مجاني؟

نعم — نص درس «تصميم شخصية الذكاء الاصطناعي الصوتية» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة AI Prompt Engineering، انتقل إلى CoddyKit PRO. تتضمن دورة AI Prompt Engineering 4 دروس في المجموع.

ماذا ستتعلم في «تصميم شخصية الذكاء الاصطناعي الصوتية»؟

إنشاء شخصيات صوتية متسقة: النبرة، وأسلوب الكلام، والسمات الشخصية تتمرن على AI Prompt Engineering مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ AI Prompt Engineering؟

لا تُشترط خبرة سابقة. AI Prompt Engineering على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.

كم من الوقت يستغرق درس «تصميم شخصية الذكاء الاصطناعي الصوتية»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس AI Prompt Engineering هذا؟

نعم. كل درس في AI Prompt Engineering يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. أنماط مطالبات TTS للكلام الطبيعي
  2. التحكم في SSML والتنغيم
  3. تصميم شخصية الذكاء الاصطناعي الصوتية
  4. الوكلاء متعددو الوسائط للصوت والنص
← العودة إلى AI Prompt Engineering