Open n-10-v opened 2 weeks ago
635
chatgpttelegrambot-chatgpt-telegram-bot-1 | create() got an unexpected keyword argument 'max_completion_tokens'
chatgpttelegrambot-chatgpt-telegram-bot-1 | Traceback (most recent call last):
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/app/bot/openai_helper.py", line 279, in common_get_chat_response
chatgpttelegrambot-chatgpt-telegram-bot-1 | return await self.client.chat.completions.create(*common_args)
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/usr/local/lib/python3.9/site-packages/openai/_utils/_utils.py", line 277, in wrapper
chatgpttelegrambot-chatgpt-telegram-bot-1 | return func(args, **kwargs)
chatgpttelegrambot-chatgpt-telegram-bot-1 | TypeError: create() got an unexpected keyword argument 'max_completion_tokens'
chatgpttelegrambot-chatgpt-telegram-bot-1 |
chatgpttelegrambot-chatgpt-telegram-bot-1 | The above exception was the direct cause of the following exception:
chatgpttelegrambot-chatgpt-telegram-bot-1 |
chatgpttelegrambot-chatgpt-telegram-bot-1 | Traceback (most recent call last):
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/app/bot/telegram_bot.py", line 798, in prompt
chatgpttelegrambot-chatgpt-telegram-bot-1 | await wrap_with_indicator(update, context, _reply, constants.ChatAction.TYPING)
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/app/bot/utils.py", line 100, in wrap_with_indicator
chatgpttelegrambot-chatgpt-telegram-bot-1 | await asyncio.wait_for(asyncio.shield(task), 4.5)
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/usr/local/lib/python3.9/asyncio/tasks.py", line 479, in wait_for
chatgpttelegrambot-chatgpt-telegram-bot-1 | return fut.result()
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/usr/local/lib/python3.9/site-packages/telegram/ext/_application.py", line 1184, in __create_task_callback
chatgpttelegrambot-chatgpt-telegram-bot-1 | raise exception
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/usr/local/lib/python3.9/site-packages/telegram/ext/_application.py", line 1161, in create_task_callback
chatgpttelegrambot-chatgpt-telegram-bot-1 | return await coroutine # type: ignore[misc]
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/app/bot/telegram_bot.py", line 770, in _reply
chatgpttelegrambot-chatgpt-telegram-bot-1 | response, total_tokens = await self.openai.get_chat_response(chat_id=chat_id, query=prompt)
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/app/bot/openai_helper.py", line 142, in get_chat_response
chatgpttelegrambot-chatgpt-telegram-bot-1 | response = await self.common_get_chat_response(chat_id, query)
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/usr/local/lib/python3.9/site-packages/tenacity/_asyncio.py", line 142, in async_wrapped
chatgpttelegrambot-chatgpt-telegram-bot-1 | return await fn(*args, *kwargs)
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/usr/local/lib/python3.9/site-packages/tenacity/_asyncio.py", line 58, in call
chatgpttelegrambot-chatgpt-telegram-bot-1 | do = await self.iter(retry_state=retry_state)
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/usr/local/lib/python3.9/site-packages/tenacity/_asyncio.py", line 110, in iter
chatgpttelegrambot-chatgpt-telegram-bot-1 | result = await action(retry_state)
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/usr/local/lib/python3.9/site-packages/tenacity/_asyncio.py", line 78, in inner
chatgpttelegrambot-chatgpt-telegram-bot-1 | return fn(args, **kwargs)
chatgpttelegrambot-chatgpt-telegram-bot-1 | File "/usr/local/lib/python3.9/site-packages/tenacity/init.py", line 390, in
@rainbowjose Try updating openai pip package
Does anyone have a workaround to add the new o1 model?