type Openai = {
api_key: string;
organization_id: string;
};
/**
* Retrieve fine tuning job
* Get info about a fine-tuning job.
Learn more about fine-tuning
*/
export async function main(auth: Openai, fine_tuning_job_id: string) {
const url = new URL(
`https://api.openai.com/v1/fine_tuning/jobs/${fine_tuning_job_id}`
);
const response = await fetch(url, {
method: "GET",
headers: {
"OpenAI-Organization": auth.organization_id,
Authorization: "Bearer " + auth.api_key,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 372 days ago
type Openai = {
api_key: string;
organization_id: string;
};
/**
* Retrieve fine tuning job
* Get info about a fine-tuning job.
Learn more about fine-tuning
*/
export async function main(auth: Openai, fine_tuning_job_id: string) {
const url = new URL(
`https://api.openai.com/v1/fine_tuning/jobs/${fine_tuning_job_id}`
);
const response = await fetch(url, {
method: "GET",
headers: {
"OpenAI-Organization": auth.organization_id,
Authorization: "Bearer " + auth.api_key,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 895 days ago