gemini
Google Gemini API: multimodal, long context (1M tokens), function calling, grounding, code execution
What this skill does
## gemini
### Purpose
This skill interfaces with the Google Gemini API to enable advanced AI interactions, focusing on multimodal inputs, extended context handling, and integrated features like function calling and code execution. Use it to extend OpenClaw's capabilities for complex tasks requiring large-scale context or multimedia processing.
### When to Use
Use this skill for tasks involving long-form conversations (up to 1M tokens), multimodal data (e.g., text + images), or dynamic function calls. Ideal for code generation, data grounding, or API-based workflows in applications like chatbots, content analysis, or automated scripting. Avoid it for simple text-only tasks where lighter models suffice.
### Key Capabilities
- Multimodal support: Process text, images, and audio via the Gemini API; e.g., send an image URL with text for analysis.
- Long context: Handle up to 1M tokens for extended conversations; specify context in requests to maintain state.
- Function calling: Define and call external functions dynamically; use the API's tools parameter to specify functions.
- Grounding: Integrate real-time data fetching for accurate responses; enable via the grounding config in requests.
- Code execution: Generate and execute code snippets; ensure safe execution by wrapping in try-catch blocks.
- API endpoints: Primary endpoint is `https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent` for text generation.
### Usage Patterns
To use this skill, first set the API key via environment variable (`export GEMINI_API_KEY=your_key`). Then, invoke it in OpenClaw by referencing the skill ID ("gemini") in your agent prompt. For API calls, structure requests as JSON payloads with authentication in the header. Pattern: Load the skill, prepare input data (e.g., multimodal array), send the request, and parse the response. Always check for rate limits by monitoring API responses. For repeated use, cache responses or use streaming for long contexts.
### Common Commands/API
- API Request: Use HTTP POST to `https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent` with header `Authorization: Bearer $GEMINI_API_KEY`.
- Example CLI via curl: `curl -X POST -H "Authorization: Bearer $GEMINI_API_KEY" -H "Content-Type: application/json" -d '{"contents": [{"parts": [{"text": "Hello"}]}]}' https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent`
- Function Calling: In payload, add `"tools": [{"functionDeclarations": [...]}]` to define functions; call with `"parts": [{"functionCall": {"name": "functionName", "args": {}}}]`.
- Code Snippet for Python integration:
```
import requests
response = requests.post('https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent', headers={'Authorization': f'Bearer {os.environ["GEMINI_API_KEY"]}'}, json={'contents': [{'parts': [{'text': 'Generate code for a simple server'}]}]})
print(response.json())
```
- Config Format: Use JSON for requests, e.g., `{"contents": [{"parts": [{"text": "Prompt"}, {"inlineData": {"mimeType": "image/jpeg", "data": "base64encodedimage"}}]}]` for multimodal.
### Integration Notes
Integrate by loading the skill in OpenClaw with `skill load gemini`. Authentication requires setting `$GEMINI_API_KEY` as an environment variable; do not hardcode keys. For cluster integration (e.g., "community"), reference via OpenClaw's graph: `skill link gemini to other_skill`. Handle multimodal inputs by encoding files (e.g., base64 for images) and including in the "parts" array. Test locally with the Google AI SDK if available, but use direct API calls for production. Ensure your OpenClaw agent has network access for outbound requests.
### Error Handling
Check HTTP status codes: 401 for auth issues (verify `$GEMINI_API_KEY`), 429 for rate limits (add retry logic with exponential backoff). Parse API errors from the response body, e.g., if "code" is 4, handle invalid input by validating prompts before sending. In code, wrap calls like:
```
try:
response = requests.post(...) # API call
if response.status_code != 200:
raise Exception(response.json()['error']['message'])
except Exception as e:
print(f"Error: {e} - Retrying in 5 seconds")
time.sleep(5)
```
Always log errors with context (e.g., prompt details) for debugging. For Gemini-specific errors, refer to Google's API docs for codes like "INVALID_ARGUMENT".
### Graph Relationships
- Related to: "google" (shares API ecosystem), "ai" (common AI capabilities), "multimodal" (overlaps with vision/image skills).
- Connected via: "community" cluster (links to other community skills like openai for comparative use).
- Dependencies: Requires external API access; no direct skill dependencies in OpenClaw graph.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.