pm4py / pm4py-core

Public repository for the PM4Py (Process Mining for Python) project.
https://pm4py.fit.fraunhofer.de
GNU Affero General Public License v3.0
739 stars 287 forks source link

pm4py.llm.openai_query() does not work #461

Closed juancolonna closed 10 months ago

juancolonna commented 11 months ago

Hello pm4py community, I recently tried the pm4py.llm.openai_query() method as stated in the documentation:

        import pm4py
        resp = pm4py.llm.openai_query('what is the result of 3+3?', api_key="sk-382393", openai_model="gpt-3.5-turbo")
        print(resp)

And I got this answer:

**APIRemovedInV1:

You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.

You can run openai migrate to automatically upgrade your codebase to use the 1.0.0 interface.

Alternatively, you can pin your installation to the old version, e.g. pip install openai==0.28

A detailed migration guide is available here: https://github.com/openai/openai-python/discussions/742**

It appears to be due to an update in the OpenAI API. I would really appreciate if anyone can help resolve this. Thanks

fit-alessandro-berti commented 11 months ago

Dear @juancolonna

We are aware of the problem and already implemented a solution, which will be released in our next release.

Thanks for signaling

Cheers