Yaswanth56 commited on
Commit
918b89d
·
verified ·
1 Parent(s): 05e53ee

Update api_utils.py

Browse files
Files changed (1) hide show
  1. api_utils.py +4 -3
api_utils.py CHANGED
@@ -1,17 +1,18 @@
1
  import requests
2
 
3
- api_key = "your_valid_openai_api_key_here" # Replace with your OpenAI API key (e.g., sk-...)
4
 
5
  def call_api(prompt: str) -> str:
6
  """
7
- Call the OpenAI API with the given prompt and return the response.
 
8
  """
9
  headers = {
10
  'Authorization': f'Bearer {api_key}',
11
  'Content-Type': 'application/json'
12
  }
13
  payload = {
14
- 'model': 'gpt-3.5-turbo',
15
  'messages': [{'role': 'user', 'content': prompt}],
16
  'max_tokens': 500
17
  }
 
1
  import requests
2
 
3
+ api_key = "sw-xyz1234567891213" # Replace with your actual API key
4
 
5
  def call_api(prompt: str) -> str:
6
  """
7
+ Call an API with the given prompt and return the response.
8
+ Note: This assumes a generic API endpoint. Adjust the URL and payload based on your API.
9
  """
10
  headers = {
11
  'Authorization': f'Bearer {api_key}',
12
  'Content-Type': 'application/json'
13
  }
14
  payload = {
15
+ 'model': 'gpt-3.5-turbo', # Adjust model based on your API
16
  'messages': [{'role': 'user', 'content': prompt}],
17
  'max_tokens': 500
18
  }