Add transcript
streams.add_transcript(strnamespace, StreamAddTranscriptParams**kwargs) -> StreamAddTranscriptResponse
POST/v1/streams/{namespace}/transcripts
Ingest a single transcript segment for a livestream using a relative timestamp in milliseconds. The stream does not need to be created beforehand. Transcript timestamps are relative milliseconds from stream start and should be monotonically increasing within a stream so transcript context lines up correctly with later frames. This method returns immediately after the transcript has been accepted for processing.
Parameters
namespace: str
The namespace to ingest stream data into
stream_id: str
text: str
timestamp: int
minimum0
Returns
Add transcript
import os
from safetykit import Safetykit
client = Safetykit(
api_key=os.environ.get("SAFETYKIT_API_KEY"), # This is the default and can be omitted
)
response = client.streams.add_transcript(
namespace="namespace",
stream_id="YOUR_STREAM_ID",
text="This is an example transcript segment.",
timestamp=5000,
)
print(response.request_id){
"requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
"status": "accepted"
}Returns Examples
{
"requestId": "req_01h2m7qdmdjckc30e1mnq6xqfd",
"status": "accepted"
}