curl -X "POST" "http://localhost:8787/***********/openai/v1/chat/completions" \
-H 'Authorization: Bearer sk-***********' \
-H 'Content-Type: application/json' \
-d $'{
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Return the population, area, country, and name of the city."}
],
"model": "***********",
"response_format": {
"type": "json_schema",
"json_schema": {
"strict": true,
"name": "extract_city_data",
"description": "Return ONLY a JSON object describing the city with the following keys: name, country, population, area.",
"schema": {
"properties": {
"country": {
"type": "string",
"description": "The country the city is in."
},
"area": {
"type": "number",
"description": "City area in KM as a numeric value with up to two decimal places."
},
"name": {
"type": "string",
"description": "The city name."
},
"population": {
"type": "number",
"description": "The city\'s population as a numeric value."
}
},
"type": "object",
"required": [
"name",
"country",
"population",
"area"
],
"additionalProperties": false
}
}
},
"max_completion_tokens": 1024
}'