Skip to content

Commit

Permalink
Checker for ollama and openai added
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeshit committed Jan 10, 2025
1 parent e066f2c commit dcb5697
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chatbotcore/contextual_chunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dcb5697

Please sign in to comment.