aktonay/skillz / skills/cloud/gemini-api
gemini-api
VerifiedGuides the usage of the Gemini API on Agent Platform with the Google Gen AI SDK. Use when the user asks about using Gemini in an enterprise environment or explicitly mentions Vertex AI, Google Cloud, or Agent Platform. Covers SDK usage (Python, JS/TS, Go, Java, C#), capabilities like Live API, tools, multimedia generation, caching, and batch prediction.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.6 KB |
| references/advanced_features.md | markdown | 4.4 KB |
| references/bounding_box.md | markdown | 1.8 KB |
| references/embeddings.md | markdown | 3.0 KB |
| references/live_api.md | markdown | 1.0 KB |
| references/media_generation.md | markdown | 2.9 KB |
| references/model_tuning.md | markdown | 934 B |
| references/safety.md | markdown | 1.8 KB |
| references/structured_and_tools.md | markdown | 3.7 KB |
| references/text_and_multimodal.md | markdown | 2.3 KB |
references/safety.md
View on GitHub# Safety Settings and Responsible AI
You can adjust safety settings to control the thresholds for harmful content generation. Standard safety filters are applied by default.
## Adjusting Safety Thresholds
```python
from google import genai
from google.genai import types
client = genai.Client()
response = client.models.generate_content(
model="gemini-3-flash-preview",
contents="Write a list of 5 disrespectful things that I might say to the universe after stubbing my toe in the dark.",
config=types.GenerateContentConfig(
system_instruction="Be as mean as possible.",
safety_settings=[
types.SafetySetting(
category=types.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
),
types.SafetySetting(
category=types.HarmCategory.HARM_CATEGORY_HARASSMENT,
threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
),
types.SafetySetting(
category=types.HarmCategory.HARM_CATEGORY_HATE_SPEECH,
threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
),
types.SafetySetting(
category=types.HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
threshold=types.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
),
]
),
)
# Response will be `None` if it is blocked.
if response.text is None:
print(f"Content Blocked. Finish Reason: {response.candidates[0].finish_reason}")
else:
print(response.text)
# Inspect safety ratings for each category
for rating in response.candidates[0].safety_ratings:
print(f'Category: {rating.category}')
print(f'Is Blocked: {rating.blocked}')
print(f'Probability: {rating.probability}')
print(f'Severity: {rating.severity}')
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |