Chuyển đến nội dung
Skillpedia
Prompt và LLM22k · #10203

agent-platform-inference

Skill này làm gì

Skill hướng dẫn cách xác thực và gửi yêu cầu đến Gemini và các mô hình mở của bên thứ ba như Llama hoặc DeepSeek trên Agent Platform. Skill dành cho lập trình viên thử nghiệm hoặc xây dựng với các mô hình này.

Khi nào nên dùng

  • ✓Khi bạn muốn gửi một prompt thử nghiệm đến mô hình Gemini trên Google Cloud.
  • ✓Khi bạn muốn gọi một mô hình mở như Llama hoặc DeepSeek qua Agent Platform.
  • ✓Khi bạn cần mã cho một lệnh chat hoặc completion dùng GenAI SDK hoặc OpenAI SDK.

Liên kết skill

https://github.com/google/skills/blob/main/skills/cloud/agent-platform-inference/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-inference/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Viết mã hỏi một mô hình Gemini trên Agent Platform một câu hỏi và in ra câu trả lời.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill thiết lập xác thực cho đúng SDK, xác định mô hình và dự án, rồi chạy yêu cầu sau khi bạn xác nhận, vì mỗi yêu cầu có thể tốn chi phí và hạn mức.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Agent Platform GenAI Inference Skill

This skill provides instructions for authenticating and connecting to Google Cloud Agent Platform to use Generative AI models. It covers:

  • First-Party publisher models (Gemini) — section 2.
  • Third-Party publisher models (OpenMaaS: Llama, DeepSeek, Qwen, etc.) — section 3.
  • Custom endpoints (any model on a numeric projects/.../endpoints/<id> resource — tuned Gemini models, OSS LLMs self-deployed from Model Garden via the agent-platform-deploy skill, and legacy custom models) — section 4.

Safety & Confirmation Tiers (CRITICAL)

Before executing any commands or scripts on behalf of the user, you must adhere to the following safety tiers based on the action requested. (The skill is read-only; other safety tiers are omitted):

  1. Tier R: Read-only / Inference (client.models.generate_content, client.chat.completions.create, client.completions.create, client.embeddings.create)
    • Requires interactive confirmation with 'Yes'/ 'No' options before executing model inference on behalf of the user, to prevent unexpected cost or quota consumption.
    • Required Fields in Confirmation Card: The confirmation prompt must clearly explain the proposed inference execution and explicitly list all of the following parameters:
      • Project ID: The Google Cloud project ID or number (e.g. 123456789012, my-project).
      • Region / Location: The target region (e.g. us-central1, global).
      • Model ID: The exact model ID (e.g. gemini-2.5-flash, deepseek-ai/deepseek-v3.2-maas).
      • SDK: The SDK choice (e.g. Google GenAI SDK (google-genai), OpenAI SDK).
      • Input Prompt (or Input Image / Input Media): The prompt text or media URI.
      • Any additional generation parameters (e.g. max_output_tokens, response_schema) if specified. Natural-language paraphrases without explicitly listing these parameters are NOT sufficient.
    • Same-turn restriction: Do not execute the inference scripts or commands in the same turn as presenting the confirmation prompt. Stop and wait for the user's reply; only execute after explicit 'Yes' / approval.
    • Gold Standard Example:

      I will perform model inference with the following parameters. Please confirm this information before I proceed:

      • Project ID: my-project
      • Region: us-central1
      • Model ID: gemini-2.5-pro
      • SDK: Google GenAI SDK (google-genai)
      • Input Prompt: "Summarize the plot of Hamlet in 3 sentences"

      Do you confirm? [Yes/No]

    • Post-Execution Response Grounding (CRITICAL): After receiving explicit user approval and executing the inference call via the SDK, the response returning the generated text MUST explicitly confirm the execution parameters alongside the model's output. Never return a bare model response alone. Always include:
      • Model ID: The exact model ID used (e.g. gemini-2.5-pro or <MODEL_ID>).
      • SDK: The SDK used (e.g. Google GenAI SDK (google-genai) or OpenAI SDK).
      • Project ID: The Google Cloud project ID/number used.
      • Region: The region or endpoint location used (e.g. global or us-central1).
      • Generated Output: The model's complete generated answer.

Phase 0: Environment Setup

CRITICAL: Before running any of the Python sample scripts in the scripts/ directory (e.g., scripts/openmaas_openai_sdk.py), you MUST ensure the environment is correctly initialized by following these steps:

  1. Google Cloud Authentication: Authenticate with your Google Cloud credentials and configure active Application Default Credentials (ADC) for Agent Platform access:

    gcloud auth login
    gcloud auth application-default login
    
  2. Enable API (if not already enabled):

    gcloud services enable aiplatform.googleapis.com
    
  3. Python Dependencies: The scripts import vertexai (from google-cloud-aiplatform), google-genai, and openai. Do not create a virtual environment — it starts empty

Câu hỏi thường gặp

Skill có chạy yêu cầu mà không hỏi không?

Không. Skill xin xác nhận trước khi suy luận, vì yêu cầu có thể tốn tiền và hạn mức.

Skill có bao gồm mô hình tùy chỉnh không?

Có. Skill bao gồm các endpoint tùy chỉnh, như mô hình đã được tinh chỉnh hoặc tự triển khai.

Skill hỗ trợ những SDK nào?

GenAI SDK, OpenAI SDK và Agent Platform SDK cũ.

Chi tiết

Mô tả gốc của tác giả

Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate code for calling Gemini or OpenMaaS models, authenticate with GenAI SDK, OpenAI SDK, or legacy Agent Platform SDK, configure base URLs and global/regional endpoints, or troubleshoot 429 Resource Exhausted (DSQ), 400 User Validation, or 404 Not Found errors. Don't use for deploying models to endpoints

repo: google/skills

Độ phổ biến

Sao GitHub
22k
Vị trí xếp hạng
#10203
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự