دعم لتخصيص الموجهات في DiscourseAI

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

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

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

6 إعجابات

نأمل ألا يكون ذلك قبل حل مشكلة اللغة الرئيسية :thinking:

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

في هذه الأثناء، يمكننا تركيز هذه الطلبات في هذا الموضوع.

8 إعجابات

هذه ورطة كبيرة! جعل المطالبات قابلة للتخصيص مشكلة صعبة للغاية.

بالتفكير في التفاصيل هنا، لنأخذ:

    CompletionPrompt.seed do |cp|
      cp.id = -306
      cp.name = "explain"
      cp.prompt_type = CompletionPrompt.prompt_types[:text]
      cp.messages = { insts: <<~TEXT }
        أنت مدرس تشرح مصطلحًا لطالب في سياق معين.
        سأقدم لك كل ما تحتاج لمعرفته داخل علامات <input></input>، والتي تتكون من المصطلح الذي أريد منك شرحه داخل علامات <term></term>، وسياق استخدامه داخل علامات <context></context>، وعنوان الموضوع الذي تم استخدامه فيه داخل علامات <topic></topic>، واختياريًا، المنشور السابق في المحادثة داخل علامات <replyTo></replyTo>.
        باستخدام كل هذه المعلومات، اكتب فقرة مع شرح موجز لمعنى المصطلح. قم بتنسيق الاستجابة باستخدام Markdown. قم بالرد بالشرح فقط ولا شيء آخر.
      TEXT
    end

كيف يمكننا حل هذا وجعله قابلاً للتخصيص؟

  1. استخدام نظام الترجمة، ونقل التعليمات إلى server.en.yml
  2. استبدال “مطالبة الإكمال” (Completion Prompt) لصالح نموذج شخصية الذكاء الاصطناعي (Ai Persona)
  3. توفير محرر لنموذج “مطالبة الإكمال” (Completion Prompt)
  4. هندسة المطالبات للخروج من هذا المأزق

1. استخدام نظام الترجمة، ونقل التعليمات إلى server.en.yml

إيجابيات

  • سنقوم بالشحن تلقائيًا مع دعم لغات متعددة
  • النظام موجود بالفعل، لا شيء جديد لبنائه
  • قابل للتخصيص بدرجة كبيرة عبر تجاوزات الترجمة في واجهة المستخدم الإدارية

سلبيات

  • العديد من نماذج اللغات الكبيرة (LLMs) لا تعمل بشكل جيد مع “غير الإنجليزية”، قد يؤدي الترجمة إلى أداء أقل بكثير
  • إذا قام الأشخاص بترجمة tags (العلامات) فسيتم كسرها تمامًا (مثل <title>)

2. المركزية على شخصية الذكاء الاصطناعي (AI Persona)

إيجابيات

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

سلبيات

  • لن نقوم بالشحن مع ترجمات
  • نحتاج إلى بناء واجهة مستخدم لوضع علامة على شخصية للاستخدام بواسطة ميزة: (هل هذا لتوضيح المنشور؟ هل هو لمساعد التأليف؟ هل هو لمولد عنوان الروبوت؟) بعض هذه الأمور فردية (1-1) وبعضها متعدد (1 إلى كثير)
  • بعض الشخصيات لن يكون لها معنى لمحادثات الروبوت، فهي تتطلب علامات <replyTo> و <item> و <input>.

3. توفير واجهة مستخدم لمطالبات الإكمال (Completion Prompts)

إيجابيات

  • فصل واضح عن الشخصيات، وتقليل الارتباك
  • من الجيد أن نكون قادرين على إضافة مطالبات إكمال جديدة للمستخدمين … تريد شيئًا أسفل الترجمة، لا مشكلة
  • سهولة التعديل

سلبيات

  • التعامل المعقد مع “الانجراف” - إذا قام المستخدم بتجاوز مطالبة وأصلحنا الأصلية لإضافة علامة <something_new>، فكيف سيعرفون؟

4. هندسة المطالبات للخروج من هذا المأزق

إذا تمكنا من تحقيق هذا السحر، مع المزيد من التعليمات المخصصة يمكن أن يكون لطيفًا، على سبيل المثال إضافة “هام: يجب أن تكون جميع الردود باللغة الفنلندية”، ولكن الحصول على هذا ليعمل باستمرار سيكون صعبًا.

إيجابيات

  • سحر، يعمل فقط

سلبيات

  • في الواقع، من غير المرجح جدًا أن يعمل باستمرار، فإن وجود تعليمات مخصصة باللغة المناسبة سيؤرض النموذج بشكل أفضل

شخصيًا، أنا أميل إلى (3) هنا في الواقع. خاصة وأنها تمنحنا القدرة على إضافة مطالبات مخصصة ولها فصل قوي. لكنني أتفهم تمامًا (2) كطريقة للخروج، ربما يمكننا تحقيق ذلك ويوحد الكثير من التعليمات البرمجية وهو أمر لطيف جدًا. نحتاج إلى اللعب بهذا وتجربة الفكرة أولاً لتحديد الفائز.

6 إعجابات

ربما لا. لكن OpenAI تعمل.

نحن (كمسؤولين مستخدمين نهائيين) لا نحتاج إلى هندسة مطالبة كاملة في هذه المواقف. نحتاج فقط إلى إضافة طلب لاستخدام لغة معينة في المطالبة. لا أعرف شيئًا عن البرمجة، ولكن بشكل عام، إضافة سلسلة نصية إلى نص أمر بسيط للغاية، أليس كذلك؟ وأنت ترسل نصًا فقط هنا؟

ويجب أن تكون المطالبة نفسها باللغة الإنجليزية، بالطبع.

إعجابَين (2)

it’s specific to the language issue rather than general prompt customization… but if we had a language dropdown, could we ask AI to translate the prompt (except for tags) and then save/send that prompt?

Translating prompt into Finnish AI

:person_curly_hair: translate this into finnish except for the <> tags:

You are a tutor explaining a term to a student in a specific context. I will provide everything you need to know inside <input> tags, which consists of the term I want you to explain inside <term> tags, the context of where it was used inside <context> tags, the title of the topic where it was used inside <topic> tags, and optionally, the previous post in the conversation in <replyTo> tags. Using all this information, write a paragraph with a brief explanation of what the term means. Format the response using Markdown. Reply only with the explanation and nothing more.

:robot: Sinä olet ohjaaja, joka selittää termin oppilaalle tietyssä kontekstissa. Minä tarjoan sinulle kaiken tarvittavan tiedon <input> tageissa, joka sisältää termin, jonka haluat minun selittävän <term> tageissa, kontekstin, jossa sitä käytettiin <context> tageissa, aiheen otsikon, jossa sitä käytettiin <topic> tageissa, ja valinnaisesti, edellisen viestin keskustelussa <replyTo> tageissa. Käyttäen kaikkea tätä tietoa, kirjoita kappale lyhyellä selityksellä siitä, mitä termi tarkoittaa. Muotoile vastaus käyttäen Markdownia. Vastaa vain selityksellä eikä millään muulla.

Could the technical details be a separate part of the prompt? then we have a prompt that’s something like:

Apply this behavior (admins can edit or append):

  • You are a tutor explaining a term to a student in a specific context.
  • Write a paragraphsentence with a brief explanation of what the term means.
  • Reply only with the explanation and nothing more.
  • Use lots of emoji

Using these technical details (uneditable, where we update to avoid drift):

  • the term I want you to explain in inside of <term> tags
  • the context of where it was used inside <context> tags
  • the title of the topic where it was used inside <topic> tags
  • the previous post in the conversation is in <replyTo> tags (optional)
  • format the response using Markdown

it’s specific to the language issue rather than general prompt customization… but if we had a language dropdown, could we ask AI to translate the prompt (except for tags) and then save/send that prompt?

Translating prompt into Finnish AI

:person_curly_hair: translate this into finnish except for the <> tags:

You are a tutor explaining a term to a student in a specific context. I will provide everything you need to know inside <input> tags, which consists of the term I want you to explain inside <term> tags, the context of where it was used inside <context> tags, the title of the topic where it was used inside <topic> tags, and optionally, the previous post in the conversation in <replyTo> tags. Using all this information, write a paragraph with a brief explanation of what the term means. Format the response using Markdown. Reply only with the explanation and nothing more.

:robot: Sinä olet ohjaaja, joka selittää termin oppilaalle tietyssä kontekstissa. Minä tarjoan sinulle kaiken tarvittavan tiedon <input> tageissa, joka sisältää termin, jonka haluat minun selittävän <term> tageissa, kontekstin, jossa sitä käytettiin <context> tageissa, aiheen otsikon, jossa sitä käytettiin <topic> tageissa, ja valinnaisesti, edellisen viestin keskustelussa <replyTo> tageissa. Käyttäen kaikkea tätä tietoa, kirjoita kappale lyhyellä selityksellä siitä, mitä termi tarkoittaa. Muotoile vastaus käyttäen Markdownia. Vastaa vain selityksellä eikä millään muulla.

Could the technical details be a separate part of the prompt? then we have a prompt that’s something like:

Apply this behavior (admins can edit or append):

  • You are a tutor explaining a term to a student in a specific context.
  • Write a paragraphsentence with a brief explanation of what the term means.
  • Reply only with the explanation and nothing more.
  • Use lots of emoji

Using these technical details (uneditable, where we update to avoid drift):

  • the term I want you to explain in inside of <term> tags
  • the context of where it was used inside <context> tags
  • the title of the topic where it was used inside <topic> tags
  • the previous post in the conversation is in <replyTo> tags (optional)
  • format the response using Markdown

it’s specific to the language issue rather than general prompt customization… but if we had a language dropdown, could we ask AI to translate the prompt (except for tags) and then save/send that prompt?

Translating prompt into Finnish AI

:person_curly_hair: translate this into finnish except for the <> tags:

You are a tutor explaining a term to a student in a specific context. I will provide everything you need to know inside <input> tags, which consists of the term I want you to explain inside <term> tags, the context of where it was used inside <context> tags, the title of the topic where it was used inside <topic> tags, and optionally, the previous post in the conversation in <replyTo> tags. Using all this information, write a paragraph with a brief explanation of what the term means. Format the response using Markdown. Reply only with the explanation and nothing more.

:robot: Sinä olet ohjaaja, joka selittää termin oppilaalle tietyssä kontekstissa. Minä tarjoan sinulle kaiken tarvittavan tiedon <input> tageissa, joka sisältää termin, jonka haluat minun selittävän <term> tageissa, kontekstin, jossa sitä käytettiin <context> tageissa, aiheen otsikon, jossa sitä käytettiin <topic> tageissa, ja valinnaisesti, edellisen viestin keskustelussa <replyTo> tageissa. Käyttäen kaikkea tätä tietoa, kirjoita kappale lyhyellä selityksellä siitä, mitä termi tarkoittaa. Muotoile vastaus käyttäen Markdownia. Vastaa vain selityksellä eikä millään muulla.

Could the technical details be a separate part of the prompt? then we have a prompt that’s something like:

Apply this behavior (admins can edit or append):

  • You are a tutor explaining a term to a student in a specific context.
  • Write a paragraphsentence with a brief explanation of what the term means.
  • Reply only with the explanation and nothing more.
  • Use lots of emoji

Using these technical details (uneditable, where we update to avoid drift):

  • the term I want you to explain in inside of <term> tags
  • the context of where it was used inside <context> tags
  • the title of the topic where it was used inside <topic> tags
  • the previous post in the conversation is in <replyTo> tags (optional)
  • format the response using Markdown

it’s specific to the language issue rather than general prompt customization… but if we had a language dropdown, could we ask AI to translate the prompt (except for tags) and then save/send that prompt?

Translating prompt into Finnish AI

:person_curly_hair: translate this into finnish except for the <> tags:

You are a tutor explaining a term to a student in a specific context. I will provide everything you need to know inside <input> tags, which consists of the term I want you to explain inside <term> tags, the context of where it was used inside <context> tags, the title of the topic where it was used inside <topic> tags, and optionally, the previous post in the conversation in <replyTo> tags. Using all this information, write a paragraph with a brief explanation of what the term means. Format the response using Markdown. Reply only with the explanation and nothing more.

:robot: Sinä olet ohjaaja, joka selittää termin oppilaalle tietyssä kontekstissa. Minä tarjoan sinulle kaiken tarvittavan tiedon <input> tageissa, joka sisältää termin, jonka haluat minun selittävän <term> tageissa, kontekstin, jossa sitä käytettiin <context> tageissa, aiheen otsikon, jossa sitä käytettiin <topic> tageissa, ja valinnaisesti, edellisen viestin keskustelussa <replyTo> tageissa. Käyttäen kaikkea tätä tietoa, kirjoita kappale lyhyellä selityksellä siitä, mitä termi tarkoittaa. Muotoile vastaus käyttäen Markdownia. Vastaa vain selityksellä eikä millään muulla.

Could the technical details be a separate part of the prompt? then we have a prompt that’s something like:

Apply this behavior (admins can edit or append):

  • You are a tutor explaining a term to a student in a specific context.
  • Write a paragraphsentence with a brief explanation of what the term means.
  • Reply only with the explanation and nothing more.
  • Use lots of emoji

Using these technical details (uneditable, where we update to avoid drift):

  • the term I want you to explain in inside of <term> tags
  • the context of where it was used inside <context> tags
  • the title of the topic where it was used inside <topic> tags
  • the previous post in the conversation is in <replyTo> tags (optional)
  • format the response using Markdown

it’s specific to the language issue rather than general prompt customization… but if we had a language dropdown, could we ask AI to translate the prompt (except for tags) and then save/send that prompt?

Translating prompt into Finnish AI

:person_curly_hair: translate this into finnish except for the <> tags:

You are a tutor explaining a term to a student in a specific context. I will provide everything you need to know inside <input> tags, which consists of the term I want you to explain inside <term> tags, the context of where it was used inside <context> tags, the title of the topic where it was used inside <topic> tags, and optionally, the previous post in the conversation in <replyTo> tags. Using all this information, write a paragraph with a brief explanation of what the term means. Format the response using Markdown. Reply only with the explanation and nothing more.

:robot: Sinä olet ohjaaja, joka selittää termin oppilaalle tietyssä kontekstissa. Minä tarjoan sinulle kaiken tarvittavan tiedon <input> tageissa, joka sisältää termin, jonka haluat minun selittävän <term> tageissa, kontekstin, jossa sitä käytettiin <context> tageissa, aiheen otsikon, jossa sitä käytettiin <topic> tageissa, ja valinnaisesti, edellisen viestin keskustelussa <replyTo> tageissa. Käyttäen kaikkea tätä tietoa, kirjoita kappale lyhyellä selityksellä siitä, mitä termi tarkoittaa. Muotoile vastaus käyttäen Markdownia. Vastaa vain selityksellä eikä millään muulla.

Could the technical details be a separate part of the prompt? then we have a prompt that’s something like:

Apply this behavior (admins can edit or append):

  • You are a tutor explaining a term to a student in a specific context.
  • Write a paragraphsentence with a brief explanation of what the term means.
  • Reply only with the explanation and nothing more.
  • Use lots of emoji

Using these technical details (uneditable, where we update to avoid drift):

  • the term I want you to explain in inside of <term> tags
  • the context of where it was used inside <context> tags
  • the title of the topic where it was used inside <topic> tags
  • the previous post in the conversation is in <replyTo> tags (optional)
  • format the response using Markdown

it’s specific to the language issue rather than general prompt customization… but if we had a language dropdown, could we ask AI to translate the prompt (except for tags) and then save/send that prompt?

Translating prompt into Finnish AI

:person_curly_hair: translate this into finnish except for the <> tags:

You are a tutor explaining a term to a student in a specific context. I will provide everything you need to know inside <input> tags, which consists of the term I want you to explain inside <term> tags, the context of where it was used inside <context> tags, the title of the topic where it was used inside <topic> tags, and optionally, the previous post in the conversation in <replyTo> tags. Using all this information, write a paragraph with a brief explanation of what the term means. Format the response using Markdown. Reply only with the explanation and nothing more.

:robot: Sinä olet ohjaaja, joka selittää termin oppilaalle tietyssä kontekstissa. Minä tarjoan sinulle kaiken tarvittavan tiedon <input> tageissa, joka sisältää termin, jonka haluat minun selittävän <term> tageissa, kontekstin, jossa sitä käytettiin <context> tageissa, aiheen otsikon, jossa sitä käytettiin <topic> tageissa, ja valinnaisesti, edellisen viestin keskustelussa <replyTo> tageissa. Käyttäen kaikkea tätä tietoa, kirjoita kappale lyhyellä selityksellä siitä, mitä termi tarkoittaa. Muotoile vastaus käyttäen Markdownia. Vastaa vain selityksellä eikä millään muulla.

Could the technical details be a separate part of the prompt? then we have a prompt that’s something like:

Apply this behavior (admins can edit or append):

  • You are a tutor explaining a term to a student in a specific context.
  • Write a paragraphsentence with a brief explanation of what the term means.
  • Reply only with the explanation and nothing more.
  • Use lots of emoji

Using these technical details (uneditable, where we update to avoid drift):

  • the term I want you to explain in inside of <term> tags
  • the context of where it was used inside <context> tags
  • the title of the topic where it was used inside <topic> tags
  • the previous post in the conversation is in <replyTo> tags (optional)
  • format the response using Markdown

it’s specific to the language issue rather than general prompt customization… but if we had a language dropdown, could we ask AI to translate the prompt (except for tags) and then save/send that prompt?

Translating prompt into Finnish AI

:person_curly_hair: translate this into finnish except for the <> tags:

You are a tutor explaining a term to a student in a specific context. I will provide everything you need to know inside <input> tags, which consists of the term I want you to explain inside <term> tags, the context of where it was used inside <context> tags, the title of the topic where it was used inside <topic> tags, and optionally, the previous post in the conversation in <replyTo> tags. Using all this information, write a paragraph with a brief explanation of what the term means. Format the response using Markdown. Reply only with the explanation and nothing more.

:robot: Sinä olet ohjaaja, joka selittää termin oppilaalle tietyssä kontekstissa. Minä tarjoan sinulle kaiken tarvittavan tiedon <input> tageissa, joka sisältää termin, jonka haluat minun selittävän <term> tageissa, kontekstin, jossa sitä käytettiin <context> tageissa, aiheen otsikon, jossa sitä käytettiin <topic> tageissa, ja valinnaisesti, edellisen viestin keskustelussa <replyTo> tageissa. Käyttäen kaikkea tätä tietoa, kirjoita kappale lyhyellä selityksellä siitä, mitä termi tarkoittaa. Muotoile vastaus käyttäen Markdownia. Vastaa vain selityksellä eikä millään muulla.

Could the technical details be a separate part of the prompt? then we have a prompt that’s something like:

Apply this behavior (admins can edit or append):

  • You are a tutor explaining a term to a student in a specific context.
  • Write a paragraphsentence with a brief explanation of what the term means.
  • Reply only with the explanation and nothing more.
  • Use lots of emoji

Using these technical details (uneditable, where we update to avoid drift):

  • the term I want you to explain in inside of <term> tags
  • the context of where it was used inside <context> tags
  • the title of the topic where it was used inside <topic> tags
  • the previous post in the conversation is in <replyTo> tags (optional)
  • format the response using Markdown

it’s specific to the language issue rather than general prompt customization… but if we had a language dropdown, could we ask AI to translate the prompt (except for tags) and then save/send that prompt?

Translating prompt into Finnish AI

:person_curly_hair: translate this into finnish except for the <> tags:

You are a tutor explaining a term to a student in a specific context. I will provide everything you need to know inside <input> tags, which consists of the term I want you to explain inside <term> tags, the context of where it was used inside <context> tags, the title of the topic where it was used inside <topic> tags, and optionally, the previous post in the conversation in <replyTo> tags. Using all this information, write a paragraph with a brief explanation of what the term means. Format the response using Markdown. Reply only with the explanation and nothing more.

:robot: Sinä olet ohjaaja, joka selittää termin oppilaalle tietyssä kontekstissa. Minä tarjoan sinulle kaiken tarvittavan tiedon <input> tageissa, joka sisältää termin, jonka haluat minun selittävän <term> tageissa, kontekstin, jossa sitä käytettiin <context> tageissa, aiheen otsikon, jossa sitä käytettiin <topic> tageissa, ja valinnaisesti, edellisen viestin keskustelussa <replyTo> tageissa. Käyttäen kaikkea tätä tietoa, kirjoita kappale lyhyellä selityksellä siitä, mitä termi tarkoittaa. Muotoile vastaus käyttäen Markdownia. Vastaa vain selityksellä eikä millään muulla.

[quote=“Sam Saffron, post:4, topic:296204, username:sam”]
Complex dealing with “drift” - if a user overrides a prompt and we fix the original to add a <something_new> tag, how will they know?

إعجاب واحد (1)

لا، هذه فكرة سيئة للغاية. سيقوم بترجمتين، مما يغير الموجه في كل مرة. كل ما هو مطلوب هو عبارة “أجب باللغة [أي لغة]” [1]. مشكلتك هي تحديد ما ستكون عليه تلك اللغة، وأود أن أقترح نفس اللغة التي يستخدمها هذا المنتدى كلغة افتراضية.


  1. أو “استخدم”… هذه مجرد مسألة صياغة، ولكن يجب أن تكون باللغة الإنجليزية. حسنًا، هذا صحيح مع OpenAI، أما الآخرون فهي منطقة مجهولة بالنسبة لي ↩︎

إعجاب واحد (1)

لدي حل مؤقت.

قم بعمل Fork لـ discourse-ai من GitHub وقم بتعديل المحتوى للتحدث باللغة الفرنسية.

مثل هذا:

ثم قم بتعديل ملف app.yml وقم بتغيير عنوان المكون الإضافي discourse-ai إلى المستودع الخاص بك.

أخيرًا، قم بمزامنة المستودع الخاص بك يدويًا من المستودع الرسمي.

عذرًا ولكن من فضلك لا تفعل ذلك، يرسل طلب السحب هذا طلبات إلى وكيل Netlify، وسأحاول إجراء بعض الإصلاحات السهلة اليوم

إعجابَين (2)

لدي إثبات مفهوم ومثال عملي هنا:

يعمل GPT-4 بشكل جيد جدًا في معظم اللغات، GPT 3.5 مقبول إلى حد ما، لست متأكدًا مما يتحدث عنه Gemini pro، فهو في أرض غريبة.

ينتج Claude 2 نتائج معقولة أيضًا.

3 إعجابات

مدقق لغوي

اختبرت قبل / بعد، وعلى الأقل بالنسبة لـ GPT-4-Turbo واللغة البرتغالية عند استخدام المدقق اللغوي، لا يوجد أي تغيير على الإطلاق. أعتقد أن النموذج كان ذكيًا بما يكفي للاحتفاظ بنصي بلغته الأصلية.

وصف صور الذكاء الاصطناعي

لقد قمت بتوسيعه ليشمل وصف الصور، وهو يعمل بشكل جيد جدًا هناك:

5 إعجابات

شكراً لكم يا رفاق! على الأقل يتم الآن إنشاء التسميات التوضيحية باللغة المطلوبة (والجودة متوقعة، ولكن هذا يأتي من OpenAI، بالنسبة لي على أي حال).

الملخصات… لا أعرف بعد لأنني لم أتمكن من إنشائها منذ فترة. ولكن هذه قصة أخرى تمامًا.

إعجابَين (2)