mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
feat: add transcript and recording public URLs in API
This commit is contained in:
parent
7810923bca
commit
3df5730076
8 changed files with 412 additions and 14 deletions
|
|
@ -50,6 +50,8 @@ class WorkflowRunUsageResponse(BaseModel):
|
|||
call_duration_seconds: int
|
||||
recording_url: Optional[str] = None
|
||||
transcript_url: Optional[str] = None
|
||||
recording_public_url: Optional[str] = None
|
||||
transcript_public_url: Optional[str] = None
|
||||
public_access_token: Optional[str] = None
|
||||
phone_number: Optional[str] = Field(
|
||||
default=None,
|
||||
|
|
@ -227,12 +229,10 @@ async def get_usage_history(
|
|||
|
||||
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")
|
||||
run["transcript_public_url"] = artifact_url(
|
||||
public_access_token, "transcript"
|
||||
)
|
||||
run["recording_public_url"] = artifact_url(public_access_token, "recording")
|
||||
|
||||
return {
|
||||
"runs": runs,
|
||||
|
|
|
|||
|
|
@ -1125,12 +1125,10 @@ async def get_workflow_run(
|
|||
"name": run.name,
|
||||
"mode": run.mode,
|
||||
"is_completed": run.is_completed,
|
||||
"transcript_url": artifact_url(
|
||||
public_access_token, "transcript", fallback=run.transcript_url
|
||||
),
|
||||
"recording_url": artifact_url(
|
||||
public_access_token, "recording", fallback=run.recording_url
|
||||
),
|
||||
"transcript_url": run.transcript_url,
|
||||
"recording_url": run.recording_url,
|
||||
"transcript_public_url": artifact_url(public_access_token, "transcript"),
|
||||
"recording_public_url": artifact_url(public_access_token, "recording"),
|
||||
"public_access_token": public_access_token,
|
||||
"cost_info": {
|
||||
"dograh_token_usage": (
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ class WorkflowRunResponseSchema(BaseModel):
|
|||
is_completed: bool
|
||||
transcript_url: str | None
|
||||
recording_url: str | None
|
||||
transcript_public_url: str | None = None
|
||||
recording_public_url: str | None = None
|
||||
public_access_token: str | None = None
|
||||
cost_info: Dict[str, Any] | None
|
||||
definition_id: int | None # This is for backward compatibility
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue