| 1234567891011 |
- param(
- [string]$Model = "meta/llama-3.3-70b-instruct",
- [string]$ApiKey = "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",
- [int]$TimeoutSec = 25
- )
- $body = "{`"model`":`"$Model`",`"messages`":[{`"role`":`"user`",`"content`":`"ping`"}],`"max_tokens`":5}"
- $tempPath = "$env:TEMP\nv_test_$($Model -replace '[^a-zA-Z0-9]','_').json"
- Set-Content -Path $tempPath -Value $body -Encoding UTF8
- $result = & curl.exe -s --max-time $TimeoutSec -H "Authorization: Bearer $ApiKey" -H "Content-Type: application/json" -d "@$tempPath" "https://integrate.api.nvidia.com/v1/chat/completions" 2>&1
- Remove-Item $tempPath -ErrorAction SilentlyContinue
- return $result
|