HowdenParser 2.0.1__tar.gz → 2.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,12 +2,8 @@
2
2
  from typing import Literal
3
3
  from pydantic import BaseModel
4
4
 
5
- class Hest(BaseModel):
6
- provider_and_model: str = "huggingface:trocr-large-printed"
7
-
8
5
 
9
6
  class Parameter(BaseModel):
10
- model1: Hest = Hest()
11
7
  provider_and_model: str = "llamaparser:"
12
8
  result_type: Literal["md"] = "md"
13
9
  mode: bool = False
@@ -144,22 +144,26 @@ class LangChainParser(BaseParser, name="langchain"):
144
144
 
145
145
 
146
146
  class LlamaParser(BaseParser, name="llamaparser"):
147
- def __init__(self, result_type: str, mode: bool) -> None:
147
+ def __init__(self, result_type: str, mode: bool, provider_and_model) -> None:
148
148
  logging.info("Initializing LlamaParser...")
149
149
 
150
+ self.result_type = result_type
151
+ self.mode = mode
152
+ self.provider_and_model = provider_and_model
153
+
150
154
  from llama_parse import LlamaParse, ResultType
151
155
 
152
156
  if result_type.lower() in ("md", "markdown"):
153
- self.result_type = ResultType.MD
157
+ result_type = ResultType.MD
154
158
 
155
159
  api_key = os.getenv("LLAMA-PARSER-API-TOKEN")
156
160
  if not api_key:
157
161
  raise EnvironmentError("Missing LLAMA-PARSER-API-TOKEN in .env file.")
158
162
 
159
- self.parser = LlamaParse(api_key=api_key, result_type=self.result_type, premium_mode=mode)
163
+ self._parser = LlamaParse(api_key=api_key, result_type=result_type, premium_mode=self.mode)
160
164
 
161
165
  def parse(self, file_path: Path) -> str:
162
- documents = self.parser.load_data(str(file_path))
166
+ documents = self._parser.load_data(str(file_path))
163
167
  return "\n".join(doc.text for doc in documents)
164
168
 
165
169
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: HowdenParser
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: A simple configuration manager with Pydantic and JSON export.
5
5
  License: MIT
6
6
  Keywords: config,configuration,pydantic,json
@@ -14,7 +14,7 @@ build-backend = "poetry.core.masonry.api"
14
14
 
15
15
  [tool.poetry]
16
16
  name = "HowdenParser"
17
- version = "2.0.1"
17
+ version = "2.0.2"
18
18
  description = "A simple configuration manager with Pydantic and JSON export."
19
19
  authors = [ "JesperThoftIllemannJ <jesper.jaeger@howdendanmark.dk>",]
20
20
  readme = "README.md"
File without changes