Playground
Resume a run
Resume a paused or awaiting run.
POST
/
runs
/
{run_id}
Resume a run
curl --request POST \
--url http://localhost:8000/runs/{run_id} \
--header 'Content-Type: application/json' \
--data '
{
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"await_resume": {}
}
'import requests
url = "http://localhost:8000/runs/{run_id}"
payload = {
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"await_resume": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({run_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', await_resume: {}})
};
fetch('http://localhost:8000/runs/{run_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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/runs/{run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'run_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'await_resume' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/runs/{run_id}"
payload := strings.NewReader("{\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"await_resume\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/runs/{run_id}")
.header("Content-Type", "application/json")
.body("{\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"await_resume\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/runs/{run_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"await_resume\": {}\n}"
response = http.request(request)
puts response.read_body{
"agent_name": "chat",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"output": [
{
"role": "<string>",
"parts": [
{
"content_type": "text/plain",
"name": "<string>",
"content": "<string>",
"content_encoding": "plain",
"content_url": "<string>",
"metadata": {
"kind": "citation",
"start_index": 123,
"end_index": 123,
"url": "<string>",
"title": "<string>",
"description": "<string>"
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"await_request": {},
"error": {
"message": "<string>",
"data": {}
},
"finished_at": "2023-11-07T05:31:56Z"
}{
"agent_name": "chat",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"output": [
{
"role": "<string>",
"parts": [
{
"content_type": "text/plain",
"name": "<string>",
"content": "<string>",
"content_encoding": "plain",
"content_url": "<string>",
"metadata": {
"kind": "citation",
"start_index": 123,
"end_index": 123,
"url": "<string>",
"title": "<string>",
"description": "<string>"
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"await_request": {},
"error": {
"message": "<string>",
"data": {}
},
"finished_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"data": {}
}Body
application/json
Response
Run resumed (streaming or immediate)
A unique identifier for the agent following the RFC 1123 DNS label naming convention.
Required string length:
1 - 63Pattern:
^[a-z0-9]([-a-z0-9]*[a-z0-9])?$Example:
"chat"
Identifier of a run
Status of the run
Available options:
created, in-progress, awaiting, cancelling, cancelled, completed, failed Show child attributes
Show child attributes
Identifier of a session
Payload describing what is awaited from the client to continue the run.
Show child attributes
Show child attributes
⌘I
Resume a run
curl --request POST \
--url http://localhost:8000/runs/{run_id} \
--header 'Content-Type: application/json' \
--data '
{
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"await_resume": {}
}
'import requests
url = "http://localhost:8000/runs/{run_id}"
payload = {
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"await_resume": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({run_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', await_resume: {}})
};
fetch('http://localhost:8000/runs/{run_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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/runs/{run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'run_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'await_resume' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/runs/{run_id}"
payload := strings.NewReader("{\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"await_resume\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/runs/{run_id}")
.header("Content-Type", "application/json")
.body("{\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"await_resume\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/runs/{run_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"await_resume\": {}\n}"
response = http.request(request)
puts response.read_body{
"agent_name": "chat",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"output": [
{
"role": "<string>",
"parts": [
{
"content_type": "text/plain",
"name": "<string>",
"content": "<string>",
"content_encoding": "plain",
"content_url": "<string>",
"metadata": {
"kind": "citation",
"start_index": 123,
"end_index": 123,
"url": "<string>",
"title": "<string>",
"description": "<string>"
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"await_request": {},
"error": {
"message": "<string>",
"data": {}
},
"finished_at": "2023-11-07T05:31:56Z"
}{
"agent_name": "chat",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"output": [
{
"role": "<string>",
"parts": [
{
"content_type": "text/plain",
"name": "<string>",
"content": "<string>",
"content_encoding": "plain",
"content_url": "<string>",
"metadata": {
"kind": "citation",
"start_index": 123,
"end_index": 123,
"url": "<string>",
"title": "<string>",
"description": "<string>"
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"await_request": {},
"error": {
"message": "<string>",
"data": {}
},
"finished_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"data": {}
}