mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
chore: error reporting and naming (#708)
* chore: error reporting and naming * chore: error reporting and naming --------- Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
This commit is contained in:
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Deploy to Amazon ECS
|
name: Build container/push to container registry
|
||||||
|
|
||||||
on: [workflow_dispatch]
|
on: [workflow_dispatch]
|
||||||
|
|
||||||
|
|||||||
@@ -426,7 +426,12 @@ async def task_pipeline_file_process(*, transcript_id: str):
|
|||||||
|
|
||||||
await pipeline.process(audio_file)
|
await pipeline.process(audio_file)
|
||||||
|
|
||||||
except Exception:
|
except Exception as e:
|
||||||
|
logger.error(
|
||||||
|
f"File pipeline failed for transcript {transcript_id}: {type(e).__name__}: {str(e)}",
|
||||||
|
exc_info=True,
|
||||||
|
transcript_id=transcript_id,
|
||||||
|
)
|
||||||
await pipeline.set_status(transcript_id, "error")
|
await pipeline.set_status(transcript_id, "error")
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,16 @@ class FileTranscriptModalProcessor(FileTranscriptProcessor):
|
|||||||
},
|
},
|
||||||
follow_redirects=True,
|
follow_redirects=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if response.status_code != 200:
|
||||||
|
error_body = response.text
|
||||||
|
self.logger.error(
|
||||||
|
"Modal API error",
|
||||||
|
audio_url=data.audio_url,
|
||||||
|
status_code=response.status_code,
|
||||||
|
error_body=error_body,
|
||||||
|
)
|
||||||
|
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
result = response.json()
|
result = response.json()
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,16 @@ TOPIC_PROMPT = dedent(
|
|||||||
class TopicResponse(BaseModel):
|
class TopicResponse(BaseModel):
|
||||||
"""Structured response for topic detection"""
|
"""Structured response for topic detection"""
|
||||||
|
|
||||||
title: str = Field(description="A descriptive title for the topic being discussed")
|
title: str = Field(
|
||||||
summary: str = Field(description="A concise 1-2 sentence summary of the discussion")
|
description="A descriptive title for the topic being discussed",
|
||||||
|
validation_alias="Title",
|
||||||
|
)
|
||||||
|
summary: str = Field(
|
||||||
|
description="A concise 1-2 sentence summary of the discussion",
|
||||||
|
validation_alias="Summary",
|
||||||
|
)
|
||||||
|
|
||||||
|
model_config = {"populate_by_name": True}
|
||||||
|
|
||||||
|
|
||||||
class TranscriptTopicDetectorProcessor(Processor):
|
class TranscriptTopicDetectorProcessor(Processor):
|
||||||
|
|||||||
Reference in New Issue
Block a user