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

GPT-4 Support #132

Open
nazkhan-8451 opened this issue Oct 11, 2023 · 2 comments
Open

GPT-4 Support #132

nazkhan-8451 opened this issue Oct 11, 2023 · 2 comments

Comments

@nazkhan-8451
Copy link

Getting this error for gpt-4.

deployment_id = 'gpt-4' 
with CodeInterpreterSession(deployment_id = deployment_id) as session:
INFO: Using a LocalBox which is not fully isolated
      and not scalable across multiple users.
      Make sure to use a CODEBOX_API_KEY in production.
      Set envar SHOW_INFO=False to not see this again.

AI:  Error in CodeInterpreterSession: InvalidRequestError  - Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>
@nazkhan-8451
Copy link
Author

after setting environment variables correctly and changing deployment name to "gpt-35-turbo-16k"

# # create a session
# with CodeInterpreterSession() as session:
#     # generate a response based on user input
#     response = session.generate_response(
#         "Plot the bitcoin chart of year 2023"
#     )

#     # output the response
#     response.show()

AI:  Error in CodeInterpreterSession: InvalidRequestError  - Unrecognized request argument supplied: functions
from codeinterpreterapi import CodeInterpreterSession

async def main():
    async with CodeInterpreterSession() as session:
        response = await session.agenerate_response(
            "Plot a sin wave and show it to me."
        )
        response.show()


if __name__ == "__main__":
    import asyncio

    asyncio.run(main())


Error message:
RuntimeError                              Traceback (most recent call last)
Cell In[38], line 14
     11 if __name__ == "__main__":
     12     import asyncio
---> 14     asyncio.run(main())

File [~/miniconda3/envs/open-code-interpreter/lib/python3.10/asyncio/runners.py:33](https://file+.vscode-resource.vscode-cdn.net/Users/n940767/Documents/Code-projects/gpt-work/~/miniconda3/envs/open-code-interpreter/lib/python3.10/asyncio/runners.py:33), in run(main, debug)
      9 """Execute the coroutine and return the result.
     10 
     11 This function runs the passed coroutine, taking care of
   (...)
     30     asyncio.run(main())
     31 """
     32 if events._get_running_loop() is not None:
---> 33     raise RuntimeError(
     34         "asyncio.run() cannot be called from a running event loop")
     36 if not coroutines.iscoroutine(main):
     37     raise ValueError("a coroutine was expected, got {!r}".format(main))

RuntimeError: asyncio.run() cannot be called from a running event loop

@nazkhan-8451
Copy link
Author

This is also happening for OpenAI Api Key also.

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

1 participant