Cinnamon / kotaemon

An open-source RAG-based tool for chatting with your documents.
https://cinnamon.github.io/kotaemon/
Apache License 2.0
17.49k stars 1.35k forks source link

[BUG] Rewoo.py citation error #439

Closed bookandlover closed 3 weeks ago

bookandlover commented 3 weeks ago

Description

AttributeError: 'CiteEvidence' object has no attribute 'answer'

Traceback (most recent call last): File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/gradio/queueing.py", line 575, in process_events response = await route_utils.call_process_api( File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/gradio/route_utils.py", line 276, in call_process_api output = await app.get_blocks().process_api( File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1923, in process_api result = await self.call_function( File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1520, in call_function prediction = await utils.async_iteration(iterator) File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/gradio/utils.py", line 663, in async_iteration return await iterator.anext() File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/gradio/utils.py", line 656, in anext return await anyio.to_thread.run_sync( File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2441, in run_sync_in_worker_thread return await future File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 943, in run result = context.run(func, *args) File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/gradio/utils.py", line 639, in run_sync_iterator_async return next(iterator) File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/gradio/utils.py", line 801, in gen_wrapper response = next(iterator) File "/Users/peng/LLM/kotaemon/libs/ktem/ktem/pages/chat/init.py", line 899, in chat_fn for response in pipeline.stream(chat_input, conversation_id, chat_history): File "/Users/peng/LLM/kotaemon/libs/ktem/ktem/reasoning/rewoo.py", line 381, in stream yield from self.prepare_citation(answer) File "/Users/peng/LLM/kotaemon/libs/ktem/ktem/reasoning/rewoo.py", line 274, in prepare_citation for fact_with_evidence in answer.metadata["citation"].answer: File "/Users/peng/LLM/kotaemon/venv/lib/python3.10/site-packages/pydantic/main.py", line 856, in getattr raise AttributeError(f'{type(self).name!r} object has no attribute {item!r}') AttributeError: 'CiteEvidence' object has no attribute 'answer'

Reproduction steps

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

Browsers

Chrome

OS

MacOS

Additional information

Python==3.10