Python
import os
from meibel import MeibelClient
from meibel.models import PublishAgentDefinitionRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
response = client.agents.publish(
"agent_abc123",
PublishAgentDefinitionRequest(
commit_message="Improve fallback handling for unresolved customer intents",
),
)
print(f"Published version {response.version} at {response.published_at}")
print(f"AgentDefinition URN: {response.agent_definition_urn}")const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const published = await client.agents.publish("agent_abc123", {
commit_message: "Improved handling of refund requests and added escalation logic",
});
console.log(`${published.agent_name} v${published.version} published at ${published.published_at}`);package main
import (
"context"
"fmt"
"os"
"github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Agents.Publish(
context.Background(),
"agent_abc123",
v2.PublishAgentDefinitionRequest{
CommitMessage: "Improved refund handling and added escalation logic",
},
)
if err != nil {
panic(err)
}
fmt.Printf("Published version %s at %s\n", resp.Version, resp.PublishedAt)
}curl --request POST \
--url https://api.meibel.ai/v2/agents/{agent_id}/publish \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"commit_message": "<string>"
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({commit_message: '<string>'})
};
fetch('https://api.meibel.ai/v2/agents/{agent_id}/publish', 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.meibel.ai/v2/agents/{agent_id}/publish",
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([
'commit_message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/agents/{agent_id}/publish")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"commit_message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/agents/{agent_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"commit_message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agent_definition_urn": "<string>",
"agent_name": "<string>",
"version": "<string>",
"display_name": "<string>",
"commit_message": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"published_by": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Agents
Publish Agent
POST
/
agents
/
{agent_id}
/
publish
Python
import os
from meibel import MeibelClient
from meibel.models import PublishAgentDefinitionRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
response = client.agents.publish(
"agent_abc123",
PublishAgentDefinitionRequest(
commit_message="Improve fallback handling for unresolved customer intents",
),
)
print(f"Published version {response.version} at {response.published_at}")
print(f"AgentDefinition URN: {response.agent_definition_urn}")const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const published = await client.agents.publish("agent_abc123", {
commit_message: "Improved handling of refund requests and added escalation logic",
});
console.log(`${published.agent_name} v${published.version} published at ${published.published_at}`);package main
import (
"context"
"fmt"
"os"
"github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Agents.Publish(
context.Background(),
"agent_abc123",
v2.PublishAgentDefinitionRequest{
CommitMessage: "Improved refund handling and added escalation logic",
},
)
if err != nil {
panic(err)
}
fmt.Printf("Published version %s at %s\n", resp.Version, resp.PublishedAt)
}curl --request POST \
--url https://api.meibel.ai/v2/agents/{agent_id}/publish \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"commit_message": "<string>"
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({commit_message: '<string>'})
};
fetch('https://api.meibel.ai/v2/agents/{agent_id}/publish', 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.meibel.ai/v2/agents/{agent_id}/publish",
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([
'commit_message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/agents/{agent_id}/publish")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"commit_message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/agents/{agent_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"commit_message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agent_definition_urn": "<string>",
"agent_name": "<string>",
"version": "<string>",
"display_name": "<string>",
"commit_message": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"published_by": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Query Parameters
Bypass draft head validation and publish any version directly
Body
application/json
Request model for publishing the current draft of an agent.
User-provided description of what changed in this version
Response
Successful Response
Response model for a publish event.
Registry entry ID
Catalog URN of the published AgentDefinition version
Agent name
Published version slug
Display name of the published version
User-provided description of what changed in this version
Timestamp of the publish event
User who published
Was this page helpful?
⌘I