import OpenAI from "openai"
const openai = new OpenAI({
baseURL: "https://api.aiapilab.com/v1",
apiKey: $AIAPILAB_API_KEY
})
async function main() {
const completion = await openai.chat.completions.create({
model: "openai/gpt-4o-2024-11-20",
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What's in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
}
}
]
}
]
})
console.log(completion.choices[0].message)
}
main()
Feature/Aspect | GPT-4o | GPT-4 Turbo | Claude 3 Opus |
---|---|---|---|
Context Length | 128k tokens, allowing for extensive context handling. | 8k or 32k tokens, limiting the context scope. | 8k tokens, limiting the depth of context. |
Response Speed | Average response time of 320 milliseconds, nearly real-time interaction. | Slower response times compared to GPT-4o. | Faster than GPT-4 Turbo, but slower than GPT-4o. |
Language Support | Improved non-English language processing with better tokenization for various languages. | Good multilingual support but not as advanced as GPT-4o. | Strong multilingual capabilities, but lacks some of the enhancements seen in GPT-4o. |
Multimodal Capabilities | Supports text, audio, images, and video inputs; processes them in real-time. | Primarily text-based with limited visual input. | Supports text and images, but lacks audio capabilities. |
Interactive Capabilities | Can understand and respond to interruptions in conversation; adapts to tone and context. | Limited interactive capabilities; less adaptive to user interruptions. | Provides a conversational experience but lacks advanced interrupt handling. |