assafelovic / gpt-researcher

GPT based autonomous agent that does online comprehensive research on any given topic
https://gptr.dev
MIT License
13.01k stars 1.61k forks source link

Error choosing agent: Unknown encoding o200k_base. Plugins found: ['tiktoken_ext.openai_public'] #560

Closed mesbahkhan closed 1 month ago

mesbahkhan commented 1 month ago

I am getting the following error when running the basic example code from https://docs.gptr.dev/docs/examples/examples

.🔎 Starting the research task for 'What happened in the latest burning man floods?'... Error choosing agent: Unknown encoding o200k_base. Plugins found: ['tiktoken_ext.openai_public']

File "D:\S\python\ai_services\Lib\site-packages\gpt_researcher\master\agent.py", line 96, in conduct_research context = await self.__get_context_by_search(self.query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\S\python\ai_services\Lib\site-packages\gpt_researcher\master\agent.py", line 177, in __get_context_by_search sub_queries = await get_sub_queries(query=query, agent_role_prompt=self.role, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\S\python\ai_services\Lib\site-packages\gpt_researcher\master\actions.py", line 99, in get_sub_queries response = await create_chat_completion( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\S\python\ai_services\Lib\site-packages\gpt_researcher\utils\llm.py", line 102, in create_chat_completion llm_costs = estimate_llm_cost(str(messages), response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\S\python\ai_services\Lib\site-packages\gpt_researcher\utils\costs.py", line 13, in estimate_llm_cost encoding = tiktoken.get_encoding(ENCODING_MODEL) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\S\python\ai_services\Lib\site-packages\tiktoken\registry.py", line 68, in get_encoding raise ValueError( ValueError: Unknown encoding o200k_base. Plugins found: ['tiktoken_ext.openai_public']

assafelovic commented 1 month ago

Do you have tiktoken installed to latest version? pip install tiktoken -U

mesbahkhan commented 1 month ago

Yes that did the trick, thanks @assafelovic