Appliquer l’environnement d’exécution personnalisé
curl --request PUT \
--url https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name} \
--header 'Content-Type: application/json' \
--data '
{
"base_url": "<string>",
"runtime_ids": [
{
"id": "<string>",
"max_tokens": 4096
}
],
"api_key_secret": "<string>",
"headers": {}
}
'import requests
url = "https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name}"
payload = {
"base_url": "<string>",
"runtime_ids": [
{
"id": "<string>",
"max_tokens": 4096
}
],
"api_key_secret": "<string>",
"headers": {}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
base_url: '<string>',
runtime_ids: [{id: '<string>', max_tokens: 4096}],
api_key_secret: '<string>',
headers: {}
})
};
fetch('https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name}', 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.example.com/v2/{entity}/{project}/runtimes/{runtime_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'base_url' => '<string>',
'runtime_ids' => [
[
'id' => '<string>',
'max_tokens' => 4096
]
],
'api_key_secret' => '<string>',
'headers' => [
]
]),
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 := "https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name}"
payload := strings.NewReader("{\n \"base_url\": \"<string>\",\n \"runtime_ids\": [\n {\n \"id\": \"<string>\",\n \"max_tokens\": 4096\n }\n ],\n \"api_key_secret\": \"<string>\",\n \"headers\": {}\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name}")
.header("Content-Type", "application/json")
.body("{\n \"base_url\": \"<string>\",\n \"runtime_ids\": [\n {\n \"id\": \"<string>\",\n \"max_tokens\": 4096\n }\n ],\n \"api_key_secret\": \"<string>\",\n \"headers\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"base_url\": \"<string>\",\n \"runtime_ids\": [\n {\n \"id\": \"<string>\",\n \"max_tokens\": 4096\n }\n ],\n \"api_key_secret\": \"<string>\",\n \"headers\": {}\n}"
response = http.request(request)
puts response.read_body{
"api_key_secret": "<string>",
"base_url": "<string>",
"headers": {},
"name": "<string>",
"runtime_ids": [
{
"id": "<string>",
"playground_id": "<string>",
"max_tokens": 4096
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Appliquer un environnement d’exécution personnalisé
Créez ou remplacez une configuration d’environnement d’exécution personnalisé.
PUT
/
v2
/
{entity}
/
{project}
/
runtimes
/
{runtime_name}
Appliquer l’environnement d’exécution personnalisé
curl --request PUT \
--url https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name} \
--header 'Content-Type: application/json' \
--data '
{
"base_url": "<string>",
"runtime_ids": [
{
"id": "<string>",
"max_tokens": 4096
}
],
"api_key_secret": "<string>",
"headers": {}
}
'import requests
url = "https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name}"
payload = {
"base_url": "<string>",
"runtime_ids": [
{
"id": "<string>",
"max_tokens": 4096
}
],
"api_key_secret": "<string>",
"headers": {}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
base_url: '<string>',
runtime_ids: [{id: '<string>', max_tokens: 4096}],
api_key_secret: '<string>',
headers: {}
})
};
fetch('https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name}', 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.example.com/v2/{entity}/{project}/runtimes/{runtime_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'base_url' => '<string>',
'runtime_ids' => [
[
'id' => '<string>',
'max_tokens' => 4096
]
],
'api_key_secret' => '<string>',
'headers' => [
]
]),
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 := "https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name}"
payload := strings.NewReader("{\n \"base_url\": \"<string>\",\n \"runtime_ids\": [\n {\n \"id\": \"<string>\",\n \"max_tokens\": 4096\n }\n ],\n \"api_key_secret\": \"<string>\",\n \"headers\": {}\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name}")
.header("Content-Type", "application/json")
.body("{\n \"base_url\": \"<string>\",\n \"runtime_ids\": [\n {\n \"id\": \"<string>\",\n \"max_tokens\": 4096\n }\n ],\n \"api_key_secret\": \"<string>\",\n \"headers\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/{entity}/{project}/runtimes/{runtime_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"base_url\": \"<string>\",\n \"runtime_ids\": [\n {\n \"id\": \"<string>\",\n \"max_tokens\": 4096\n }\n ],\n \"api_key_secret\": \"<string>\",\n \"headers\": {}\n}"
response = http.request(request)
puts response.read_body{
"api_key_secret": "<string>",
"base_url": "<string>",
"headers": {},
"name": "<string>",
"runtime_ids": [
{
"id": "<string>",
"playground_id": "<string>",
"max_tokens": 4096
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Paramètres de chemin
Nom stable de l’environnement d’exécution personnalisé à créer ou à remplacer
Required string length:
1 - 128Pattern:
^[^\s:]*(?::[^\s:]+)*:?$Corps
application/json
URL de base du point de terminaison public compatible avec OpenAI
Liste complète des ID souhaités exposés par le point de terminaison
Show child attributes
Show child attributes
Nom du secret de l’équipe utilisé comme clé API du point de terminaison ; jamais la valeur du secret
En-têtes littéraux transmis au point de terminaison
Show child attributes
Show child attributes
Cette page vous a-t-elle été utile ?