mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-13 08:15:21 +02:00
chore: return formatted transcript url
- Return formatted transcript and recording URL - Harden campaign dispatcher logic
This commit is contained in:
parent
0716582aa7
commit
7810923bca
30 changed files with 525 additions and 136 deletions
|
|
@ -13,6 +13,7 @@ from api.db.models import UserModel
|
|||
from api.services.auth.depends import get_user
|
||||
from api.services.mps_service_key_client import mps_service_key_client
|
||||
from api.services.reports import generate_usage_runs_report_csv
|
||||
from api.utils.artifacts import artifact_url
|
||||
|
||||
router = APIRouter(prefix="/organizations")
|
||||
|
||||
|
|
@ -49,6 +50,7 @@ class WorkflowRunUsageResponse(BaseModel):
|
|||
call_duration_seconds: int
|
||||
recording_url: Optional[str] = None
|
||||
transcript_url: Optional[str] = None
|
||||
public_access_token: Optional[str] = None
|
||||
phone_number: Optional[str] = Field(
|
||||
default=None,
|
||||
deprecated=True,
|
||||
|
|
@ -223,6 +225,15 @@ async def get_usage_history(
|
|||
|
||||
total_pages = (total_count + limit - 1) // limit
|
||||
|
||||
for run in runs:
|
||||
public_access_token = run.get("public_access_token")
|
||||
run["transcript_url"] = artifact_url(
|
||||
public_access_token, "transcript", fallback=run.get("transcript_url")
|
||||
)
|
||||
run["recording_url"] = artifact_url(
|
||||
public_access_token, "recording", fallback=run.get("recording_url")
|
||||
)
|
||||
|
||||
return {
|
||||
"runs": runs,
|
||||
"total_dograh_tokens": total_tokens,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue