GET Request Output
Once POST Compute Request has been submitted on different models, the computed metadata is stored and can be accessed by using requestId.
The time taken to compute metadata from different models is dependant on the time duration of the Conversation and the number of models enabled.
A 60 minute long conversation should take around 15-20 minutes to get to processed
status.
To track the status of requested models the Get Processing State route can be used. This route can be integrated with your code by using long-polling to check the state periodically until the processing of the all the requestId are in processed
state. For more information refer to the Example given below.
Get Processing state
The state of a particular request ID
can take the following values.
State | Description |
| When the model processing request has been acknowledged by Marsview and the request is either queued or being processed. |
| When there was an error processing the model. This could either be a configuration issue or an Internal Server error. In case of a failure, more information can be found from the metadata section or by referring to the Error Code given in the JSON response. |
| When the model processing request has completed successfully. |
Get Processing State
GET
https://api.marsview.ai/cb/v1/conversation/get_txn/:txnId
Using this method the processing state of all the requests on a transaction can be fetched.
The processing state is found under enableModels.state.status
section of the JSON response body.
For more information refer to the sample response below.
This route additionally provides file information of the uploaded conversation.
Path Parameters
Name | Type | Description |
---|---|---|
txnId | string | Transaction id of the conversation on which the processing request was sent |
Headers
Name | Type | Description |
---|---|---|
Content-Type | string | application/json |
authorization | string | JWT access token with type |
Get Request Metadata
GET
https://api.marsview.ai/cb/v1/conversation/fetch_metadata/:txnId
Path Parameters
Name | Type | Description |
---|---|---|
txnId | string | Transaction ID of the conversation on which the compute metadata request was sent. |
Headers
Name | Type | Description |
---|---|---|
Content-Type | string | application/json |
authorization | string | JWT Access Token |
Example: How to fetch speech to text
output for a Transaction ID
using Long-polling
speech to text
output for a Transaction ID
using Long-pollingThis example will demonstrate how to long-poll for Speech-to-text
model processing to complete and fetch the Speech-to-text
model metadata once the model.state.status
is in processed
state.
For more information on how to send a compute request on a Particular Transaction ID
refer to the Compute Metadata section of the documentation.
Step 1: Get the authentication token.
Using your 'API Key
' and 'API Secret'
you can generate the token as shown below.
Step 2: Long-poll on the processing state
Using the Get Processing State method the Processing request status can be fetched periodically (every 300 seconds in this case).
If the process is in
uploaded
state we continue to poll until the process is in either processed orerror
state.If the process is in
processed
state orerror
state we can move to Step 3.
Step 3: Fetching metadata
Once a particular request is in processed state Metadata for that model can be fetched using the Get Request Metadata method.
Shown below is an example Python code snippet for step 2 and step 3
Last updated