Open nazkhan-8451 opened 1 year ago
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
This is also happening for OpenAI Api Key also.
Getting this error for gpt-4.