Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -5,6 +5,7 @@ from dotenv import load_dotenv
5
  import nltk
6
  from nltk.tokenize import sent_tokenize
7
  import pandas as pd
 
8
 
9
  # Initialize NLTK
10
  nltk.download('punkt', quiet=True)
@@ -30,13 +31,13 @@ class CodeCopilot:
30
  try:
31
  # Correct API endpoint based on Blackbox documentation
32
  response = requests.post(
33
- "https://developer.blackbox.ai/api/v1/chat/completions",
34
  headers=headers,
35
  json={
36
  "messages": [{"role": "user", "content": prompt}],
37
  "max_tokens": max_tokens,
38
  "temperature": temperature,
39
- "model": "blackbox-code"
40
  },
41
  timeout=30
42
  )
@@ -144,4 +145,4 @@ with gr.Blocks(theme=gr.themes.Soft(), title="AI Code Copilot") as demo:
144
  )
145
 
146
  if __name__ == "__main__":
147
- demo.launch()
 
5
  import nltk
6
  from nltk.tokenize import sent_tokenize
7
  import pandas as pd
8
+ import json
9
 
10
  # Initialize NLTK
11
  nltk.download('punkt', quiet=True)
 
31
  try:
32
  # Correct API endpoint based on Blackbox documentation
33
  response = requests.post(
34
+ "https://api.blackbox.ai/chat/completions",
35
  headers=headers,
36
  json={
37
  "messages": [{"role": "user", "content": prompt}],
38
  "max_tokens": max_tokens,
39
  "temperature": temperature,
40
+ "model": "blackboxai/openai/gpt-4"
41
  },
42
  timeout=30
43
  )
 
145
  )
146
 
147
  if __name__ == "__main__":
148
+ demo.launch()