Récupérer une tâche d’agent
Récupère le statut actuel et les détails d’une tâche d’agent. Interrogez ce point de terminaison pour suivre la progression de la tâche.
curl --request GET \
--url https://api.mintlify.com/v2/agent/{projectId}/job/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v2/agent/{projectId}/job/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mintlify.com/v2/agent/{projectId}/job/{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://api.mintlify.com/v2/agent/{projectId}/job/{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 => [
"Authorization: Bearer <token>"
],
]);
$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.mintlify.com/v2/agent/{projectId}/job/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.mintlify.com/v2/agent/{projectId}/job/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v2/agent/{projectId}/job/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "active",
"source": {
"repository": "<string>",
"ref": "<string>"
},
"model": "<string>",
"prLink": "https://github.com/org/repo/pull/123",
"createdAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>"
}status passe de active à completed ou failed.
Une fois que l’agent a créé une pull request (demande de fusion), le champ prLink est renseigné.Autorisations
L’en-tête Authorization requiert un jeton Bearer. Utilisez une clé API d’administrateur (préfixée par mint_). Il s’agit d’une clé secrète côté serveur. Générez-en une sur la page des clés API dans votre Dashboard Mintlify.
Paramètres de chemin
L’identifiant unique de la tâche d’agent.
Réponse
Détails de la tâche d’agent
Identifiant unique de la tâche d’agent.
Statut actuel de la tâche. active — l’agent traite actuellement le prompt. completed — l’agent a terminé avec succès et une PR a peut-être été créée (vérifiez prLink). archived — la tâche a été archivée. failed — l’agent a rencontré une erreur non récupérable. Interrogez régulièrement jusqu’à ce que le statut soit completed, archived ou failed.
active, completed, archived, failed Informations sur le référentiel source.
Show child attributes
Show child attributes
Modèle d’IA utilisé pour cette tâche.
URL de la pull request (demande de fusion) GitHub créée par l’agent. null tant que la tâche est active ou si aucun fichier n’a été modifié. Renseignée une fois que l’agent a créé une PR avec succès.
"https://github.com/org/repo/pull/123"
Horodatage de création de la tâche.
Horodatage d’archivage de la tâche.
Cette page vous a-t-elle été utile ?
curl --request GET \
--url https://api.mintlify.com/v2/agent/{projectId}/job/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v2/agent/{projectId}/job/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mintlify.com/v2/agent/{projectId}/job/{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://api.mintlify.com/v2/agent/{projectId}/job/{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 => [
"Authorization: Bearer <token>"
],
]);
$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.mintlify.com/v2/agent/{projectId}/job/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.mintlify.com/v2/agent/{projectId}/job/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v2/agent/{projectId}/job/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "active",
"source": {
"repository": "<string>",
"ref": "<string>"
},
"model": "<string>",
"prLink": "https://github.com/org/repo/pull/123",
"createdAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>"
}