mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-26 07:50:56 +02:00
minor improvement to fireflies connector (#4383)
* minor improvement to fireflies connector * reduce time diff
This commit is contained in:
parent
a7130681d9
commit
ea30f1de1e
@ -45,6 +45,8 @@ _FIREFLIES_API_QUERY = """
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
ONE_MINUTE = 60
|
||||||
|
|
||||||
|
|
||||||
def _create_doc_from_transcript(transcript: dict) -> Document | None:
|
def _create_doc_from_transcript(transcript: dict) -> Document | None:
|
||||||
sections: List[TextSection] = []
|
sections: List[TextSection] = []
|
||||||
@ -106,6 +108,8 @@ def _create_doc_from_transcript(transcript: dict) -> Document | None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# If not all transcripts are being indexed, try using a more-recently-generated
|
||||||
|
# API key.
|
||||||
class FirefliesConnector(PollConnector, LoadConnector):
|
class FirefliesConnector(PollConnector, LoadConnector):
|
||||||
def __init__(self, batch_size: int = INDEX_BATCH_SIZE) -> None:
|
def __init__(self, batch_size: int = INDEX_BATCH_SIZE) -> None:
|
||||||
self.batch_size = batch_size
|
self.batch_size = batch_size
|
||||||
@ -191,6 +195,9 @@ class FirefliesConnector(PollConnector, LoadConnector):
|
|||||||
def poll_source(
|
def poll_source(
|
||||||
self, start: SecondsSinceUnixEpoch, end: SecondsSinceUnixEpoch
|
self, start: SecondsSinceUnixEpoch, end: SecondsSinceUnixEpoch
|
||||||
) -> GenerateDocumentsOutput:
|
) -> GenerateDocumentsOutput:
|
||||||
|
# add some leeway to account for any timezone funkiness and/or bad handling
|
||||||
|
# of start time on the Fireflies side
|
||||||
|
start = max(0, start - ONE_MINUTE)
|
||||||
start_datetime = datetime.fromtimestamp(start, tz=timezone.utc).strftime(
|
start_datetime = datetime.fromtimestamp(start, tz=timezone.utc).strftime(
|
||||||
"%Y-%m-%dT%H:%M:%S.000Z"
|
"%Y-%m-%dT%H:%M:%S.000Z"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user