diff --git a/chatbotcore/contextual_chunks.py b/chatbotcore/contextual_chunks.py index 2c50555..07a7130 100644 --- a/chatbotcore/contextual_chunks.py +++ b/chatbotcore/contextual_chunks.py @@ -92,7 +92,9 @@ def generate_contextualized_chunks(self, document: str, chunks: List[Document]): contextualized_chunks = [] for chunk in chunks: context = self._generate_context(document, chunk.page_content) - context = getattr(context, "content") # note: required when openai is used + + if self.model_type == LLMType.OPENAI: + context = getattr(context, "content")# note: required when openai is used # Strip both context and chunk content of leading/trailing spaces context = context.strip()