Skip to content

Commit

Permalink
Merge pull request langchain-ai#10 from daxa-ai/rahul-trip-patch-1-1
Browse files Browse the repository at this point in the history
minor fixes
  • Loading branch information
rahul-trip authored Jan 24, 2024
2 parents edae6e8 + 2159cc3 commit e8712c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
18 changes: 7 additions & 11 deletions libs/community/langchain_community/document_loaders/pebblo.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def lazy_load(self):
try:
doc_iterator = self.loader.lazy_load()
except NotImplementedError as exc:
err_str = f"{self.__class__.__name__} does not implement lazy_load()"
err_str = f"{self.loader.__class__.__name__} does not implement lazy_load()"
logger.error(err_str)
raise NotImplementedError(err_str) from exc
while True:
Expand Down Expand Up @@ -116,7 +116,7 @@ def _send_loader_doc(self, loading_end=False):
"load_id": self.load_id,
"loader_details": self.loader_details,
"loading_end": "false",
"file_owner": self.source_owner,
"source_owner": self.source_owner,
}
if loading_end is True:
payload["loading_end"] = "true"
Expand Down Expand Up @@ -146,11 +146,9 @@ def _send_loader_doc(self, loading_end=False):
body {resp.json()}\n"
)
except requests.exceptions.RequestException as e:
logger.debug(
f"An exception caught during api request:{e}, url: {load_doc_url}."
)
logger.debug("Unable to reach pebblo server.")
except Exception as e:
logger.warning(f"An Exception caught in _send_loader_doc: {e}")
logger.warning(f"An Exception caught in _send_loader_doc.")
if loading_end is True:
DaxaSafeLoader.set_loader_sent()

Expand Down Expand Up @@ -182,12 +180,10 @@ def _send_discover(self):
logger.debug(
f"Received unexpected HTTP response code: {resp.status_code}"
)
except requests.exceptions.RequestException as e:
logger.warning(
f"An exception caught during api request:{e}, url: {app_discover_url}."
)
except requests.exceptions.RequestException:
logger.warning("Unable to reach pebblo server.")
except Exception as e:
logger.warning(f"An Exception caught in _send_discover: {e}")
logger.warning(f"An Exception caught in _send_discover.")

def _get_app_details(self):
framework, runtime = get_runtime()
Expand Down
2 changes: 1 addition & 1 deletion libs/community/langchain_community/utilities/pebblo.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Doc(BaseModel):
load_id: str
loader_details: dict
loading_end: bool
file_owner: str
source_owner: str


def get_full_path(path):
Expand Down

0 comments on commit e8712c9

Please sign in to comment.