交互式操作
查询训练操作
通过 Idempotency-Key 恢复任务和 future,无需再次提交工作。
GET
https://api.fastino.ai
/
v1
/
training
/
operations
/
{idempotency_key}
查询训练操作
curl --request GET \
--url https://api.fastino.ai/v1/training/operations/{idempotency_key} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.fastino.ai/v1/training/operations/{idempotency_key}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.fastino.ai/v1/training/operations/{idempotency_key}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fastino.ai/v1/training/operations/{idempotency_key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fastino.ai/v1/training/operations/{idempotency_key}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fastino.ai/v1/training/operations/{idempotency_key}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fastino.ai/v1/training/operations/{idempotency_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"idempotency_key": "training-step-1",
"status": "accepted",
"operation": "forward-backward",
"job_id": "SESSION_ID:train:0",
"future_id": "FUTURE_ID",
"future_status": "completed"
}
GET /v1/training/operations/{idempotency_key}
发送最初用于原生交互式 POST 或编码器任务创建的密钥。密钥按团队隔离。not_found 表示当前范围内没有可见回执;原生调用仍在接纳、任务尚未记录时也会返回此状态,不能据此断定调用从未到达。
accepted 回执表示任务已记录,不表示执行成功。如有 future,请使用原 future 读取结果。停止操作没有 future;编码器创建只返回任务。
如原生请求结果不确定,请用相同请求体、路由和密钥重试。同一密钥用于不同请求会返回 422;首次调用仍在进行会返回 409。新工作应使用新密钥。此端点不保证回执保留期或过期时间。
string
必填
Fastino API key.
string
必填
Idempotency-Key.
{
"idempotency_key": "training-step-1",
"status": "accepted",
"operation": "forward-backward",
"job_id": "SESSION_ID:train:0",
"future_id": "FUTURE_ID",
"future_status": "completed"
}
此页面对您有帮助吗?
⌘I
查询训练操作
curl --request GET \
--url https://api.fastino.ai/v1/training/operations/{idempotency_key} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.fastino.ai/v1/training/operations/{idempotency_key}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.fastino.ai/v1/training/operations/{idempotency_key}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fastino.ai/v1/training/operations/{idempotency_key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.fastino.ai/v1/training/operations/{idempotency_key}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fastino.ai/v1/training/operations/{idempotency_key}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fastino.ai/v1/training/operations/{idempotency_key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"idempotency_key": "training-step-1",
"status": "accepted",
"operation": "forward-backward",
"job_id": "SESSION_ID:train:0",
"future_id": "FUTURE_ID",
"future_status": "completed"
}

