golang-examples/example-gpt-3/golang-question.sh

17 lines
444 B
Bash
Executable File

#!/bin/bash -x
OPENAI_API_KEY=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
curl https://api.openai.com/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "text-davinci-003",
"prompt": "In GO, how would I list the available network interfaces?",
"temperature": 0.7,
"max_tokens": 640,
"top_p": 1.0,
"frequency_penalty": 0.0,
"presence_penalty": 0.0
}'