Skip to content
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

[Question]: Does file_ids parameter still exist? #13099

Closed
1 task done
dxtym opened this issue Apr 25, 2024 · 4 comments
Closed
1 task done

[Question]: Does file_ids parameter still exist? #13099

dxtym opened this issue Apr 25, 2024 · 4 comments
Labels
question Further information is requested

Comments

@dxtym
Copy link

dxtym commented Apr 25, 2024

Question Validation

  • I have searched both the documentation and discord for an answer.

Question

I'm uploading documents to a QueryEngineTool object and passing that as a tool parameter to OpenAIAssistantAgent. As a result, I'm getting the TypeError: Assistant.create() got an unexpected keyword argument 'file_ids' error. When I looked at the reference of the API, I found out that there was no file_ids argument being passed. Yet, the same implementation was working correctly on Jupyter Notebook (this one's a part of Telegram bot, by the way). I checked the versions for LlamaIndex of both ways and they were the same: 0.10.30. Is that internal thing or something's wrong with my code?

Thank you for your response.

@dxtym dxtym added the question Further information is requested label Apr 25, 2024
Copy link

dosubot bot commented Apr 25, 2024

It looks like the TypeError you're encountering with the file_ids parameter in the OpenAIAssistantAgent class might be due to how the parameter is being passed or a mismatch in the expected data type. The file_ids parameter is indeed part of the API, specifically in the from_new class method of the OpenAIAssistantAgent, where it's optional and expected to be a list of strings. Here's a brief overview of how it's used:

@classmethod
def from_new(
    ...
    file_ids: Optional[List[str]] = None,
    ...
) -> "OpenAIAssistantAgent":

And within the method:

file_dict = _process_files(client, files)
all_file_ids = list(file_dict.keys()) + file_ids

This shows that file_ids is combined with other file IDs, indicating its proper use and recognition within the API. Ensure you're passing file_ids as a list of strings to match the expected format.

The discrepancy you're experiencing between the Jupyter Notebook and the Telegram bot could be due to environmental differences or dependency versions, though without more specific details, pinpointing the exact cause is challenging.

For further assistance, providing more information about your code, the full error message, and details about your setup could be very helpful. This would allow for a more accurate diagnosis and solution.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@RussellLuo
Copy link
Contributor

RussellLuo commented Apr 25, 2024

Hi @dxtym, what's the version of your openapi-python library. AFAIK, this library has changed the parameter file_ids to other names recently, see openai/openai-python#1325.

The official document also renames file_ids to tool_resources, see docs.

@logan-markewich
Copy link
Collaborator

@RussellLuo is correct, the API has changed. Still need to update this class (its somewhere on the TODO list 😓 )

@dxtym
Copy link
Author

dxtym commented Apr 26, 2024

Thank you @RussellLuo @logan-markewich !
Apparently, I was using the older version of the API in my notebook, just downgraded the other one. Now, everything works fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants