Gemini operations.get
curl --request GET \
--url https://maas.apigo.ai/v1beta/operations/{operation_id} \
--header 'x-goog-api-key: <api-key>'import requests
url = "https://maas.apigo.ai/v1beta/operations/{operation_id}"
headers = {"x-goog-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-goog-api-key': '<api-key>'}};
fetch('https://maas.apigo.ai/v1beta/operations/{operation_id}', 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://maas.apigo.ai/v1beta/operations/{operation_id}",
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-goog-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://maas.apigo.ai/v1beta/operations/{operation_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-goog-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://maas.apigo.ai/v1beta/operations/{operation_id}")
.header("x-goog-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://maas.apigo.ai/v1beta/operations/{operation_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-goog-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"name": "operations/abc123",
"done": true,
"response": {
"videoUri": "gs://bucket/video.mp4"
}
}{
"error": 123,
"message": "<string>"
}Video
/v1beta/operations/{operation_id}
Gemini 장기 실행 작업의 최신 상태를 검색합니다.
GET
/
v1beta
/
operations
/
{operation_id}
Gemini operations.get
curl --request GET \
--url https://maas.apigo.ai/v1beta/operations/{operation_id} \
--header 'x-goog-api-key: <api-key>'import requests
url = "https://maas.apigo.ai/v1beta/operations/{operation_id}"
headers = {"x-goog-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-goog-api-key': '<api-key>'}};
fetch('https://maas.apigo.ai/v1beta/operations/{operation_id}', 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://maas.apigo.ai/v1beta/operations/{operation_id}",
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-goog-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://maas.apigo.ai/v1beta/operations/{operation_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-goog-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://maas.apigo.ai/v1beta/operations/{operation_id}")
.header("x-goog-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://maas.apigo.ai/v1beta/operations/{operation_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-goog-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"name": "operations/abc123",
"done": true,
"response": {
"videoUri": "gs://bucket/video.mp4"
}
}{
"error": 123,
"message": "<string>"
}このエンドポイントを使用して、Gemini の長時間実行操作の現在のステータス、メタデータ、およびエラー状態をクエリします。
- このエンドポイントは通常、
predictLongRunningとペアになります。 - 主要なパス パラメータは
operation_idです。 - ポーリング中に
done、metadata、およびerrorを検査する - 製品が独自のジョブ状態を保持する場合は、動作状態をビジネス状態とは別に保存します
⌘I
