go-openai
go-openai copied to clipboard
Add gpt-4o model
gpt-4o now available and would be great to use. https://platform.openai.com/docs/models/gpt-4o
Can we tag the new commit that added the model?
https://github.com/sashabaranov/go-openai/blob/master/completion.go#L25
https://github.com/sashabaranov/go-openai/commit/3b25e09da90715681fe4049955d7c7ce645e218c
Do we need to perform migration too?
https://platform.openai.com/docs/assistants/migration
payload = {
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What’s in this image?"
},
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}"
}
}
]
}
],
"max_tokens": 300
}
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload)
print(response.json())
Do we need to perform migration too?
https://platform.openai.com/docs/assistants/migration
has this migration implemented in the latest version?
I'm trying to use CreateThreadAndRun this function but the ThreadMessage struct has not been updated
type ThreadMessage struct {
Role ThreadMessageRole `json:"role"`
Content string `json:"content"`
FileIDs []string `json:"file_ids,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
I think there should be Attachments field, no?
Wasted an hour or two debugging before I realized the new attachments field still isn't supported yet. I'll see if I can create a PR otherwise I hope someone can get to it soon. Right now it's not possible at all to make a request with files with GPT-4o.
Any update here?
Any update here?
@735
Can I upload pictures and request gpt-4o now?
I switched my model to gpt-4o-mini and got this error:
"message": "Failed to send message to OpenAI: error, status code: 400, message: The requested model 'gpt-4o-mini' cannot be used with the Assistants API in v1. Follow the migration guide to upgrade to v2: https://platform.openai.com/docs/assistants/migration."
any update to switching model to newer version?
With GPT 3.5 being shut down on Sep 14th, it's becoming quite urgent to get Assistants V2 file support into this library.
A friend of mine told me that GPT-4o works, but I can't find anything on this anywhere, does it exist and if not when will support be added as 3.5 doesn't work anymore.