Python
# To use the Python SDK, install the package:
# pip install memobase
from memobase import MemoBaseClient
from memobase.core.blob import BlobType
client = MemoBaseClient(project_url='PROJECT_URL', api_key='PROJECT_TOKEN')
user = client.get_user('user_id')
blobs = user.buffer(BlobType.chat)// To use the Go SDK, install the package:
// go get github.com/memodb-io/memobase/src/client/memobase-go@latest
import (
"fmt"
"log"
"github.com/memodb-io/memobase/src/client/memobase-go/blob"
"github.com/memodb-io/memobase/src/client/memobase-go/core"
)
func main() {
projectURL := "YOUR_PROJECT_URL"
apiKey := "YOUR_API_KEY"
// Initialize the client
client, err := core.NewMemoBaseClient(
projectURL,
apiKey,
)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Get a user
userID := "EXISTING_USER_ID" // Replace with an actual user ID
user, err := client.GetUser(userID, false)
if err != nil {
log.Fatalf("Failed to get user: %v", err)
}
// Get buffer capacity
blobIDs, err := user.Buffer(blob.ChatType, "processing")
if err != nil {
log.Fatalf("Failed to get buffer capacity: %v", err)
}
fmt.Printf("Found %d blobs in buffer
", len(blobIDs))
}
curl --request GET \
--url https://api.memobase.dev/api/v1/users/buffer/capacity/{user_id}/{buffer_type} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.memobase.dev/api/v1/users/buffer/capacity/{user_id}/{buffer_type}', 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.memobase.dev/api/v1/users/buffer/capacity/{user_id}/{buffer_type}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.memobase.dev/api/v1/users/buffer/capacity/{user_id}/{buffer_type}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memobase.dev/api/v1/users/buffer/capacity/{user_id}/{buffer_type}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"ids": [
"<string>"
]
},
"errno": 0,
"errmsg": ""
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}User Buffer
Get Buffer Ids
Get processing buffer ids
GET
/
api
/
v1
/
users
/
buffer
/
capacity
/
{user_id}
/
{buffer_type}
Python
# To use the Python SDK, install the package:
# pip install memobase
from memobase import MemoBaseClient
from memobase.core.blob import BlobType
client = MemoBaseClient(project_url='PROJECT_URL', api_key='PROJECT_TOKEN')
user = client.get_user('user_id')
blobs = user.buffer(BlobType.chat)// To use the Go SDK, install the package:
// go get github.com/memodb-io/memobase/src/client/memobase-go@latest
import (
"fmt"
"log"
"github.com/memodb-io/memobase/src/client/memobase-go/blob"
"github.com/memodb-io/memobase/src/client/memobase-go/core"
)
func main() {
projectURL := "YOUR_PROJECT_URL"
apiKey := "YOUR_API_KEY"
// Initialize the client
client, err := core.NewMemoBaseClient(
projectURL,
apiKey,
)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Get a user
userID := "EXISTING_USER_ID" // Replace with an actual user ID
user, err := client.GetUser(userID, false)
if err != nil {
log.Fatalf("Failed to get user: %v", err)
}
// Get buffer capacity
blobIDs, err := user.Buffer(blob.ChatType, "processing")
if err != nil {
log.Fatalf("Failed to get buffer capacity: %v", err)
}
fmt.Printf("Found %d blobs in buffer
", len(blobIDs))
}
curl --request GET \
--url https://api.memobase.dev/api/v1/users/buffer/capacity/{user_id}/{buffer_type} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.memobase.dev/api/v1/users/buffer/capacity/{user_id}/{buffer_type}', 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.memobase.dev/api/v1/users/buffer/capacity/{user_id}/{buffer_type}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.memobase.dev/api/v1/users/buffer/capacity/{user_id}/{buffer_type}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memobase.dev/api/v1/users/buffer/capacity/{user_id}/{buffer_type}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"ids": [
"<string>"
]
},
"errno": 0,
"errmsg": ""
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get the ids of the buffer for a specific user and buffer type. This endpoint returns buffer ids.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the user
The type of buffer to flush
Available options:
chat, summary, doc, image, code, transcript Query Parameters
The status of the buffer to get
Available options:
idle, processing, failed, done Response
Successful Response
⌘I