Skip to content

Commit

Permalink
Add debug pts
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Oct 5, 2023
1 parent 4d88a18 commit 2cdbe42
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/neurolibre_celery_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,11 @@ def generate():
gpt_headers = {'Content-Type': 'application/json','Authorization': f"Bearer {token}"}
gpt_payload = {'model':'gpt-3.5-turbo',
"messages": [{"role": "user", "content": gpt_msg}]}
print("Trying openai API")
gpt_response = requests.post('https://api.openai.com/v1/chat/completions',headers=gpt_headers,json=gpt_payload)
completion = json.loads(gpt_response.text)
print(f"{completion}")
print(f"{completion['choices'][0]['message']['content']}")
issue_comment = f":confetti_ball::confetti_ball::confetti_ball: \n {completion['choices'][0]['message']['content']} \n :hibiscus: Take a loot at the [latest version of your NRP]({book_status[0]['book_url']})!"
except:
issue_comment = f":confetti_ball::confetti_ball::confetti_ball: Good news! \n :hibiscus: Take a loot at the [latest version of your NRP]({book_status[0]['book_url']})"
Expand Down

0 comments on commit 2cdbe42

Please sign in to comment.