Skip to main content
Loading navigation
Back to prompt library

Create OpenAI Agents SDK Hardware Telemetry Agent

Linked challenge: OpenAI Agents SDK Hardware Telemetry & Energy Attribution System

Prompt source

implementation12 lines4 sectionsNo variables0 checklist items
from openai import OpenAI

client = OpenAI()

# Define function tools for Prometheus query and NVML telemetry parsing
tools = [{
    'type': 'function',
    'function': {
        'name': 'query_hardware_metrics',
        'description': 'Extract power (W) and energy (J) counters for specified GPU device IDs',
        'parameters': {'type': 'object', 'properties': {'gpu_id': {'type': 'string'}}}
    }
}]

# Implement agent response parsing for tenant energy attribution