input: Write a function to predict sentiment using an external API.
  assert predict_sentiment("I love this!")['sentiment'] == 'positive'
  assert predict_sentiment("I hate this!")['sentiment'] == 'negative'
  assert predict_sentiment("It's okay.")['sentiment'] == 'neutral'
output: def predict_sentiment(text):
      import requests
  
      url = 'https://api.example.com/sentiment'  # Example API endpoint
      payload = {'text': text}
      headers = {'Content-Type': 'application/json'}
  
      response = requests.post(url, json=payload, headers=headers)
      response_data = response.json()
  
      return response_data