//native
type Cohere = {
apiKey: string;
};
/**
* Fetch an Embed Job
* This API retrieves the details about an embed job started by the same user.
*/
export async function main(auth: Cohere, id: string) {
const url = new URL(`https://api.cohere.com/v1/embed-jobs/${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 428 days ago