Playground
Create a new run
Create and start a new run for the specified agent.
POST
/
runs
Create a new run
curl --request POST \
--url http://localhost:8000/runs \
--header 'Content-Type: application/json' \
--data '
{
"agent_name": "chat",
"input": [
{
"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"
}
],
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "http://localhost:8000/runs"
payload = {
"agent_name": "chat",
"input": [
{
"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"
}
],
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
agent_name: 'chat',
input: [
{
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'
}
],
session_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('http://localhost:8000/runs', 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",
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([
'agent_name' => 'chat',
'input' => [
[
'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'
]
],
'session_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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"
payload := strings.NewReader("{\n \"agent_name\": \"chat\",\n \"input\": [\n {\n \"role\": \"<string>\",\n \"parts\": [\n {\n \"content_type\": \"text/plain\",\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_encoding\": \"plain\",\n \"content_url\": \"<string>\",\n \"metadata\": {\n \"kind\": \"citation\",\n \"start_index\": 123,\n \"end_index\": 123,\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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")
.header("Content-Type", "application/json")
.body("{\n \"agent_name\": \"chat\",\n \"input\": [\n {\n \"role\": \"<string>\",\n \"parts\": [\n {\n \"content_type\": \"text/plain\",\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_encoding\": \"plain\",\n \"content_url\": \"<string>\",\n \"metadata\": {\n \"kind\": \"citation\",\n \"start_index\": 123,\n \"end_index\": 123,\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/runs")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_name\": \"chat\",\n \"input\": [\n {\n \"role\": \"<string>\",\n \"parts\": [\n {\n \"content_type\": \"text/plain\",\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_encoding\": \"plain\",\n \"content_url\": \"<string>\",\n \"metadata\": {\n \"kind\": \"citation\",\n \"start_index\": 123,\n \"end_index\": 123,\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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
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"
Minimum array length:
1Show child attributes
Show child attributes
Identifier of a session
Show child attributes
Show child attributes
Mode of the request
Available options:
sync, async, stream Response
Run started (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
Create a new run
curl --request POST \
--url http://localhost:8000/runs \
--header 'Content-Type: application/json' \
--data '
{
"agent_name": "chat",
"input": [
{
"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"
}
],
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "http://localhost:8000/runs"
payload = {
"agent_name": "chat",
"input": [
{
"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"
}
],
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
agent_name: 'chat',
input: [
{
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'
}
],
session_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('http://localhost:8000/runs', 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",
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([
'agent_name' => 'chat',
'input' => [
[
'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'
]
],
'session_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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"
payload := strings.NewReader("{\n \"agent_name\": \"chat\",\n \"input\": [\n {\n \"role\": \"<string>\",\n \"parts\": [\n {\n \"content_type\": \"text/plain\",\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_encoding\": \"plain\",\n \"content_url\": \"<string>\",\n \"metadata\": {\n \"kind\": \"citation\",\n \"start_index\": 123,\n \"end_index\": 123,\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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")
.header("Content-Type", "application/json")
.body("{\n \"agent_name\": \"chat\",\n \"input\": [\n {\n \"role\": \"<string>\",\n \"parts\": [\n {\n \"content_type\": \"text/plain\",\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_encoding\": \"plain\",\n \"content_url\": \"<string>\",\n \"metadata\": {\n \"kind\": \"citation\",\n \"start_index\": 123,\n \"end_index\": 123,\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/runs")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_name\": \"chat\",\n \"input\": [\n {\n \"role\": \"<string>\",\n \"parts\": [\n {\n \"content_type\": \"text/plain\",\n \"name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_encoding\": \"plain\",\n \"content_url\": \"<string>\",\n \"metadata\": {\n \"kind\": \"citation\",\n \"start_index\": 123,\n \"end_index\": 123,\n \"url\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"completed_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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": {}
}