flurb18 / AgentOoba

An autonomous AI agent extension for Oobabooga's web ui
MIT License
175 stars 13 forks source link

NameError: name 'tool' is not defined #8

Closed DrReVaN closed 1 year ago

DrReVaN commented 1 year ago

Instructions: You have access to the following tool: Tool name: Wikipedia Tool description: A wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, facts, historical events, or other subjects. Input should be a search query. Use the tool to achieve Objective 3 by creating an input for the tool that will help you achieve Objective 3. If no such input is possible, respond with the phrase 'I cannot'. If you are unsure or need clarification or more information, respond with the phrase 'I cannot'.

Format: Respond with the created input for the tool or the phrase 'I cannot' depending on the criteria above and nothing else. Do not ask for clarification.

Assistant:

----------------------OUTPUT----------------------- To achieve Objective 3, I suggest using the following input for the Wikipedia tool: "Popular jokes"

Traceback (most recent call last): File "/home/lukas/.local/lib/python3.10/site-packages/gradio/routes.py", line 395, in run_predict output = await app.get_blocks().process_api( File "/home/lukas/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1193, in process_api result = await self.call_function( File "/home/lukas/.local/lib/python3.10/site-packages/gradio/blocks.py", line 930, in call_function prediction = await anyio.to_thread.run_sync( File "/home/lukas/.local/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/home/lukas/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "/home/lukas/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run result = context.run(func, *args) File "/home/lukas/.local/lib/python3.10/site-packages/gradio/utils.py", line 491, in async_iteration return next(iterator) File "/home/lukas/text-generation-webui/extensions/AgentOoba/script.py", line 482, in mainloop AgentOobaVars["main-objective"].process_current_task() File "/home/lukas/text-generation-webui/extensions/AgentOoba/script.py", line 242, in process_current_task current_task.process_current_task() File "/home/lukas/text-generation-webui/extensions/AgentOoba/script.py", line 228, in process_current_task self.tasks[self.current_task_idx] = Objective( File "/home/lukas/text-generation-webui/extensions/AgentOoba/script.py", line 133, in init tool_found, tool, tool_input = self.assess_tools() File "/home/lukas/text-generation-webui/extensions/AgentOoba/script.py", line 196, in assess_tools return True, tool, response NameError: name 'tool' is not defined

Everything runs smooth until the wikipedia tool is called

flurb18 commented 1 year ago

Should be fixed! sorry moved where tools where

DrReVaN commented 1 year ago

INFO:Running Chroma using direct local API. WARNING:Using embedded DuckDB without persistence: data will be transient INFO:Successfully imported ClickHouse Connect C data optimizations INFO:Successfully import ClickHouse Connect C/Numpy optimizations INFO:Using orjson library for writing JSON byte strings WARNING:No embedding_function provided, using default embedding function: SentenceTransformerEmbeddingFunction INFO:Load pretrained SentenceTransformer: all-MiniLM-L6-v2 INFO:Use pytorch device: cuda Batches:   0%|                                            | 0/1 [00:00 Batches: 100%|████████████████████████████████████| 1/1 [00:00Batches: 100%|████████████████████████████████████| 1/1 [00:00Traceback (most recent call last):   File "/home/lukas/.local/lib/python3.10/site-packages/gradio/routes.py", line 395, in run_predict     output = await app.get_blocks().process_api(   File "/home/lukas/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1193, in process_api     result = await self.call_function(   File "/home/lukas/.local/lib/python3.10/site-packages/gradio/blocks.py", line 930, in call_function     prediction = await anyio.to_thread.run_sync(   File "/home/lukas/.local/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync     return await get_asynclib().run_sync_in_worker_thread(   File "/home/lukas/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread     return await future   File "/home/lukas/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run     result = context.run(func, *args)   File "/home/lukas/.local/lib/python3.10/site-packages/gradio/utils.py", line 491, in async_iteration     return next(iterator)   File "/home/lukas/text-generation-webui/extensions/AgentOoba/script.py", line 490, in mainloop     AgentOobaVars["main-objective"] = Objective(ostr, -1, r, max_t, 1)   File "/home/lukas/text-generation-webui/extensions/AgentOoba/script.py", line 128, in init     self.context = self.generate_context()   File "/home/lukas/text-generation-webui/extensions/AgentOoba/script.py", line 173, in generate_context     response = ooba_call(self.make_prompt(directive, include_objectives=True)).strip()   File "/home/lukas/text-generation-webui/extensions/AgentOoba/script.py", line 155, in make_prompt     directive = "\n".join([line.strip() for line in (directive.split("\n") if "\n" in directive else [directive])])[:CTX_MAX] TypeError: argument of type 'NoneType' is not iterable

Thanks for the quick fix. The tools problem is gone but there is a new error :/

flurb18 commented 1 year ago

weird error... looking into it, its giving a blank response

DrReVaN commented 1 year ago

Nevermind... I'm just a fucking donkey xD i restarted server.py and fucked up the loading of the model

flurb18 commented 1 year ago

O phew. Still a strange error. How does directive end up being None...