n8n icon indicating copy to clipboard operation
n8n copied to clipboard

OpenAI Assistant & gpt4-o

Open mbakgun opened this issue 9 months ago • 9 comments

Bug Description

I'm getting an error while requesting the OpenAI Assistant using the gpt-4o model as an assistant with APIv1, because gpt-4o cannot be used with the APIv1 schema.

Problem in node ‘OpenAI Assistant‘ 400 The requested model 'gpt-4o' cannot be used with the Assistants API in v1. Follow the migration guide to upgrade to v2: https://platform.openai.com/docs/assistants/migration.

To Reproduce

To reproduce this problem you can use this public example: https://n8n.io/workflows/2098-chat-with-openai-assistant-by-adding-a-memory/

And please update your model as below :

Screenshot 2024-05-14 at 6 12 45 PM

Expected behavior

The expected behavior is a working assistant.

Operating System

Ubuntu Linux 22.04

n8n Version

1.39.4

Node.js Version

18.16.0

Database

MySQL

Execution mode

main (default)

mbakgun avatar May 14 '24 16:05 mbakgun

Hey @mbakgun,

Using the example provided with a GPT4-O model it appears to be working as expected, Looking at your screenshot though rather than using an existing assistant are you trying to make a new one?

I have also tried this and for me it is working in 1.41.0, Are you able to provide an example that reproduces this?

Joffcom avatar May 15 '24 06:05 Joffcom

Hi @Joffcom, I'm trying to create a new assistant, you can find the whole settings. Screenshot 2024-05-15 at 8 39 34 AM

https://github.com/n8n-io/n8n/assets/8726393/9d7ab7ae-fd14-4ae1-b288-1b3f4051f6b9

mbakgun avatar May 15 '24 06:05 mbakgun

Hey @mbakgun,

Even following that I am not able to reproduce the issue, Is your OpenAI account fairly new? We are going to need to update the node so I have created NODE-1350 as the dev ticket to get this updated.

Joffcom avatar May 15 '24 09:05 Joffcom

Nope @Joffcom, I've been around for more than 2 years. I believe @OlegIvaniv's pr addresses the required changes. I'll update here as soon as I get that update.

mbakgun avatar May 15 '24 11:05 mbakgun

@mbakgun it does indeed, We were chatting about it internally. It is mix of old node and newer n8n version.

Joffcom avatar May 15 '24 12:05 Joffcom

Alright, thanks :) I'm looking forward to test it

Edit : With the version of 1.41.0, it worked well 🚀

mbakgun avatar May 15 '24 14:05 mbakgun

Opening until the PR is merged and released 🙂

Joffcom avatar May 15 '24 20:05 Joffcom

This is working fine. I have tested it. The only thing that it is still a bug is that every message sent via chat, ends up creating a new Thread. But this is a separate bug

gvargas9 avatar May 16 '24 18:05 gvargas9

Fix got released with [email protected]

janober avatar May 22 '24 16:05 janober