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

Unrecognized request argument supplied: seed #749

Closed
Timmate opened this issue Nov 13, 2023 · 7 comments
Closed

Unrecognized request argument supplied: seed #749

Timmate opened this issue Nov 13, 2023 · 7 comments

Comments

@Timmate
Copy link

Timmate commented Nov 13, 2023

System Info

pandasai v1.4.8, openai v0.27.10, Python 3.10

🐛 Describe the bug

When trying to chat() with a created SmartDataFrame, I'm getting the following error:

'Unfortunately, I was not able to answer your question, because of the following error:\n\nUnrecognized request argument supplied: seed\n'

Apparently, this has to do with v1.4.8 of pandasai and the introduction of the seed param in #742. Obviously, a solution could be simply to downgrade to 1.4.7, but was wondering if there is another way. I'm getting this error for any of the below mentioned Azure OpenAI API versions. @gamcoh, do you have any ideas? Thanks in advance!

Here's the full code:

from pandasai import SmartDataframe
from pandasai.llm import AzureOpenAI

llm = AzureOpenAI(
    deployment_name="gpt35turbotest",
    model_name="gpt-35-turbo",
    api_token=<token>,
    api_base=<azure endpoint>, 
    # api_version="2023-03-15-preview"
    #api_version="2023-07-01-preview"
    api_version="2023-08-01-preview"
)

sdf = SmartDataframe(df, config={"llm": llm})
df.chat(<question>)
@gamcoh
Copy link
Contributor

gamcoh commented Nov 13, 2023

You're right this is a bug, the openai module should have the latest version in order to use the seed param

@Timmate
Copy link
Author

Timmate commented Nov 14, 2023

@gamcoh, got it, thanks for your reply! You mean it's a bug in the current release of 1.4.8? Otherwise, I guess I'm missing something, but how is it expected to work now if the openai version specified in poetry.lock is 0.27.10? Tried upgrading openai to the latest version, but this broke pandasai.

@gamcoh
Copy link
Contributor

gamcoh commented Nov 14, 2023

Yeah same for me, I'm trying to migrate the codebase to openai 1.2.3 but for now I think we need to downgrade

@mspronesti
Copy link
Contributor

#753 introduces support for the newest API (for OpenAI only, no Azure OpenAI yet). Feel free to have a look at it :)

@mspronesti
Copy link
Contributor

mspronesti commented Nov 15, 2023

The newest version supports OpenAI v1 (including Azure OpenAI) and, among the others, seed. Feel free to have a look :)

@gamcoh
Copy link
Contributor

gamcoh commented Nov 15, 2023

Great work @mspronesti thanks!

@Timmate
Copy link
Author

Timmate commented Nov 19, 2023

v1.4.10 (with v1.3.3 of openai) works just fine for me with the above setup (except api_base now is called azure_endpoint) for any of the above Azure OpenAI API versions. Haven't tried setting the seed yet, though -- and, apparently, that's currently impossible with Azure OpenAI, as stated in https://github.com/gventuri/pandas-ai/blob/main/docs/determinism.md.

Closing this as solved anyways.

Many thanks to @mspronesti!

@Timmate Timmate closed this as completed Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants