Skip to content

Commit

Permalink
Merge pull request #72 from toggle-corp/fix/content_parsing
Browse files Browse the repository at this point in the history
Checker for ollama and openai added
  • Loading branch information
ranjan-stha authored Jan 13, 2025
2 parents e066f2c + 1cab267 commit b832dc4
Show file tree
Hide file tree
Showing 3 changed files with 501 additions and 589 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
- uses: actions/setup-python@main
with:
cache: 'poetry'
- run: poetry install
- run: poetry install --no-root
- uses: pre-commit/action@main

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
Loading

0 comments on commit b832dc4

Please sign in to comment.