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
pull/21566/head
Rahul Triptahi 4 months ago committed by GitHub
parent d07885f8b7
commit 96bd0b0844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -303,12 +303,6 @@ class PebbloSafeLoader(BaseLoader):
pebblo_resp = requests.post( pebblo_resp = requests.post(
app_discover_url, headers=headers, json=payload, timeout=20 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( logger.debug(
"send_discover[local]: request url %s, body %s len %s\ "send_discover[local]: request url %s, body %s len %s\
response status %s body %s", response status %s body %s",
@ -333,13 +327,13 @@ class PebbloSafeLoader(BaseLoader):
try: try:
headers.update({"x-api-key": self.api_key}) headers.update({"x-api-key": self.api_key})
if pebblo_resp: 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( payload.update(
{ {
"pebbloServerVersion": pebblo_resp_docs.get( "pebblo_server_version": pebblo_resp_docs.get(
"pebbloServerVersion" "pebbloServerVersion"
), ),
"pebbloClientVersion": pebblo_resp_docs.get( "pebblo_client_version": pebblo_resp_docs.get(
"pebbloClientVersion" "pebbloClientVersion"
), ),
} }

Loading…
Cancel
Save