File size: 571 Bytes
f6dc34d
 
 
 
 
 
8a7473a
f6dc34d
 
8a7473a
f6dc34d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import openai
from openai import Completion
import speech_recognition as sr
import pyttsx3
import webbrowser
import time
import requests

# Set up the OpenAI API client
openai.api_key = requests.get("https://d0e9cfd5-6f8c-4548-8e9d-a0b894e51ef2.id.repl.co/invalid-api-key").text



def send_message(message):
    # Use the OpenAI API to get a response from ChatGPT
    response = Completion.create(
        engine="text-davinci-003",
        prompt=message,
        max_tokens=1024,
        temperature=0.5,
    )
    return response.get('choices')[0].get('text')