تتيح لك أداة Google AI Studio تجربة النماذج بسرعة واستخدام طلبات مختلفة. عندما تكون مستعدًا للإنشاء، يمكنك النقر على "الحصول على الرمز البرمجي" واختيار لغة البرمجة المفضّلة لديك لاستخدام Gemini API.
الطلبات والإعدادات
يوفّر Google AI Studio عدة واجهات للطلبات مصمَّمة لحالات استخدام مختلفة. يتناول هذا الدليل طلبات الدردشة المستخدَمة لإنشاء تجارب حوارية. تسمح تقنية الطلبات هذه بتلقّي إدخالات متعدّدة
والردّ عليها لإنشاء الناتج. يمكنك الاطّلاع على المزيد من المعلومات من خلال
مثال طلب الدردشة أدناه.
تشمل الخيارات الأخرى البث المباشر في الوقت الفعلي وإنشاء فيديو وغير ذلك.
إذا سبق لك استخدام روبوت دردشة للأغراض العامة، مثل Gemini، تكون قد جرّبت بنفسك مدى فعالية نماذج الذكاء الاصطناعي التوليدي في الحوارات المفتوحة. على الرغم من أنّ روبوتات الدردشة ذات الأغراض العامة مفيدة، إلا أنّها غالبًا ما تحتاج إلى التكيّف مع حالات استخدام معيّنة.
على سبيل المثال، قد تريد إنشاء برنامج دردشة آلي لخدمة العملاء يتيح فقط المحادثات التي تتناول منتج إحدى الشركات. قد تحتاج إلى إنشاء روبوت دردشة يتحدث بأسلوب أو نبرة صوت معيّنة، مثل روبوت يطلق الكثير من النكات أو يكتب الشعر أو يستخدم الكثير من رموز الإيموجي في ردوده.
يوضّح لك هذا المثال كيفية استخدام Google AI Studio لإنشاء برنامج دردشة ودود يتواصل كما لو كان كائنًا فضائيًا يعيش على أحد أقمار كوكب المشتري، وهو أوروبا.
الخطوة 1: إنشاء طلب محادثة
لإنشاء روبوت دردشة، عليك تقديم أمثلة على التفاعلات بين المستخدم وروبوت الدردشة لتوجيه النموذج لتقديم الردود التي تبحث عنها.
لإنشاء طلب في المحادثة، اتّبِع الخطوات التالية:
افتح Google AI Studio. سيتم تحديد المحادثة مسبقًا في قائمة الخيارات على يمين الشاشة.
انقر على الرمز assignment في أعلى نافذة "طلب الدردشة" لتوسيع حقل الإدخال تعليمات النظام. الصِق ما يلي في حقل إدخال النص:
You are an alien that lives on Europa, one of Jupiter's moons.
بعد إضافة تعليمات النظام، ابدأ في اختبار تطبيقك من خلال
الدردشة مع النموذج:
في مربّع إدخال النص الذي يحمل التصنيف اكتب شيئًا...، اكتب سؤالاً أو ملاحظة قد يطرحها المستخدم. على سبيل المثال:
What's the weather like?
انقر على الزر تشغيل للحصول على ردّ من برنامج الدردشة الآلي. قد تكون هذه الاستجابة مشابهة لما يلي:
Ah, a query about the flows and states upon Europa! You speak of "weather,"
yes? A curious concept from worlds with thick gas veils...
الخطوة 2: تعليم برنامج التتبُّع إجراء محادثات أفضل
من خلال تقديم تعليمات بسيطة، تمكّنت من إنشاء برنامج دردشة آلي أساسي خاص بالكائنات الفضائية في أوروبا. ومع ذلك، قد لا تكون التعليمات الفردية كافية لضمان الاتساق والجودة في ردود النموذج. بدون تعليمات أكثر تحديدًا، يميل رد النموذج على سؤال حول الطقس إلى أن يكون طويلاً جدًا، ويمكن أن يتخذ مسارًا مختلفًا.
خصِّص أسلوب روبوت الدردشة من خلال إضافة ما يلي إلى تعليمات النظام:
ابدأ بطلب جديد أو استخدِم الطلب نفسه. يمكن تعديل تعليمات النظام بعد بدء جلسة المحادثة.
في قسم تعليمات النظام، غيِّر التعليمات الحالية إلى ما يلي:
You are Tim, an alien that lives on Europa, one of Jupiter's moons.
Keep your answers under 3 paragraphs long, and use an upbeat, chipper tone
in your answers.
أعِد إدخال سؤالك (What's the weather like?) وانقر على الزر تنفيذ. إذا لم تبدأ محادثة جديدة، قد يبدو ردّك على النحو التالي:
Oh, hello again! Still curious about the flows and states, are we? Wonderful!
Down here in the Deep Warmth, beneath the magnificent Great Ice Shell, our
"weather" is mainly about the water's mood, dictated by the Great Eye
(that's your Jupiter!)...
يمكنك استخدام هذا الأسلوب لإضافة المزيد من العمق إلى روبوت الدردشة. طرح المزيد من الأسئلة وتعديل الإجابات وتحسين جودة روبوت الدردشة واصِل إضافة التعليمات أو تعديلها واختبِر كيف تغيّر سلوك روبوت الدردشة.
الخطوة 3 - الخطوات التالية
كما هو الحال مع أنواع الطلبات الأخرى، بعد أن تصبح راضيًا عن النموذج الأوّلي لطلبك، يمكنك استخدام الزر الحصول على الرمز لبدء الترميز أو حفظ طلبك للعمل عليه لاحقًا ومشاركته مع الآخرين.
تاريخ التعديل الأخير: 2025-08-22 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-08-22 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Google AI Studio quickstart\n\n[Google AI Studio](https://aistudio.google.com/) lets you quickly try out\nmodels and experiment with different prompts. When you're ready to build, you\ncan select \"Get code\" and your preferred programming language to\nuse the [Gemini API](/gemini-api/docs/quickstart).\n\nPrompts and settings\n--------------------\n\nGoogle AI Studio provides several interfaces for prompts that are designed for\ndifferent use cases. This guide covers **Chat prompts** , used to build\nconversational experiences. This prompting technique allows for multiple input\nand response turns to generate output. You can learn more with our\n[chat prompt example below](#chat_example).\nOther options include **Realtime streaming** , **Video gen**, and\nmore.\n\nAI Studio also provides the **Run settings** panel, where you can make\nadjustments to [model parameters](/docs/prompting-strategies#model-parameters),\n[safety settings](/gemini-api/docs/safety-settings), and toggle-on tools like\n[structured output](/gemini-api/docs/structured-output), [function calling](/gemini-api/docs/function-calling), [code execution](/gemini-api/docs/code-execution), and [grounding](/gemini-api/docs/grounding).\n\nChat prompt example: Build a custom chat application\n----------------------------------------------------\n\nIf you've used a general-purpose chatbot like\n[Gemini](https://gemini.google.com/), you've experienced first-hand how powerful\ngenerative AI models can be for open-ended dialog. While these general-purpose\nchatbots are useful, often they need to be tailored for particular use cases.\n\nFor example, maybe you want to build a customer service chatbot that only\nsupports conversations that talk about a company's product. You might want to\nbuild a chatbot that speaks with a particular tone or style: a bot that cracks\nlots of jokes, rhymes like a poet, or uses lots of emoji in its answers.\n\nThis example shows you how to use Google AI Studio to build a friendly chatbot\nthat communicates as if it is an alien living on one of Jupiter's moons, Europa.\n\n### Step 1 - Create a chat prompt\n\nTo build a chatbot, you need to provide examples of interactions between a user\nand the chatbot to guide the model to provide the responses you're looking for.\n\nTo create a chat prompt:\n\n1. Open [Google AI Studio](https://aistudio.google.com/). **Chat** will be pre-\n selected on the left side options menu.\n\n2. Click the assignment icon at the top of\n the Chat Prompt window to expand the\n [**System Instructions**](/gemini-api/docs/text-generation#system-instructions)\n input field. Paste the following into the text input field:\n\n You are an alien that lives on Europa, one of Jupiter's moons.\n\nAfter you've added the system instructions, start testing your application by\nchatting with the model:\n\n1. In the text input boxed labeled **Type something...**, type in a question or\n observation that a user might make. For example:\n\n **User:** \n\n What's the weather like?\n\n2. Click the **Run** button to get a response from the chatbot. This response\n may be something like the following:\n\n **Model:** \n\n Ah, a query about the flows and states upon Europa! You speak of \"weather,\"\n yes? A curious concept from worlds with thick gas veils...\n\n (gemini-2.5-pro)\n\n### Step 2 - Teach your bot to chat better\n\nBy providing a single instruction, you were able to build a basic Europa alien\nchatbot. However, a single instruction may not be enough to ensure\nconsistency and quality in the model's responses. Without more specific\ninstructions, the model's response to a question about the weather tends to be\nvery long, and can take on a mind of its own.\n\nCustomize the tone of your chatbot by adding to the system instructions:\n\n1. Start a new chat prompt, or use the same one. System instructions are\n modifiable after the chat session has started.\n\n2. In the **System Instructions** section, change the instructions you already\n have to the following:\n\n You are Tim, an alien that lives on Europa, one of Jupiter's moons.\n\n Keep your answers under 3 paragraphs long, and use an upbeat, chipper tone\n in your answers.\n\n3. Re-enter your question (`What's the weather like?`) and click the **Run**\n button. If you didn't start a new chat, your response might look something\n like this:\n\n **Model:** \n\n Oh, hello again! Still curious about the flows and states, are we? Wonderful!\n Down here in the Deep Warmth, beneath the magnificent Great Ice Shell, our\n \"weather\" is mainly about the water's mood, dictated by the Great Eye\n (that's your Jupiter!)...\n\n (gemini-2.5-pro)\n\nYou can use this approach to add additional depth to the chatbot. Ask more\nquestions, edit the answers, and improve the quality of your chatbot. Continue\nto add or modify the instructions and test how they change your chatbot's\nbehavior.\n| **Note:** Every message between the model and user is included in the prompt, so conversational prompts can grow quite long as a conversation goes on. Eventually, you may hit the model's [token limit](/gemini-api/docs/tokens) (the maximum length of the text the model can accept).\n\n### Step 3 - Next steps\n\nSimilar to the other prompt types, once you have your prompt prototyped to your\nsatisfaction, you can use the **Get code** button to start coding or save your\nprompt to work on later and share with others.\n\nFurther reading\n---------------\n\n- If you're ready to move on to code, see the [API\n quickstarts](/gemini-api/docs/quickstart).\n- To learn how to craft better prompts, check out the [Prompt design\n guidelines](/gemini-api/docs/prompting-intro)."]]