How can I create python script to connect with my custom chatgpt

Hi,

Now, I can connect to Chatgpt with default model with python script.

STANDARD_MODEL_NAME = "gpt-3.5-turbo"
response = openai_client.chat.completions.create(model=STANDARD_MODEL_NAME,messages=[{"role": "user", "content": user_message}])
        await message.channel.send(response.choices[0].message.content)

How can I connect with my own custom Chatgpt “hxxps://chat[.]openai[.]com/g/g-xxxxxxxx”?

I think you are asking how to use a custom GPT in your IDE, or outside of the ChatGPT interface. This is not possible, but you could create an assistant with the same prompt and knowledge files.

Do you have a tutorial about ‘python connect to ChatGPT assistance’ ?

In addition to the Documentation and API reference there is the cookbook: https://cookbook.openai.com/.
I presume there are good tutorials on YouTube but I don’t use them. Maybe others can recommend.

Thanks. Now I can connect with Assistant’s Thread.

1 Like