response = openai.Completion.create(
model="gpt-4", # or another GPT-4 model name if updated
prompt="Hi How are you?",
max_tokens=50 # Adjust based on how much completion you expect
)
Error Message:
An error occurred: This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?
I have an AI to answer this kind of question also…
from openai import OpenAI
def get_chat_completion():
"""
Fetch a chat completion using the latest method from OpenAI's API.
Returns:
None: Prints the chat completion response.
"""
# Initialize the OpenAI client
client = OpenAI()
# Create a chat completion with specific messages
completion = client.chat.completions.create(
model="gpt-4", # Specify the model, use the latest version available
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hi How are you?!"}
],
max_tokens=50,
)
# Accessing the first message in the response and printing it
print(completion.choices[0].message.content)
# Example usage
get_chat_completion()
You must update the openai module that you have installed if you want to follow along with any API reference documentation that you will find in the sidebar of the forum.
In your OS, using an administrator/root account if Python is a system-wide installation:
pip install --upgrade openai
0.28.1 was the last version to support the methods you demonstrate (and that a normal AI might answer about because of its old knowledge).
UH OH! is the prompt too tight? That is totally written by Human.
prompt : Is the following text written by a human? Respond with ‘True’ if it is written by a human, otherwise respond with ‘False’. : 56454315613.21312215512.1231561561231223.1532156235165454
There is no reliable detection of AI-written text. Certainly not just by asking “did you write this?” to an AI.
OpenAI models have even had what are called “echo logprobs” disabled so that one couldn’t run statistical analysis on the perplexity of an input.
You can see how much an AI wants to improve language by “proofread this text and correct any errors”. Most botspam posted to this forum has no suggestions by the AI because it was already written by an AI. That is also going to be a land of foibles and career-ending disgrace.
I was thinking of building a replacement of the reCaptcha system that prevents website from bots. I thought why not use AI to detect whether a given input is written by a human or not, that in theory should serve the purpose. Looks like it cant.