Skip to content

Latest commit

 

History

History
52 lines (44 loc) · 1.32 KB

example-13-mood-color.md

File metadata and controls

52 lines (44 loc) · 1.32 KB

Mood to color

Turn a text description into a color.

Example Usage

curl --location --request PUT 'https://api.openai.lawrencemcdaniel.com/examples/default-mood-color' \
--header 'x-api-key: YOUR-API-GATEWAY-KEY' \
--header 'Content-Type: application/json' \
--data '{"Blue sky at dusk."}'

Example results

{
  "isBase64Encoded": false,
  "statusCode": 200,
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "id": "chatcmpl-7yUfR6uI3iC12pDzpJQUWCDujVDMs",
    "object": "chat.completion",
    "created": 1694651921,
    "model": "gpt-3.5-turbo-0613",
    "choices": [
      {
        "index": 0,
        "message": {
          "role": "assistant",
          "content": "{\n  \"css_code\": \"background-color: #24556a;\"\n}"
        },
        "finish_reason": "stop"
      }
    ],
    "usage": {
      "prompt_tokens": 57,
      "completion_tokens": 16,
      "total_tokens": 73
    }
  }
}

Official Documentation

OpenAI Playground