mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-05-04 08:50:24 +02:00
fix highspot
This commit is contained in:
parent
0497bfdf78
commit
75fa10cead
@ -193,12 +193,9 @@ class HighspotClient:
|
||||
"""
|
||||
params = {"right": "view"}
|
||||
response = self._make_request("GET", "spots", params=params)
|
||||
logger.info(f"Received {response} spots")
|
||||
total_counts = response.get("counts_total")
|
||||
# Fix comparison to handle None value
|
||||
if total_counts is not None and total_counts > 0:
|
||||
return response.get("collection", [])
|
||||
return []
|
||||
found_spots = response.get("collection", [])
|
||||
logger.info(f"Received {len(found_spots)} spots")
|
||||
return found_spots
|
||||
|
||||
def get_spot(self, spot_id: str) -> Dict[str, Any]:
|
||||
"""
|
||||
|
@ -1,3 +1,4 @@
|
||||
import os
|
||||
from datetime import datetime
|
||||
from io import BytesIO
|
||||
from typing import Any
|
||||
@ -447,7 +448,10 @@ class HighspotConnector(LoadConnector, PollConnector, SlimConnector):
|
||||
if __name__ == "__main__":
|
||||
spot_names: List[str] = []
|
||||
connector = HighspotConnector(spot_names)
|
||||
credentials = {"highspot_key": "", "highspot_secret": ""}
|
||||
credentials = {
|
||||
"highspot_key": os.environ.get("HIGHSPOT_KEY"),
|
||||
"highspot_secret": os.environ.get("HIGHSPOT_SECRET"),
|
||||
}
|
||||
connector.load_credentials(credentials=credentials)
|
||||
for doc in connector.load_from_state():
|
||||
print(doc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user