gemini-interactions-api
ما الذي تفعله
ترشد هذه المهارة المطورين الذين يستخدمون Interactions API الحافظة للحالة من Google، حيث تحفظ المنصة المحادثة عنهم. وهي مخصصة للفرق التي تبني محادثات متعددة الخطوات وأبحاثًا خلفية.
متى تستخدمها
- ✓عندما تريد تشغيل محادثة متعددة الأدوار تحتفظ فيها المنصة بالسجل.
- ✓عندما تحتاج إلى مهام بحث خلفية أو ردود متدفقة من Gemini.
- ✓عندما تريد مخرجات منظمة أو استدعاء دوال عبر Interactions API.
رابط المهارة
https://github.com/google/skills/blob/main/skills/cloud/gemini-interactions-api/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“ابنِ محادثة مع Gemini على Google Cloud تتذكر الرسائل السابقة، وتستطيع تشغيل مهمة بحث في الخلفية.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تشرح كيفية المصادقة والاتصال واستخدام Interactions API مع Google Gen AI SDK. وتوصي بأحدث نماذج Gemini وتحذّر من الحزم القديمة غير المدعومة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Gemini Interactions API Skill
This skill provides instructions for authenticating, connecting to, and utilizing the stateful, server-managed Gemini Interactions API on Gemini Enterprise Agent Platform.
The Interactions API is the modern, recommended way to execute Generative AI agent conversations, background research tasks, multi-turn chats, and structured, multi-step workflows.
[!IMPORTANT] CRITICAL: Unified SDK, Latest Models & Model/Agent Targeting * Unified SDK: Use the Google Gen AI SDK (
google-genai >= 2.3.0for Python,@google/genai >= 2.3.0for JS/TS). SDK versions>= 2.0.0are the minimum floor at which the steps schema activates, but>= 2.3.0is the supported/recommended floor. Legacy SDKs likegoogle-cloud-aiplatform,@google-cloud/vertexai,google-generativeai, and@google/generative-aiare strictly unsupported for Interactions. * Mandatory Instruction: When explaining client initialization or writing import code, you must explicitly state/warn the user that legacy packages likegoogle-cloud-aiplatformorgoogle-generativeaiare strictly unsupported for interactions. * Latest Models Only: Usegemini-3.8-flash(fast, balanced, multimodal — the recommended default),gemini-3.1-pro-preview(complex reasoning, coding, research), orgemini-3.5-flash-lite(cost-efficient, high-frequency lightweight tasks). Refer to the latest model versions to check for new updates. Legacy models (gemini-3-flash-preview,gemini-2.5-*,gemini-2.0-*,gemini-1.5-*) are deprecated and do not support interactions. * Mandatory Instruction: In any interaction response, you must warn the user that legacy models likegemini-2.5-*,gemini-2.0-*, orgemini-1.5-*are deprecated and unsupported for the Interactions API. If a user asks for a deprecated model, usegemini-3.8-flashinstead and note the substitution. * Model & Agent Targeting: Target foundation models directly usingmodel="gemini-3.8-flash", or target autonomous managed/custom agents (antigravity-preview-05-2026,deep-research-preview-04-2026, or custom agents provisioned viaclient.agents.create()) usingagent="<AGENT_ID>". Managed agents (antigravity-preview-05-2026and custom agents) requireenvironment="remote"to provision a sandbox. * Turn-Scoped Parameters: Parameters liketools,system_instruction, andgeneration_configare turn-scoped. They MUST be passed with each interaction request.
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gemini-interactions-api)"
and append
agent-skills/1.0 (skill:gemini-interactions-api)
to User-Agent headers.
1. Authentication
Before running any code, ensure you are authenticated with Application Default Credentials (ADC) and have the necessary API enabled.
Login:
gcloud auth application-default loginEnable API (if not already enabled):
gcloud services enable aiplatform.googleapis.com
2. Client Initialization
You can initialize the client using environment variables (recommended) or by passing explicit configuration parameters.
Option A: Environment Variables (Recommended)
Configure environment variables to let the SDK automatically resolve settings:
export GOOGLE_GENAI_USE_ENTERPRISE=true
export GOOGLE_CLOUD_PROJECT="your-project-id"
export GOOGLE_CLOUD_LOCATION="global"
Python
from google import genai
# The SDK automatically picks up the environment variables
client = genai.Client()
TypeScript/JavaScript
import { GoogleGenAI } from "@google/genai";
// The SDK automatically picks up the environment variables
const ai = new GoogleGenAI();
Option B: Explicit Inline Parameters
Alternatively, pass configuration values directly inside your code:
Python
from google import genai
import google.auth
_, project_id = google.auth.default()
client = genai.Client(enterprise=True, project=project_id, location="global")
Typ
الأسئلة الشائعة
ما إصدار SDK المطلوب؟
google-genai 2.3.0 أو أحدث لـ Python، و@google/genai 2.3.0 أو أحدث لـ JavaScript.
هل تدعم حزم Vertex القديمة؟
لا. حزم مثل google-cloud-aiplatform غير مدعومة مع Interactions.
هل تدعم البث؟
نعم. تغطي الردود المتدفقة.
التفاصيل
الوصف الأصلي من المؤلف
Guides the usage of Gemini Interactions API on Gemini Enterprise Agent Platform. Use when the user wants to use the stateful, server-managed Interactions API for multi-turn conversations, background execution, streaming, structured output, and function calling on the Agent Platform.
repo: google/skills
الشعبية
- نجوم GitHub
- 22k
- الترتيب
- #10262
- الترخيص
- Apache-2.0
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
finding-google-skills
22kيساعد وكيلك على إيجاد أدلة Google المناسبة لمهمة إعداد، مثل الاستضافة وقواعد البيانات والتخزين وتسجيل الدخول وتقديم نماذج الذكاء الاصطناعي.
gcloud
22kيساعد وكيلك على كتابة أوامر gcloud الخاصة بـ Google Cloud والتحقق منها، والاطلاع على الصيغة الدقيقة قبل تشغيل أي شيء حتى لا يخمّن الخيارات.
google-cloud-recipe-auth
22kيرشد وكيلك خلال هوية Google Cloud والوصول إليها، بما في ذلك طريقة دخول الأشخاص والخدمات والأذونات التي يحصلون عليها.
google-cloud-recipe-onboarding
22kيرشد مطورًا جديدًا خلال الخطوات الأولى في Google Cloud، ويشمل اختيار المشروع وربط الفوترة ونشر أول مورد.
مهارات مشابهة
add-model-provider
394kتتيح لوكيلك ربط مزوّد نموذج ذكاء اصطناعي جديد بـ OpenClaw باستخدام أوامر إعداد آمنة، وإبقاء مفاتيح API خارج النص العادي، وإجراء اختبار حي.
acp-router
394kيساعد وكيلك على إرسال مهمة إلى مساعد برمجة مثل Claude Code أو Cursor عبر OpenClaw، فيعمل العمل داخل تلك الأداة.
browser-automation
394kتعلّم وكيلك التحكم في صفحات الويب خطوة بخطوة، بما في ذلك تسجيل الدخول والتبويبات والتعافي عندما تتوقف الصفحة عن الاستجابة.