#Is ChatGPT 4o or o1 trained on old API documentation?
1 messages · Page 1 of 1 (latest)
Hi @neon owl. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
The GPT-4o and o1 models are not specifically trained on API documentation. They are trained on a diverse range of internet text. However, they do not know specifics about which documents were in their training set or have access to any proprietary, confidential, or classified information.
The openai.ChatCompletion.create method you're trying to use is no longer supported in the OpenAI Python library version 1.0.0 and above. This is likely why you're encountering issues. Instead, you should use the client.chat.completions.create method. Here's an example of how to use it:
from openai import OpenAI
import os
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY", "<your OpenAI API key if not set as env var>"))
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": "Your prompt here"}
]
)
print(response.choices[0].message.content)
You can find more information about this in the OpenAI API documentation (https://platform.openai.com/docs/api-reference/introduction) and the OpenAI Python library GitHub repository (https://github.com/openai/openai-python).
Sources:
- Community Post (https://community.openai.com/t/926301)
- GitHub Issue (https://github.com/openai/openai-python/issues/1622)
- Examples (https://cookbook.openai.com/examples/how_to_format_inputs_to_chatgpt_models)