-1

I am working on an OpenAI API application using Chainlit for a website but when I run my command

chainlit run main.py

The server runs but there are errors or some warnings like this

E0828 02:21:10.694000000 20136 src/core/tsi/ssl_transport_security.cc:1446] Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.

I seem to understand it is causing because of some error while connecting to the server and client but did not understand how to fix them.

I have tried searching about this but didn't find any clue. This is the code block

import chainlit as cl
import openai
import os

os.environ['openAi_API_KEY'] = 'API-kEY'
openai.api_key = 'API_KEY'
#pass the message into chatgpt api, send() the answer

#return everything that the user inputs
@cl.on_message
async def main(message : str):
    response = openai.ChatCompletion.create(
        model = 'gpt-3.5-turbo',
        messages = [
            {"role":"assistant","content":"you are a form taker assistant, you ask questions to the user their name,email and phone number"},
            {"role":"user","content":message}
        ],
        temprature = 1
    )   
    await cl.Message(content=str(response)).send()

 

0 Answers0