Gemini 3.1 Flash-Lite هو نموذج متعدّد الوسائط منخفض وقت الاستجابة وفعّال من حيث التكلفة، وهو محسَّن للمهام البسيطة والمتكررة. يتوافق النموذج مع النصوص والصور والفيديوهات والملفات الصوتية وملفات PDF، وهو مصمّم لمهام سير العمل المستندة إلى الوكلاء ذات الحجم الكبير، واستخراج البيانات البسيطة، والتطبيقات التي يكون فيها وقت الاستجابة وتكلفة واجهة برمجة التطبيقات هما القيود الأساسية.
gemini-3.1-flash-lite
| الموقع | الوصف |
|---|---|
| رمز الطراز | gemini-3.1-flash-lite |
| أنواع البيانات المتوافقة |
الإدخالات النصوص والصور والفيديوهات والملفات الصوتية وملفات PDF الناتج نص |
| الحدود القصوى للرموز المميّزة[*] |
الحدّ الأقصى لعدد الرموز المميّزة المدخَلة 1,048,576 الحد الأقصى لعدد الرموز المميّزة الناتجة 65,536 |
| الإمكانات |
غير متاح متاح متاح غير متاح متاح متاح متاح غير متاح غير متاح متاح متاح متاح متاح |
| خيارات الاستهلاك |
متاح متاح متاح |
| الإصدارات |
|
| آخر تعديل | مايو 2026 |
| بطاقة النموذج | بطاقة النموذج |
دليل مطوّري البرامج
يُعدّ Gemini 3.1 Flash-Lite الأفضل في تنفيذ المهام البسيطة على نطاق واسع. إليك بعض حالات الاستخدام التي تناسب Gemini 3.1 Flash-Lite:
الترجمة: ترجمة سريعة ومنخفضة التكلفة وبكميات كبيرة، مثل معالجة رسائل المحادثات والمراجعات وطلبات الدعم على نطاق واسع يمكنك استخدام تعليمات النظام لحصر الناتج في النص المترجَم فقط بدون أي تعليق إضافي:
from google import genai client = genai.Client() text = "Hey, are you down to grab some pizza later? I'm starving!" response = client.models.generate_content( model="gemini-3.1-flash-lite", config={ "system_instruction": "Only output the translated text" }, contents=f"Translate the following text to German: {text}" ) print(response.text)تحويل الصوت إلى نص: يمكنك معالجة التسجيلات أو الملاحظات الصوتية أو أي محتوى صوتي يتطلب تحويله إلى نص بدون الحاجة إلى إنشاء مسار منفصل لتحويل الكلام إلى نص. يتيح استخدام الإدخالات المتعددة الوسائط، ما يتيح لك إرسال الملفات الصوتية مباشرةً لتحويلها إلى نص:
from google import genai client = genai.Client() # URL = "https://storage.googleapis.com/generativeai-downloads/data/State_of_the_Union_Address_30_January_1961.mp3" # Upload the audio file to the GenAI File API uploaded_file = client.files.upload(file='sample.mp3') prompt = 'Generate a transcript of the audio.' response = client.models.generate_content( model="gemini-3.1-flash-lite", contents=[prompt, uploaded_file] ) print(response.text)المهام البسيطة المستندة إلى الوكلاء واستخراج البيانات: استخراج الكيانات وتصنيفها، ومسارات معالجة البيانات البسيطة المتوافقة مع مخرجات JSON المنظَّمة. على سبيل المثال، استخراج البيانات المنظَّمة من مراجعة عميل في التجارة الإلكترونية:
from google import genai from pydantic import BaseModel, Field client = genai.Client() prompt = "Analyze the user review and determine the aspect, sentiment score, summary quote, and return risk" input_text = "The boots look amazing and the leather is high quality, but they run way too small. I'm sending them back." class ReviewAnalysis(BaseModel): aspect: str = Field(description="The feature mentioned (e.g., Price, Comfort, Style, Shipping)") summary_quote: str = Field(description="The specific phrase from the review about this aspect") sentiment_score: int = Field(description="1 to 5 (1=worst, 5=best)") is_return_risk: bool = Field(description="True if the user mentions returning the item") response = client.models.generate_content( model="gemini-3.1-flash-lite", contents=[prompt, input_text], config={ "response_mime_type": "application/json", "response_json_schema": ReviewAnalysis.model_json_schema(), }, ) print(response.text)معالجة المستندات وتلخيصها: يمكنك تحليل ملفات PDF والحصول على ملخّصات موجزة، مثل إنشاء مسار لمعالجة المستندات أو فرز الملفات الواردة بسرعة:
from google import genai from google.genai import types import httpx client = genai.Client() # Download a sample PDF document doc_url = "https://storage.googleapis.com/generativeai-downloads/data/med_gemini.pdf" doc_data = httpx.get(doc_url).content prompt = "Summarize this document" response = client.models.generate_content( model="gemini-3.1-flash-lite", contents=[ types.Part.from_bytes( data=doc_data, mime_type='application/pdf', ), prompt ] ) print(response.text)توجيه النماذج: يمكنك استخدام نموذج منخفض التكلفة وزمن الاستجابة كمصنِّف يوجّه الطلبات إلى النموذج المناسب استنادًا إلى مدى تعقيد المهمة. هذا نمط حقيقي في الإنتاج، إذ تستخدم واجهة سطر الأوامر Gemini CLI المفتوحة المصدر نموذج Flash-Lite لتصنيف مدى تعقيد المهام وتوجيهها إلى Flash أو Pro وفقًا لذلك.
from google import genai client = genai.Client() FLASH_MODEL = 'flash' PRO_MODEL = 'pro' CLASSIFIER_SYSTEM_PROMPT = f""" You are a specialized Task Routing AI. Your sole function is to analyze the user's request and classify its complexity. Choose between `{FLASH_MODEL}` (SIMPLE) or `{PRO_MODEL}` (COMPLEX). 1. `{FLASH_MODEL}`: A fast, efficient model for simple, well-defined tasks. 2. `{PRO_MODEL}`: A powerful, advanced model for complex, open-ended, or multi-step tasks. A task is COMPLEX if it meets ONE OR MORE of the following criteria: 1. High Operational Complexity (Est. 4+ Steps/Tool Calls) 2. Strategic Planning and Conceptual Design 3. High Ambiguity or Large Scope 4. Deep Debugging and Root Cause Analysis A task is SIMPLE if it is highly specific, bounded, and has Low Operational Complexity (Est. 1-3 tool calls). """ user_input = "I'm getting an error 'Cannot read property 'map' of undefined' when I click the save button. Can you fix it?" response_schema = { "type": "object", "properties": { "reasoning": { "type": "string", "description": "A brief, step-by-step explanation for the model choice, referencing the rubric." }, "model_choice": { "type": "string", "enum": [FLASH_MODEL, PRO_MODEL] } }, "required": ["reasoning", "model_choice"] } response = client.models.generate_content( model="gemini-3.1-flash-lite", contents=user_input, config={ "system_instruction": CLASSIFIER_SYSTEM_PROMPT, "response_mime_type": "application/json", "response_json_schema": response_schema }, ) print(response.text)التفكير: للحصول على دقة أفضل في المهام التي تستفيد من الاستدلال خطوة بخطوة، يمكنك ضبط إعدادات التفكير لكي يخصّص النموذج موارد حوسبة إضافية للاستدلال الداخلي قبل إنتاج الناتج النهائي:
from google import genai from google.genai import types client = genai.Client() response = client.models.generate_content( model="gemini-3.1-flash-lite", contents="How does AI work?", config=types.GenerateContentConfig( thinking_config=types.ThinkingConfig(thinking_level="high") ), ) print(response.text)