انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-056-L02

مفاهيم Spring AI: ChatClient والموجّهات (Prompts) والـ advisors

  • الدرس 2 من 7
  • Junior
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

call a model through Spring AI.

الموضوعات المخطط لها

  • Spring AI is a Spring project that gives one API for several model providers.
  • ChatClient has a fluent API: prompt(), system(...), user(...), call().
  • A prompt template fills placeholders, so prompts are not built by string concatenation.
  • Advisors wrap calls to add behavior such as logging or memory; here we only name the idea.
  • The provider and model come from configuration and the starter you add, not from your code.
تفاصيل المخطط المبدئي

عرض عملي

java
String text = chatClient.prompt()
    .system("You write short product descriptions.")
    .user(u -> u.text("Describe: {name}, {features}").param("name", name).param("features", features))
    .call()
    .content();

اختبر فهمك

Where is the provider chosen?

أظهر الإجابة

In configuration and dependencies, not in business code.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.