curl --request PATCH \
--url https://api.galtea.ai/versions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "ver_123",
"productId": "prod_123",
"userId": "user_123",
"name": "support release",
"description": "Version description",
"modelId": "model_123",
"systemPrompt": "You are a helpful assistant",
"datasetUri": "https://example.com/dataset.csv",
"datasetDescription": "Training dataset",
"guardrails": "Safety guidelines",
"facts": {
"model": "gpt-4o",
"temperature": "0.7",
"promptVersion": "12"
},
"otelInputSourceRule": {
"spanName": "ExecuteActivity:add_user_message",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "user"
}
},
"otelOutputSourceRule": {
"spanName": "ExecuteActivity:save_reply",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "assistant"
}
},
"initializationEndpointConnectionId": "ec_123",
"conversationEndpointConnectionId": "ec_123",
"finalizationEndpointConnectionId": "ec_123",
"phoneConnectionId": "phoneConnection_123",
"webRtcConnectionId": "webRtcConnection_123",
"parentVersionId": "ver_122",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.galtea.ai/versions/{id}"
payload = {
"id": "ver_123",
"productId": "prod_123",
"userId": "user_123",
"name": "support release",
"description": "Version description",
"modelId": "model_123",
"systemPrompt": "You are a helpful assistant",
"datasetUri": "https://example.com/dataset.csv",
"datasetDescription": "Training dataset",
"guardrails": "Safety guidelines",
"facts": {
"model": "gpt-4o",
"temperature": "0.7",
"promptVersion": "12"
},
"otelInputSourceRule": {
"spanName": "ExecuteActivity:add_user_message",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "user"
}
},
"otelOutputSourceRule": {
"spanName": "ExecuteActivity:save_reply",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "assistant"
}
},
"initializationEndpointConnectionId": "ec_123",
"conversationEndpointConnectionId": "ec_123",
"finalizationEndpointConnectionId": "ec_123",
"phoneConnectionId": "phoneConnection_123",
"webRtcConnectionId": "webRtcConnection_123",
"parentVersionId": "ver_122",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'ver_123',
productId: 'prod_123',
userId: 'user_123',
name: 'support release',
description: 'Version description',
modelId: 'model_123',
systemPrompt: 'You are a helpful assistant',
datasetUri: 'https://example.com/dataset.csv',
datasetDescription: 'Training dataset',
guardrails: 'Safety guidelines',
facts: {model: 'gpt-4o', temperature: '0.7', promptVersion: '12'},
otelInputSourceRule: {
spanName: 'ExecuteActivity:add_user_message',
attribute: 'app.arguments',
path: '$[0].message.content',
predicate: {path: '$[0].message.role', equals: 'user'}
},
otelOutputSourceRule: {
spanName: 'ExecuteActivity:save_reply',
attribute: 'app.arguments',
path: '$[0].message.content',
predicate: {path: '$[0].message.role', equals: 'assistant'}
},
initializationEndpointConnectionId: 'ec_123',
conversationEndpointConnectionId: 'ec_123',
finalizationEndpointConnectionId: 'ec_123',
phoneConnectionId: 'phoneConnection_123',
webRtcConnectionId: 'webRtcConnection_123',
parentVersionId: 'ver_122',
createdAt: '2023-11-07T05:31:56Z',
deletedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.galtea.ai/versions/{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.galtea.ai/versions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'ver_123',
'productId' => 'prod_123',
'userId' => 'user_123',
'name' => 'support release',
'description' => 'Version description',
'modelId' => 'model_123',
'systemPrompt' => 'You are a helpful assistant',
'datasetUri' => 'https://example.com/dataset.csv',
'datasetDescription' => 'Training dataset',
'guardrails' => 'Safety guidelines',
'facts' => [
'model' => 'gpt-4o',
'temperature' => '0.7',
'promptVersion' => '12'
],
'otelInputSourceRule' => [
'spanName' => 'ExecuteActivity:add_user_message',
'attribute' => 'app.arguments',
'path' => '$[0].message.content',
'predicate' => [
'path' => '$[0].message.role',
'equals' => 'user'
]
],
'otelOutputSourceRule' => [
'spanName' => 'ExecuteActivity:save_reply',
'attribute' => 'app.arguments',
'path' => '$[0].message.content',
'predicate' => [
'path' => '$[0].message.role',
'equals' => 'assistant'
]
],
'initializationEndpointConnectionId' => 'ec_123',
'conversationEndpointConnectionId' => 'ec_123',
'finalizationEndpointConnectionId' => 'ec_123',
'phoneConnectionId' => 'phoneConnection_123',
'webRtcConnectionId' => 'webRtcConnection_123',
'parentVersionId' => 'ver_122',
'createdAt' => '2023-11-07T05:31:56Z',
'deletedAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.galtea.ai/versions/{id}"
payload := strings.NewReader("{\n \"id\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"userId\": \"user_123\",\n \"name\": \"support release\",\n \"description\": \"Version description\",\n \"modelId\": \"model_123\",\n \"systemPrompt\": \"You are a helpful assistant\",\n \"datasetUri\": \"https://example.com/dataset.csv\",\n \"datasetDescription\": \"Training dataset\",\n \"guardrails\": \"Safety guidelines\",\n \"facts\": {\n \"model\": \"gpt-4o\",\n \"temperature\": \"0.7\",\n \"promptVersion\": \"12\"\n },\n \"otelInputSourceRule\": {\n \"spanName\": \"ExecuteActivity:add_user_message\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"user\"\n }\n },\n \"otelOutputSourceRule\": {\n \"spanName\": \"ExecuteActivity:save_reply\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"assistant\"\n }\n },\n \"initializationEndpointConnectionId\": \"ec_123\",\n \"conversationEndpointConnectionId\": \"ec_123\",\n \"finalizationEndpointConnectionId\": \"ec_123\",\n \"phoneConnectionId\": \"phoneConnection_123\",\n \"webRtcConnectionId\": \"webRtcConnection_123\",\n \"parentVersionId\": \"ver_122\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.galtea.ai/versions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"userId\": \"user_123\",\n \"name\": \"support release\",\n \"description\": \"Version description\",\n \"modelId\": \"model_123\",\n \"systemPrompt\": \"You are a helpful assistant\",\n \"datasetUri\": \"https://example.com/dataset.csv\",\n \"datasetDescription\": \"Training dataset\",\n \"guardrails\": \"Safety guidelines\",\n \"facts\": {\n \"model\": \"gpt-4o\",\n \"temperature\": \"0.7\",\n \"promptVersion\": \"12\"\n },\n \"otelInputSourceRule\": {\n \"spanName\": \"ExecuteActivity:add_user_message\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"user\"\n }\n },\n \"otelOutputSourceRule\": {\n \"spanName\": \"ExecuteActivity:save_reply\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"assistant\"\n }\n },\n \"initializationEndpointConnectionId\": \"ec_123\",\n \"conversationEndpointConnectionId\": \"ec_123\",\n \"finalizationEndpointConnectionId\": \"ec_123\",\n \"phoneConnectionId\": \"phoneConnection_123\",\n \"webRtcConnectionId\": \"webRtcConnection_123\",\n \"parentVersionId\": \"ver_122\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/versions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"userId\": \"user_123\",\n \"name\": \"support release\",\n \"description\": \"Version description\",\n \"modelId\": \"model_123\",\n \"systemPrompt\": \"You are a helpful assistant\",\n \"datasetUri\": \"https://example.com/dataset.csv\",\n \"datasetDescription\": \"Training dataset\",\n \"guardrails\": \"Safety guidelines\",\n \"facts\": {\n \"model\": \"gpt-4o\",\n \"temperature\": \"0.7\",\n \"promptVersion\": \"12\"\n },\n \"otelInputSourceRule\": {\n \"spanName\": \"ExecuteActivity:add_user_message\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"user\"\n }\n },\n \"otelOutputSourceRule\": {\n \"spanName\": \"ExecuteActivity:save_reply\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"assistant\"\n }\n },\n \"initializationEndpointConnectionId\": \"ec_123\",\n \"conversationEndpointConnectionId\": \"ec_123\",\n \"finalizationEndpointConnectionId\": \"ec_123\",\n \"phoneConnectionId\": \"phoneConnection_123\",\n \"webRtcConnectionId\": \"webRtcConnection_123\",\n \"parentVersionId\": \"ver_122\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "ver_123",
"productId": "prod_123",
"userId": "user_123",
"number": 7,
"name": "support release",
"description": "Version description",
"modelId": "model_123",
"systemPrompt": "You are a helpful assistant",
"datasetUri": "https://example.com/dataset.csv",
"datasetDescription": "Training dataset",
"guardrails": "Safety guidelines",
"facts": {
"model": "gpt-4o",
"temperature": "0.7",
"promptVersion": "12"
},
"otelInputSourceRule": {
"spanName": "ExecuteActivity:add_user_message",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "user"
}
},
"otelOutputSourceRule": {
"spanName": "ExecuteActivity:save_reply",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "assistant"
}
},
"initializationEndpointConnectionId": "ec_123",
"conversationEndpointConnectionId": "ec_123",
"finalizationEndpointConnectionId": "ec_123",
"phoneConnectionId": "phoneConnection_123",
"webRtcConnectionId": "webRtcConnection_123",
"parentVersionId": "ver_122",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Update version
Update an existing version. See Versions.
curl --request PATCH \
--url https://api.galtea.ai/versions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "ver_123",
"productId": "prod_123",
"userId": "user_123",
"name": "support release",
"description": "Version description",
"modelId": "model_123",
"systemPrompt": "You are a helpful assistant",
"datasetUri": "https://example.com/dataset.csv",
"datasetDescription": "Training dataset",
"guardrails": "Safety guidelines",
"facts": {
"model": "gpt-4o",
"temperature": "0.7",
"promptVersion": "12"
},
"otelInputSourceRule": {
"spanName": "ExecuteActivity:add_user_message",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "user"
}
},
"otelOutputSourceRule": {
"spanName": "ExecuteActivity:save_reply",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "assistant"
}
},
"initializationEndpointConnectionId": "ec_123",
"conversationEndpointConnectionId": "ec_123",
"finalizationEndpointConnectionId": "ec_123",
"phoneConnectionId": "phoneConnection_123",
"webRtcConnectionId": "webRtcConnection_123",
"parentVersionId": "ver_122",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.galtea.ai/versions/{id}"
payload = {
"id": "ver_123",
"productId": "prod_123",
"userId": "user_123",
"name": "support release",
"description": "Version description",
"modelId": "model_123",
"systemPrompt": "You are a helpful assistant",
"datasetUri": "https://example.com/dataset.csv",
"datasetDescription": "Training dataset",
"guardrails": "Safety guidelines",
"facts": {
"model": "gpt-4o",
"temperature": "0.7",
"promptVersion": "12"
},
"otelInputSourceRule": {
"spanName": "ExecuteActivity:add_user_message",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "user"
}
},
"otelOutputSourceRule": {
"spanName": "ExecuteActivity:save_reply",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "assistant"
}
},
"initializationEndpointConnectionId": "ec_123",
"conversationEndpointConnectionId": "ec_123",
"finalizationEndpointConnectionId": "ec_123",
"phoneConnectionId": "phoneConnection_123",
"webRtcConnectionId": "webRtcConnection_123",
"parentVersionId": "ver_122",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'ver_123',
productId: 'prod_123',
userId: 'user_123',
name: 'support release',
description: 'Version description',
modelId: 'model_123',
systemPrompt: 'You are a helpful assistant',
datasetUri: 'https://example.com/dataset.csv',
datasetDescription: 'Training dataset',
guardrails: 'Safety guidelines',
facts: {model: 'gpt-4o', temperature: '0.7', promptVersion: '12'},
otelInputSourceRule: {
spanName: 'ExecuteActivity:add_user_message',
attribute: 'app.arguments',
path: '$[0].message.content',
predicate: {path: '$[0].message.role', equals: 'user'}
},
otelOutputSourceRule: {
spanName: 'ExecuteActivity:save_reply',
attribute: 'app.arguments',
path: '$[0].message.content',
predicate: {path: '$[0].message.role', equals: 'assistant'}
},
initializationEndpointConnectionId: 'ec_123',
conversationEndpointConnectionId: 'ec_123',
finalizationEndpointConnectionId: 'ec_123',
phoneConnectionId: 'phoneConnection_123',
webRtcConnectionId: 'webRtcConnection_123',
parentVersionId: 'ver_122',
createdAt: '2023-11-07T05:31:56Z',
deletedAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.galtea.ai/versions/{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.galtea.ai/versions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'ver_123',
'productId' => 'prod_123',
'userId' => 'user_123',
'name' => 'support release',
'description' => 'Version description',
'modelId' => 'model_123',
'systemPrompt' => 'You are a helpful assistant',
'datasetUri' => 'https://example.com/dataset.csv',
'datasetDescription' => 'Training dataset',
'guardrails' => 'Safety guidelines',
'facts' => [
'model' => 'gpt-4o',
'temperature' => '0.7',
'promptVersion' => '12'
],
'otelInputSourceRule' => [
'spanName' => 'ExecuteActivity:add_user_message',
'attribute' => 'app.arguments',
'path' => '$[0].message.content',
'predicate' => [
'path' => '$[0].message.role',
'equals' => 'user'
]
],
'otelOutputSourceRule' => [
'spanName' => 'ExecuteActivity:save_reply',
'attribute' => 'app.arguments',
'path' => '$[0].message.content',
'predicate' => [
'path' => '$[0].message.role',
'equals' => 'assistant'
]
],
'initializationEndpointConnectionId' => 'ec_123',
'conversationEndpointConnectionId' => 'ec_123',
'finalizationEndpointConnectionId' => 'ec_123',
'phoneConnectionId' => 'phoneConnection_123',
'webRtcConnectionId' => 'webRtcConnection_123',
'parentVersionId' => 'ver_122',
'createdAt' => '2023-11-07T05:31:56Z',
'deletedAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.galtea.ai/versions/{id}"
payload := strings.NewReader("{\n \"id\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"userId\": \"user_123\",\n \"name\": \"support release\",\n \"description\": \"Version description\",\n \"modelId\": \"model_123\",\n \"systemPrompt\": \"You are a helpful assistant\",\n \"datasetUri\": \"https://example.com/dataset.csv\",\n \"datasetDescription\": \"Training dataset\",\n \"guardrails\": \"Safety guidelines\",\n \"facts\": {\n \"model\": \"gpt-4o\",\n \"temperature\": \"0.7\",\n \"promptVersion\": \"12\"\n },\n \"otelInputSourceRule\": {\n \"spanName\": \"ExecuteActivity:add_user_message\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"user\"\n }\n },\n \"otelOutputSourceRule\": {\n \"spanName\": \"ExecuteActivity:save_reply\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"assistant\"\n }\n },\n \"initializationEndpointConnectionId\": \"ec_123\",\n \"conversationEndpointConnectionId\": \"ec_123\",\n \"finalizationEndpointConnectionId\": \"ec_123\",\n \"phoneConnectionId\": \"phoneConnection_123\",\n \"webRtcConnectionId\": \"webRtcConnection_123\",\n \"parentVersionId\": \"ver_122\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.galtea.ai/versions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"userId\": \"user_123\",\n \"name\": \"support release\",\n \"description\": \"Version description\",\n \"modelId\": \"model_123\",\n \"systemPrompt\": \"You are a helpful assistant\",\n \"datasetUri\": \"https://example.com/dataset.csv\",\n \"datasetDescription\": \"Training dataset\",\n \"guardrails\": \"Safety guidelines\",\n \"facts\": {\n \"model\": \"gpt-4o\",\n \"temperature\": \"0.7\",\n \"promptVersion\": \"12\"\n },\n \"otelInputSourceRule\": {\n \"spanName\": \"ExecuteActivity:add_user_message\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"user\"\n }\n },\n \"otelOutputSourceRule\": {\n \"spanName\": \"ExecuteActivity:save_reply\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"assistant\"\n }\n },\n \"initializationEndpointConnectionId\": \"ec_123\",\n \"conversationEndpointConnectionId\": \"ec_123\",\n \"finalizationEndpointConnectionId\": \"ec_123\",\n \"phoneConnectionId\": \"phoneConnection_123\",\n \"webRtcConnectionId\": \"webRtcConnection_123\",\n \"parentVersionId\": \"ver_122\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/versions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"ver_123\",\n \"productId\": \"prod_123\",\n \"userId\": \"user_123\",\n \"name\": \"support release\",\n \"description\": \"Version description\",\n \"modelId\": \"model_123\",\n \"systemPrompt\": \"You are a helpful assistant\",\n \"datasetUri\": \"https://example.com/dataset.csv\",\n \"datasetDescription\": \"Training dataset\",\n \"guardrails\": \"Safety guidelines\",\n \"facts\": {\n \"model\": \"gpt-4o\",\n \"temperature\": \"0.7\",\n \"promptVersion\": \"12\"\n },\n \"otelInputSourceRule\": {\n \"spanName\": \"ExecuteActivity:add_user_message\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"user\"\n }\n },\n \"otelOutputSourceRule\": {\n \"spanName\": \"ExecuteActivity:save_reply\",\n \"attribute\": \"app.arguments\",\n \"path\": \"$[0].message.content\",\n \"predicate\": {\n \"path\": \"$[0].message.role\",\n \"equals\": \"assistant\"\n }\n },\n \"initializationEndpointConnectionId\": \"ec_123\",\n \"conversationEndpointConnectionId\": \"ec_123\",\n \"finalizationEndpointConnectionId\": \"ec_123\",\n \"phoneConnectionId\": \"phoneConnection_123\",\n \"webRtcConnectionId\": \"webRtcConnection_123\",\n \"parentVersionId\": \"ver_122\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"deletedAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "ver_123",
"productId": "prod_123",
"userId": "user_123",
"number": 7,
"name": "support release",
"description": "Version description",
"modelId": "model_123",
"systemPrompt": "You are a helpful assistant",
"datasetUri": "https://example.com/dataset.csv",
"datasetDescription": "Training dataset",
"guardrails": "Safety guidelines",
"facts": {
"model": "gpt-4o",
"temperature": "0.7",
"promptVersion": "12"
},
"otelInputSourceRule": {
"spanName": "ExecuteActivity:add_user_message",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "user"
}
},
"otelOutputSourceRule": {
"spanName": "ExecuteActivity:save_reply",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "assistant"
}
},
"initializationEndpointConnectionId": "ec_123",
"conversationEndpointConnectionId": "ec_123",
"finalizationEndpointConnectionId": "ec_123",
"phoneConnectionId": "phoneConnection_123",
"webRtcConnectionId": "webRtcConnection_123",
"parentVersionId": "ver_122",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Path Parameters
Version ID
Body
"ver_123"
"prod_123"
"user_123"
Optional human label. Omit it and the version is stored under its canonical label. A name of "v" followed by digits is rejected, because it reads as the number of another version. The one exception is the number this version is given, which produces the same result as omitting the name. "v1.0" is accepted.
"support release"
"Version description"
"model_123"
"You are a helpful assistant"
"https://example.com/dataset.csv"
"Training dataset"
"Safety guidelines"
The agent state this version represents, as a flat map of text to text. Every key and every value is trimmed, an entry whose key or value is then empty is dropped, and the rest is kept exactly, so "0.7" and "0.70" are two different facts. At most 32 keys, and at most 2000 bytes once the map is encoded as JSON, which counts its punctuation too. No key and no value may hold the NUL character or half of a surrogate pair. Two keys that become equal after the spaces around them are removed are refused, unless both become empty, which drops them instead because a blank key names no fact; a key repeated with the exact same spelling never reaches that rule, because JSON parsing keeps only its last value. Two live versions of one product may not hold the same facts; the key order you send does not change that comparison. A map that leaves no entry is stored as null.
Show child attributes
Show child attributes
{
"model": "gpt-4o",
"temperature": "0.7",
"promptVersion": "12"
}
Recover a turn's user-visible input for products whose user message lives on a non-LLM span. Set per product or version (version wins). Per span it applies only when no LLM input is present. Per turn the value it extracts IS the turn input, ahead of every fallback, and the turn input is EMPTY when the rule extracts nothing from any span of the turn. The two directions resolve independently.
Show child attributes
Show child attributes
{
"spanName": "ExecuteActivity:add_user_message",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "user"
}
}
Recover a turn's user-visible output for templated or non-LLM replies whose final answer lives on a non-LLM span. Set per product or version (version wins). Per span it applies only when no LLM output is present. Per turn the value it extracts IS the turn output, ahead of every fallback, and the turn output is EMPTY when the rule extracts nothing from any span of the turn. The two directions resolve independently.
Show child attributes
Show child attributes
{
"spanName": "ExecuteActivity:save_reply",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "assistant"
}
}
"ec_123"
"ec_123"
"ec_123"
The version's phone connection (telephony conversation target). At most one conversation target may be set across conversationEndpointConnectionId, phoneConnectionId, and webRtcConnectionId.
"phoneConnection_123"
The version's WebRTC connection (live two-way audio conversation target). At most one conversation target may be set across conversationEndpointConnectionId, phoneConnectionId, and webRtcConnectionId.
"webRtcConnection_123"
Id of the version this one was revised from (its direct parent in the revision lineage). On create, providing this value records the parent edge; the parent must belong to the same product. Omit or null to create a root version with no parent. On responses, this is the recorded parent edge (null for roots).
"ver_122"
Response
Version updated successfully
"ver_123"
"prod_123"
"user_123"
The version's sequence number inside its product. It starts at 1, is assigned when the version is created, never changes, and is never reused after a version is deleted. The canonical label is "v" followed by this number.
x >= 17
Optional human label. Omit it and the version is stored under its canonical label. A name of "v" followed by digits is rejected, because it reads as the number of another version. The one exception is the number this version is given, which produces the same result as omitting the name. "v1.0" is accepted.
"support release"
"Version description"
"model_123"
"You are a helpful assistant"
"https://example.com/dataset.csv"
"Training dataset"
"Safety guidelines"
The agent state this version represents, as a flat map of text to text. Every key and every value is trimmed, an entry whose key or value is then empty is dropped, and the rest is kept exactly, so "0.7" and "0.70" are two different facts. At most 32 keys, and at most 2000 bytes once the map is encoded as JSON, which counts its punctuation too. No key and no value may hold the NUL character or half of a surrogate pair. Two keys that become equal after the spaces around them are removed are refused, unless both become empty, which drops them instead because a blank key names no fact; a key repeated with the exact same spelling never reaches that rule, because JSON parsing keeps only its last value. Two live versions of one product may not hold the same facts; the key order you send does not change that comparison. A map that leaves no entry is stored as null.
Show child attributes
Show child attributes
{
"model": "gpt-4o",
"temperature": "0.7",
"promptVersion": "12"
}
Recover a turn's user-visible input for products whose user message lives on a non-LLM span. Set per product or version (version wins). Per span it applies only when no LLM input is present. Per turn the value it extracts IS the turn input, ahead of every fallback, and the turn input is EMPTY when the rule extracts nothing from any span of the turn. The two directions resolve independently.
Show child attributes
Show child attributes
{
"spanName": "ExecuteActivity:add_user_message",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "user"
}
}
Recover a turn's user-visible output for templated or non-LLM replies whose final answer lives on a non-LLM span. Set per product or version (version wins). Per span it applies only when no LLM output is present. Per turn the value it extracts IS the turn output, ahead of every fallback, and the turn output is EMPTY when the rule extracts nothing from any span of the turn. The two directions resolve independently.
Show child attributes
Show child attributes
{
"spanName": "ExecuteActivity:save_reply",
"attribute": "app.arguments",
"path": "$[0].message.content",
"predicate": {
"path": "$[0].message.role",
"equals": "assistant"
}
}
"ec_123"
"ec_123"
"ec_123"
The version's phone connection (telephony conversation target). At most one conversation target may be set across conversationEndpointConnectionId, phoneConnectionId, and webRtcConnectionId.
"phoneConnection_123"
The version's WebRTC connection (live two-way audio conversation target). At most one conversation target may be set across conversationEndpointConnectionId, phoneConnectionId, and webRtcConnectionId.
"webRtcConnection_123"
Id of the version this one was revised from (its direct parent in the revision lineage). On create, providing this value records the parent edge; the parent must belong to the same product. Omit or null to create a root version with no parent. On responses, this is the recorded parent edge (null for roots).
"ver_122"