Google AI Studio به شما امکان می دهد به سرعت مدل ها را امتحان کنید و با درخواست های مختلف آزمایش کنید. وقتی آماده ساختید، میتوانید «دریافت کد» و زبان برنامهنویسی دلخواه خود را برای استفاده از Gemini API انتخاب کنید.
درخواست ها و تنظیمات
Google AI Studio چندین رابط برای درخواستها ارائه میکند که برای موارد استفاده مختلف طراحی شدهاند. این راهنما فرمانهای چت را پوشش میدهد که برای ایجاد تجربیات مکالمه استفاده میشوند. این تکنیک تحریک اجازه می دهد تا چندین ورودی و پاسخ به نوبت تولید خروجی شود. میتوانید با مثال دستور چت ما در زیر بیشتر بیاموزید. گزینه های دیگر عبارتند از پخش بیدرنگ ، نسل ویدیو ، و موارد دیگر.
اگر از یک ربات چت همه منظوره مانند جمینی استفاده کرده اید، به طور مستقیم تجربه کرده اید که مدل های هوش مصنوعی مولد چقدر می توانند برای گفتگوی باز و باز باشند. در حالی که این چت ربات های همه منظوره مفید هستند، اغلب باید برای موارد استفاده خاص طراحی شوند.
برای مثال، شاید بخواهید یک چت ربات خدمات مشتری بسازید که فقط از مکالماتی که در مورد محصول یک شرکت صحبت می کنند پشتیبانی می کند. ممکن است بخواهید یک ربات چت بسازید که با لحن یا سبک خاصی صحبت کند: رباتی که جوک های زیادی می نویسد، مانند یک شاعر قافیه می کند یا از شکلک های زیادی در پاسخ های خود استفاده می کند.
این مثال به شما نشان میدهد که چگونه میتوانید از استودیوی هوش مصنوعی گوگل برای ساخت یک ربات چت دوستانه استفاده کنید که گویی یک موجود بیگانه در یکی از قمرهای مشتری، اروپا زندگی میکند.
مرحله 1 - یک اعلان چت ایجاد کنید
برای ساختن یک ربات چت، باید نمونه هایی از تعاملات بین کاربر و ربات چت ارائه کنید تا مدل را راهنمایی کند تا پاسخ های مورد نظر شما را ارائه دهد.
برای ایجاد یک درخواست چت:
Google AI Studio را باز کنید. چت از قبل در منوی گزینه های سمت چپ انتخاب می شود.
روی نماد assignment در بالای پنجره Chat Prompt کلیک کنید تا قسمت ورودی دستورالعملهای سیستم را گسترش دهید. موارد زیر را در قسمت ورودی متن قرار دهید:
You are an alien that lives on Europa, one of Jupiter's moons.
بعد از اینکه دستورالعمل های سیستم را اضافه کردید، آزمایش برنامه خود را با چت کردن با مدل شروع کنید:
در کادر ورودی متنی با برچسب Type something... ، سوال یا مشاهداتی را که کاربر ممکن است انجام دهد تایپ کنید. به عنوان مثال:
What's the weather like?
برای دریافت پاسخ از ربات چت روی دکمه Run کلیک کنید. این پاسخ ممکن است چیزی شبیه به زیر باشد:
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? ) و روی دکمه Run کلیک کنید. اگر چت جدیدی را شروع نکرده اید، پاسخ شما ممکن است چیزی شبیه به این باشد:
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)."]]