Python
import os
from meibel import MeibelClient
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
session = client.sessions.get(session_id="sess_7f3a9c2e1b8d")
print(f"Agent: {session.agent_name} ({session.status})")
for message in session.messages:
print(f"[{message.timestamp}] {message.role}: {message.message}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const session = await client.sessions.get("sess_8f3a2b1c9d");
console.log(`${session.agent_name} (${session.status})`);
console.log(`Messages: ${session.messages.length}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
session, err := client.Sessions.Get(context.Background(), "session_abc123")
if err != nil {
panic(err)
}
fmt.Printf("Agent: %s, Status: %s\n", *session.AgentName, session.Status)
}curl --request GET \
--url https://api.meibel.ai/v2/sessions/{session_id} \
--header 'Meibel-API-Key: <api-key>'const options = {method: 'GET', headers: {'Meibel-API-Key': '<api-key>'}};
fetch('https://api.meibel.ai/v2/sessions/{session_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.meibel.ai/v2/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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.get("https://api.meibel.ai/v2/sessions/{session_id}")
.header("Meibel-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Meibel-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agent_id": "<string>",
"agent_name": "<string>",
"version": "<string>",
"status": "<string>",
"messages": [
{
"role": "<string>",
"message": "<string>",
"signal_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"tool_activity": [
{
"tool_id": "<string>",
"tool_call": {
"tool_name": "<string>",
"arguments": {},
"sequence": "<string>",
"timestamp": "<string>"
},
"tool_result": {
"tool_name": "<string>",
"sequence": "<string>",
"timestamp": "<string>",
"result": null
}
}
],
"token_usage": [
{}
],
"file_parsing": [
{
"file_id": "<string>",
"filename": "<string>",
"parse_start": {
"attempt": 123,
"timestamp": "<string>"
},
"parse_complete": {
"status": "<string>",
"bbox_count": 123,
"page_count": 123,
"content_type": "<string>",
"timestamp": "<string>",
"error": null
}
}
],
"result": [
{
"name": "<string>",
"file_type": "<string>",
"content": null
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Sessions
Get Session
GET
/
sessions
/
{session_id}
Python
import os
from meibel import MeibelClient
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
session = client.sessions.get(session_id="sess_7f3a9c2e1b8d")
print(f"Agent: {session.agent_name} ({session.status})")
for message in session.messages:
print(f"[{message.timestamp}] {message.role}: {message.message}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const session = await client.sessions.get("sess_8f3a2b1c9d");
console.log(`${session.agent_name} (${session.status})`);
console.log(`Messages: ${session.messages.length}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
session, err := client.Sessions.Get(context.Background(), "session_abc123")
if err != nil {
panic(err)
}
fmt.Printf("Agent: %s, Status: %s\n", *session.AgentName, session.Status)
}curl --request GET \
--url https://api.meibel.ai/v2/sessions/{session_id} \
--header 'Meibel-API-Key: <api-key>'const options = {method: 'GET', headers: {'Meibel-API-Key': '<api-key>'}};
fetch('https://api.meibel.ai/v2/sessions/{session_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.meibel.ai/v2/sessions/{session_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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.get("https://api.meibel.ai/v2/sessions/{session_id}")
.header("Meibel-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/sessions/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Meibel-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agent_id": "<string>",
"agent_name": "<string>",
"version": "<string>",
"status": "<string>",
"messages": [
{
"role": "<string>",
"message": "<string>",
"signal_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"tool_activity": [
{
"tool_id": "<string>",
"tool_call": {
"tool_name": "<string>",
"arguments": {},
"sequence": "<string>",
"timestamp": "<string>"
},
"tool_result": {
"tool_name": "<string>",
"sequence": "<string>",
"timestamp": "<string>",
"result": null
}
}
],
"token_usage": [
{}
],
"file_parsing": [
{
"file_id": "<string>",
"filename": "<string>",
"parse_start": {
"attempt": 123,
"timestamp": "<string>"
},
"parse_complete": {
"status": "<string>",
"bbox_count": 123,
"page_count": 123,
"content_type": "<string>",
"timestamp": "<string>",
"error": null
}
}
],
"result": [
{
"name": "<string>",
"file_type": "<string>",
"content": null
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Response
Successful Response
AgentExecutionDetailsResponse
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I