Get instruction optimization job
import requests
url = "https://modaic.dev/api/v1/instruction-optimizations/{jobId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://modaic.dev/api/v1/instruction-optimizations/{jobId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://modaic.dev/api/v1/instruction-optimizations/{jobId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));false{
"id": "<string>",
"repositoryId": "<string>",
"status": {},
"phase": {},
"branch": "<string>",
"sourceCommitSha": "<string>",
"resultCommitSha": {},
"result": {},
"progress": {},
"error": {},
"createdAt": {},
"updatedAt": {},
"startedAt": {},
"finishedAt": {}
}Instruction optimization
Get instruction optimization job
Poll an instruction optimization job’s status, progress, and result.
GET
/
v1
/
instruction-optimizations
/
{jobId}
Get instruction optimization job
import requests
url = "https://modaic.dev/api/v1/instruction-optimizations/{jobId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://modaic.dev/api/v1/instruction-optimizations/{jobId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://modaic.dev/api/v1/instruction-optimizations/{jobId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));false{
"id": "<string>",
"repositoryId": "<string>",
"status": {},
"phase": {},
"branch": "<string>",
"sourceCommitSha": "<string>",
"resultCommitSha": {},
"result": {},
"progress": {},
"error": {},
"createdAt": {},
"updatedAt": {},
"startedAt": {},
"finishedAt": {}
}Get the current state of an instruction optimization job. Poll until
status is
completed, failed, or cancelled.
Response
A completed result contains
status: "completed", improved,
bestCandidate, initialScore, bestScore, usage, optional metrics, and
nullable artifactPath.stage is one of starting, optimizing, scoring, finishing,
committing, or done. metricCalls / maxMetricCalls is the useful progress
fraction when both values are present; the run may finish before reaching the
maximum.