From 96bd0b084458a88c9b8807f08b25d14f8db51cb1 Mon Sep 17 00:00:00 2001 From: Rahul Triptahi Date: Tue, 21 May 2024 05:45:16 +0530 Subject: [PATCH] community[patch]: Remove redundant pebblo cloud api call (#21589) Description: removed redundant pebblo cloud api call. Changed classified `doc` key to `ai_apps_data`. Documentation: N/A Unit tests: N/A --- .../langchain_community/document_loaders/pebblo.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/libs/community/langchain_community/document_loaders/pebblo.py b/libs/community/langchain_community/document_loaders/pebblo.py index 26f1979e61a..4bc3aa1db5d 100644 --- a/libs/community/langchain_community/document_loaders/pebblo.py +++ b/libs/community/langchain_community/document_loaders/pebblo.py @@ -303,12 +303,6 @@ class PebbloSafeLoader(BaseLoader): pebblo_resp = requests.post( app_discover_url, headers=headers, json=payload, timeout=20 ) - if self.api_key: - pebblo_cloud_url = f"{PEBBLO_CLOUD_URL}/v1/discover" - headers.update({"x-api-key": self.api_key}) - _ = requests.post( - pebblo_cloud_url, headers=headers, json=payload, timeout=20 - ) logger.debug( "send_discover[local]: request url %s, body %s len %s\ response status %s body %s", @@ -333,13 +327,13 @@ class PebbloSafeLoader(BaseLoader): try: headers.update({"x-api-key": self.api_key}) if pebblo_resp: - pebblo_resp_docs = json.loads(pebblo_resp.text).get("docs") + pebblo_resp_docs = json.loads(pebblo_resp.text).get("ai_apps_data") payload.update( { - "pebbloServerVersion": pebblo_resp_docs.get( + "pebblo_server_version": pebblo_resp_docs.get( "pebbloServerVersion" ), - "pebbloClientVersion": pebblo_resp_docs.get( + "pebblo_client_version": pebblo_resp_docs.get( "pebbloClientVersion" ), }