Closed yadavj2008 closed 10 months ago
Hi @yadavj2008, which version of google.generativeai
are you using? I cannot reproduce your issue with google-generativeai==0.3.1
Thanks for the guidance @ShilinHe
The previous error I was getting on google.generative==0.3.2 version, then I downgraded the version to 0.3.1 and getting below error now. please help
[/content/TaskWeaver/taskweaver/session/session.py](https://localhost:8080/#) in send_message(self, message, event_handler, files)
195
196 with self.event_emitter.handle_events_ctx(event_handler):
--> 197 return self._send_text_message(message_prefix + message)
198
199 def _upload_file(self, name: str, path: Optional[str] = None, content: Optional[bytes] = None) -> str:
[/content/TaskWeaver/taskweaver/session/session.py](https://localhost:8080/#) in _send_text_message(self, message)
97 def _send_text_message(self, message: str) -> Round:
98 chat_round = self.memory.create_round(user_query=message)
---> 99 self.event_emitter.start_round(chat_round.id)
100
101 def _send_message(recipient: str, post: Post) -> Post:
[/content/TaskWeaver/taskweaver/module/event_emitter.py](https://localhost:8080/#) in start_round(self, round_id)
229 def start_round(self, round_id: str):
230 self.current_round_id = round_id
--> 231 self.emit(
232 TaskWeaverEvent(
233 EventScope.round,
[/content/TaskWeaver/taskweaver/module/event_emitter.py](https://localhost:8080/#) in emit(self, event)
225 def emit(self, event: TaskWeaverEvent):
226 for handler in self.handlers:
--> 227 handler.handle(event)
228
229 def start_round(self, round_id: str):
AttributeError: 'function' object has no attribute 'handle'
Hi @yadavj2008, I still cannot reproduce your issue. My code is as follows:
from taskweaver.app.app import TaskWeaverApp
# This is the folder that contains the taskweaver_config.json file and not the repo root. Defaults to "./project/"
app_dir = "./project/"
app = TaskWeaverApp(app_dir=app_dir)
session = app.get_session()
user_query = "hello, what can you do?"
response_round = session.send_message(user_query)
print(response_round.to_dict())
The code is same as the one in the documents.
I just put the code in a Jupyter Notebook (in the TaskWeaver
folder, same level as the project
) and install the genmini package via pip install google-generativeai
.
Close as no activity.
Describe the bug I'm trying to run the taskwearver on colab notebook by importing taskweaver as python package, i was able to create the session with Gemini model but when I tried running the prompt I faced below error.
To Reproduce
Expected behavior The prompt should run just fine and able to parse the gemini response.
Environment Information (please complete the following information):
Additional context