-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Azure open AI Assistant throws TypeError: create() got an unexpected keyword argument 'file_ids' #1416
Comments
@Karishma73 the version of the openai library you are using by default supports Assistants v2. Azure OpenAI does not support v2 yet. In the meantime, I recommend downgrading your openai library version to 1.20.0 which still uses the v1. |
thank you @kristapratico, downgrading worked for me. |
@Karishma73 FYI Azure now supports Assistants v2 with |
@kristapratico I am still getting error: B
|
@Karishma73 I'm not able to reproduce this. Did you update your client to target client = AzureOpenAI(
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
api_version="2024-05-01-preview",
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
) |
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
I am working on Azure notebook and while creating Azure Open AI Assistant source1, source2 I am getting
TypeError: create() got an unexpected keyword argument 'file_ids'
, I tried the solution mentioned here even though it is not from AZURE but it gives me different error TypeError: Assistants.create() got an unexpected keyword argument 'attachments', The same code works fine locally without anyTypeError: create() got an unexpected keyword argument 'file_ids'
is there an update for creating assistants api on AZURE notebook(or any other cloud based notebook it is not working on Databricks notebook too , it was working on Databrick notebook few weeks ago) or it is a new bug related to this bug ? I am using gpt-35-turbo-16k-0613 model, openai 1.28.1 version. I am not usingautogen
library.To Reproduce
[details](https://learn.microsoft.com/en-us/answers/questions/1665693/using-azure-open-ai-assistant-throws-typeerror-cre
Run below code in Azure or Databricks notebook to reproduce error
`from openai import AzureOpenAI
client = AzureOpenAI(
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
api_version="2024-02-15-preview",
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
)
Upload a file with an "assistants" purpose
file = client.files.create(
file=open("speech.py", "rb"),
purpose='assistants'
)
Create an assistant using the file ID
assistant = client.beta.assistants.create(
instructions="You are an AI assistant that can write code to help answer math questions.",
model="gpt-4-1106-preview",
tools=[{"type": "code_interpreter"}],
file_ids=[file.id]
)`)
Code snippets
No response
OS
Linux 22.05.09,
Python version
3.8.5
Library version
openai- 1.28.1
The text was updated successfully, but these errors were encountered: