Skip to content

Commit

Permalink
Support images in example app
Browse files Browse the repository at this point in the history
  • Loading branch information
konrad-czarnota-ds committed Oct 21, 2024
1 parent 651a567 commit d52de07
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions examples/apps/documents_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from ragbits.core.vector_store.chromadb_store import ChromaDBStore
from ragbits.document_search import DocumentSearch
from ragbits.document_search.documents.document import DocumentMeta
from ragbits.document_search.documents.element import TextElement


class QueryWithContext(BaseModel):
Expand Down Expand Up @@ -124,9 +123,7 @@ async def _handle_message(
if not self._documents_ingested:
yield self.NO_DOCUMENTS_INGESTED_MESSAGE
results = await self.document_search.search(message[-1])
prompt = RAGPrompt(
QueryWithContext(query=message, context=[i.content for i in results if isinstance(i, TextElement)])
)
prompt = RAGPrompt(QueryWithContext(query=message, context=[i.get_key() for i in results]))
response = await self._llm.generate(prompt)
yield response.answer

Expand Down

0 comments on commit d52de07

Please sign in to comment.