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: "anthropic/claude-3.5-sonnet",
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 | Gemini Pro 1.5 | Claude 3.5 Sonnet |
---|---|---|---|
Speed | Not specified, but generally slower than Sonnet | Comparable speed, but less efficient in complex tasks | Operates at twice the speed of Claude 3 Opus |
Artifacts Feature | Lacks similar collaborative features | No comparable feature for real-time interaction with outputs | Introduces interactive artifacts for real-time content generation and editing |
Reasoning Ability | High performance, but generally trails Sonnet | Strong, but lacks the same level of advanced reasoning as Sonnet | Outperforms in graduate-level reasoning (64% solved) |
Coding Proficiency | Effective, but performance varies | Competitive, but less consistent in coding tasks | Solves 64% of coding problems, excels in debugging and code generation |
Visual Capabilities | Good, but less effective in visual tasks | Strong, but not as advanced as Sonnet in visual processing | Best in class for visual reasoning, can accurately transcribe from images |