Skip to content

Commit

Permalink
Add parameters for the new pptx parser (#35)
Browse files Browse the repository at this point in the history
<!-- begin-generated-description -->

This PR introduces a new class, `PresentationParsingStrategy`, which
extends the `StrEnum` class. This class provides two parsing strategies
for presentations: `Unstructured` and `ImageToMarkdown`. The
`Unstructured` strategy is set as the default.

The `ParserConfig` class is also updated to include a new parameter,
`presentation_parsing_strategy`, which is set to the `Unstructured`
strategy by default.

## Changes:
- Added the `PresentationParsingStrategy` class.
- Added the `presentation_parsing_strategy` parameter to the
`ParserConfig` class.

<!-- end-generated-description -->
  • Loading branch information
javier-cohere authored Nov 8, 2024
1 parent 769ddb8 commit 3ac57b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions compass_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,15 @@ def _missing_(cls, value):
return cls.QuickText


class PresentationParsingStrategy(StrEnum):
Unstructured = "Unstructured"
ImageToMarkdown = "ImageToMarkdown"

@classmethod
def _missing_(cls, value):
return cls.Unstructured


class ParserConfig(BaseModel):
"""
CompassParser configuration. Important parameters:
Expand Down Expand Up @@ -319,6 +328,7 @@ class ParserConfig(BaseModel):
horizontal_table_crop_margin: int = 100

pdf_parsing_strategy: PDFParsingStrategy = PDFParsingStrategy.QuickText
presentation_parsing_strategy: PresentationParsingStrategy = PresentationParsingStrategy.Unstructured


### Document indexing
Expand Down

0 comments on commit 3ac57b7

Please sign in to comment.