//native
type Assemblyai = {
apiKey: string;
};
/**
* Retrieve LeMUR response
* Retrieve a LeMUR response that was previously generated.
*/
export async function main(auth: Assemblyai, request_id: string) {
const url = new URL(`https://api.assemblyai.com/lemur/v3/${request_id}`);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + auth.apiKey,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 33 days ago