Easybeam Backend API

Agent

processAgent

Get a chat completion from an agent

This endpoint processes a chat interaction with a specified agent. It supports both streaming and non-streaming operations based on the provided parameters.


/agent/{id}

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"https://api.easybeam.ai/v1/agent/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AgentApi;

import java.io.File;
import java.util.*;

public class AgentApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        AgentApi apiInstance = new AgentApi();
        GetAgentRequest body = {
  "summary" : "Sample request",
  "value" : {
    "variables" : {
      "keyA" : "valueA",
      "keyB" : "valueB"
    },
    "chatId" : "chat-12345",
    "messages" : [ {
      "content" : "Can you help me with this task?",
      "role" : "USER",
      "createdAt" : "2024-04-27T13:00:00Z",
      "id" : "msg-3"
    } ],
    "stream" : false,
    "userId" : "user-67890",
    "consolidateStream" : true,
    "userSecrets" : { }
  }
}; // GetAgentRequest | Payload containing the chat details and parameters for processing the agent interaction
        String id = id_example; // String | Unique identifier for the agent
        try {
            GetChatResponse result = apiInstance.processAgent(body, id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AgentApi#processAgent");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AgentApi;

public class AgentApiExample {

    public static void main(String[] args) {
        AgentApi apiInstance = new AgentApi();
        GetAgentRequest body = {
  "summary" : "Sample request",
  "value" : {
    "variables" : {
      "keyA" : "valueA",
      "keyB" : "valueB"
    },
    "chatId" : "chat-12345",
    "messages" : [ {
      "content" : "Can you help me with this task?",
      "role" : "USER",
      "createdAt" : "2024-04-27T13:00:00Z",
      "id" : "msg-3"
    } ],
    "stream" : false,
    "userId" : "user-67890",
    "consolidateStream" : true,
    "userSecrets" : { }
  }
}; // GetAgentRequest | Payload containing the chat details and parameters for processing the agent interaction
        String id = id_example; // String | Unique identifier for the agent
        try {
            GetChatResponse result = apiInstance.processAgent(body, id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AgentApi#processAgent");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
GetAgentRequest *body = {
  "summary" : "Sample request",
  "value" : {
    "variables" : {
      "keyA" : "valueA",
      "keyB" : "valueB"
    },
    "chatId" : "chat-12345",
    "messages" : [ {
      "content" : "Can you help me with this task?",
      "role" : "USER",
      "createdAt" : "2024-04-27T13:00:00Z",
      "id" : "msg-3"
    } ],
    "stream" : false,
    "userId" : "user-67890",
    "consolidateStream" : true,
    "userSecrets" : { }
  }
}; // Payload containing the chat details and parameters for processing the agent interaction
String *id = id_example; // Unique identifier for the agent

AgentApi *apiInstance = [[AgentApi alloc] init];

// Get a chat completion from an agent
[apiInstance processAgentWith:body
    id:id
              completionHandler: ^(GetChatResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var EasybeamBackendApi = require('easybeam_backend_api');
var defaultClient = EasybeamBackendApi.ApiClient.instance;


var api = new EasybeamBackendApi.AgentApi()
var body = {
  "summary" : "Sample request",
  "value" : {
    "variables" : {
      "keyA" : "valueA",
      "keyB" : "valueB"
    },
    "chatId" : "chat-12345",
    "messages" : [ {
      "content" : "Can you help me with this task?",
      "role" : "USER",
      "createdAt" : "2024-04-27T13:00:00Z",
      "id" : "msg-3"
    } ],
    "stream" : false,
    "userId" : "user-67890",
    "consolidateStream" : true,
    "userSecrets" : { }
  }
}; // {{GetAgentRequest}} Payload containing the chat details and parameters for processing the agent interaction
var id = id_example; // {{String}} Unique identifier for the agent

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.processAgent(bodyid, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class processAgentExample
    {
        public void main()
        {


            var apiInstance = new AgentApi();
            var body = new GetAgentRequest(); // GetAgentRequest | Payload containing the chat details and parameters for processing the agent interaction
            var id = id_example;  // String | Unique identifier for the agent

            try
            {
                // Get a chat completion from an agent
                GetChatResponse result = apiInstance.processAgent(body, id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AgentApi.processAgent: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiAgentApi();
$body = {
  "summary" : "Sample request",
  "value" : {
    "variables" : {
      "keyA" : "valueA",
      "keyB" : "valueB"
    },
    "chatId" : "chat-12345",
    "messages" : [ {
      "content" : "Can you help me with this task?",
      "role" : "USER",
      "createdAt" : "2024-04-27T13:00:00Z",
      "id" : "msg-3"
    } ],
    "stream" : false,
    "userId" : "user-67890",
    "consolidateStream" : true,
    "userSecrets" : { }
  }
}; // GetAgentRequest | Payload containing the chat details and parameters for processing the agent interaction
$id = id_example; // String | Unique identifier for the agent

try {
    $result = $api_instance->processAgent($body, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AgentApi->processAgent: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AgentApi;


my $api_instance = WWW::SwaggerClient::AgentApi->new();
my $body = WWW::SwaggerClient::Object::GetAgentRequest->new(); # GetAgentRequest | Payload containing the chat details and parameters for processing the agent interaction
my $id = id_example; # String | Unique identifier for the agent

eval { 
    my $result = $api_instance->processAgent(body => $body, id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AgentApi->processAgent: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.AgentApi()
body = {
  "summary" : "Sample request",
  "value" : {
    "variables" : {
      "keyA" : "valueA",
      "keyB" : "valueB"
    },
    "chatId" : "chat-12345",
    "messages" : [ {
      "content" : "Can you help me with this task?",
      "role" : "USER",
      "createdAt" : "2024-04-27T13:00:00Z",
      "id" : "msg-3"
    } ],
    "stream" : false,
    "userId" : "user-67890",
    "consolidateStream" : true,
    "userSecrets" : { }
  }
} # GetAgentRequest | Payload containing the chat details and parameters for processing the agent interaction
id = id_example # String | Unique identifier for the agent

try: 
    # Get a chat completion from an agent
    api_response = api_instance.process_agent(body, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AgentApi->processAgent: %s\n" % e)

Parameters

Path parameters
Name Description
id*
String
Unique identifier for the agent
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Agent interaction successful

Status: 400 -

Status: 401 -


Prompt

processPrompt

Get a chat completion from a prompt

This endpoint processes a chat interaction within a specified prompt. It can handle both streaming and non-streaming requests based on the input parameters. For demo purposes, use the prompt ID "LZS15".


/prompt/{id}

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"https://api.easybeam.ai/v1/prompt/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PromptApi;

import java.io.File;
import java.util.*;

public class PromptApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        PromptApi apiInstance = new PromptApi();
        GetChatRequest body = {
  "summary" : "Demo request",
  "value" : {
    "variables" : {
      "animal" : "aardvark"
    },
    "chatId" : null,
    "messages" : [ ],
    "stream" : false,
    "userId" : "demo-user-123",
    "consolidateStream" : false
  }
}; // GetChatRequest | Payload containing the chat details and parameters for processing
        String id = id_example; // String | Unique identifier for the prompt. Use "LZS15" for demo testing.
        try {
            GetChatResponse result = apiInstance.processPrompt(body, id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PromptApi#processPrompt");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.PromptApi;

public class PromptApiExample {

    public static void main(String[] args) {
        PromptApi apiInstance = new PromptApi();
        GetChatRequest body = {
  "summary" : "Demo request",
  "value" : {
    "variables" : {
      "animal" : "aardvark"
    },
    "chatId" : null,
    "messages" : [ ],
    "stream" : false,
    "userId" : "demo-user-123",
    "consolidateStream" : false
  }
}; // GetChatRequest | Payload containing the chat details and parameters for processing
        String id = id_example; // String | Unique identifier for the prompt. Use "LZS15" for demo testing.
        try {
            GetChatResponse result = apiInstance.processPrompt(body, id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PromptApi#processPrompt");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
GetChatRequest *body = {
  "summary" : "Demo request",
  "value" : {
    "variables" : {
      "animal" : "aardvark"
    },
    "chatId" : null,
    "messages" : [ ],
    "stream" : false,
    "userId" : "demo-user-123",
    "consolidateStream" : false
  }
}; // Payload containing the chat details and parameters for processing
String *id = id_example; // Unique identifier for the prompt. Use "LZS15" for demo testing.

PromptApi *apiInstance = [[PromptApi alloc] init];

// Get a chat completion from a prompt
[apiInstance processPromptWith:body
    id:id
              completionHandler: ^(GetChatResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var EasybeamBackendApi = require('easybeam_backend_api');
var defaultClient = EasybeamBackendApi.ApiClient.instance;


var api = new EasybeamBackendApi.PromptApi()
var body = {
  "summary" : "Demo request",
  "value" : {
    "variables" : {
      "animal" : "aardvark"
    },
    "chatId" : null,
    "messages" : [ ],
    "stream" : false,
    "userId" : "demo-user-123",
    "consolidateStream" : false
  }
}; // {{GetChatRequest}} Payload containing the chat details and parameters for processing
var id = id_example; // {{String}} Unique identifier for the prompt. Use "LZS15" for demo testing.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.processPrompt(bodyid, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class processPromptExample
    {
        public void main()
        {


            var apiInstance = new PromptApi();
            var body = new GetChatRequest(); // GetChatRequest | Payload containing the chat details and parameters for processing
            var id = id_example;  // String | Unique identifier for the prompt. Use "LZS15" for demo testing.

            try
            {
                // Get a chat completion from a prompt
                GetChatResponse result = apiInstance.processPrompt(body, id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling PromptApi.processPrompt: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiPromptApi();
$body = {
  "summary" : "Demo request",
  "value" : {
    "variables" : {
      "animal" : "aardvark"
    },
    "chatId" : null,
    "messages" : [ ],
    "stream" : false,
    "userId" : "demo-user-123",
    "consolidateStream" : false
  }
}; // GetChatRequest | Payload containing the chat details and parameters for processing
$id = id_example; // String | Unique identifier for the prompt. Use "LZS15" for demo testing.

try {
    $result = $api_instance->processPrompt($body, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PromptApi->processPrompt: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PromptApi;


my $api_instance = WWW::SwaggerClient::PromptApi->new();
my $body = WWW::SwaggerClient::Object::GetChatRequest->new(); # GetChatRequest | Payload containing the chat details and parameters for processing
my $id = id_example; # String | Unique identifier for the prompt. Use "LZS15" for demo testing.

eval { 
    my $result = $api_instance->processPrompt(body => $body, id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PromptApi->processPrompt: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.PromptApi()
body = {
  "summary" : "Demo request",
  "value" : {
    "variables" : {
      "animal" : "aardvark"
    },
    "chatId" : null,
    "messages" : [ ],
    "stream" : false,
    "userId" : "demo-user-123",
    "consolidateStream" : false
  }
} # GetChatRequest | Payload containing the chat details and parameters for processing
id = id_example # String | Unique identifier for the prompt. Use "LZS15" for demo testing.

try: 
    # Get a chat completion from a prompt
    api_response = api_instance.process_prompt(body, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PromptApi->processPrompt: %s\n" % e)

Parameters

Path parameters
Name Description
id*
String
Unique identifier for the prompt. Use "LZS15" for demo testing.
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Prompt interaction successful

Status: 400 -

Status: 401 -


Review

submitReview

Submit a review

This endpoint allows users to submit reviews based on their chat interactions. It records the review score and optional textual feedback.


/review

Usage and SDK Samples

curl -X POST\
 -H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"https://api.easybeam.ai/v1/review"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ReviewApi;

import java.io.File;
import java.util.*;

public class ReviewApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();


        ReviewApi apiInstance = new ReviewApi();
        ReviewRequest body = {
  "summary" : "Sample review submission",
  "value" : {
    "chatId" : "chat-67890",
    "reviewScore" : 4.5,
    "reviewText" : "Great assistance, very helpful!",
    "userId" : "user-54321"
  }
}; // ReviewRequest | Review details submitted by the user
        try {
            SuccessResponse result = apiInstance.submitReview(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ReviewApi#submitReview");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ReviewApi;

public class ReviewApiExample {

    public static void main(String[] args) {
        ReviewApi apiInstance = new ReviewApi();
        ReviewRequest body = {
  "summary" : "Sample review submission",
  "value" : {
    "chatId" : "chat-67890",
    "reviewScore" : 4.5,
    "reviewText" : "Great assistance, very helpful!",
    "userId" : "user-54321"
  }
}; // ReviewRequest | Review details submitted by the user
        try {
            SuccessResponse result = apiInstance.submitReview(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ReviewApi#submitReview");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
ReviewRequest *body = {
  "summary" : "Sample review submission",
  "value" : {
    "chatId" : "chat-67890",
    "reviewScore" : 4.5,
    "reviewText" : "Great assistance, very helpful!",
    "userId" : "user-54321"
  }
}; // Review details submitted by the user

ReviewApi *apiInstance = [[ReviewApi alloc] init];

// Submit a review
[apiInstance submitReviewWith:body
              completionHandler: ^(SuccessResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var EasybeamBackendApi = require('easybeam_backend_api');
var defaultClient = EasybeamBackendApi.ApiClient.instance;


var api = new EasybeamBackendApi.ReviewApi()
var body = {
  "summary" : "Sample review submission",
  "value" : {
    "chatId" : "chat-67890",
    "reviewScore" : 4.5,
    "reviewText" : "Great assistance, very helpful!",
    "userId" : "user-54321"
  }
}; // {{ReviewRequest}} Review details submitted by the user

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.submitReview(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class submitReviewExample
    {
        public void main()
        {


            var apiInstance = new ReviewApi();
            var body = new ReviewRequest(); // ReviewRequest | Review details submitted by the user

            try
            {
                // Submit a review
                SuccessResponse result = apiInstance.submitReview(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ReviewApi.submitReview: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');


$api_instance = new Swagger\Client\ApiReviewApi();
$body = {
  "summary" : "Sample review submission",
  "value" : {
    "chatId" : "chat-67890",
    "reviewScore" : 4.5,
    "reviewText" : "Great assistance, very helpful!",
    "userId" : "user-54321"
  }
}; // ReviewRequest | Review details submitted by the user

try {
    $result = $api_instance->submitReview($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ReviewApi->submitReview: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ReviewApi;


my $api_instance = WWW::SwaggerClient::ReviewApi->new();
my $body = WWW::SwaggerClient::Object::ReviewRequest->new(); # ReviewRequest | Review details submitted by the user

eval { 
    my $result = $api_instance->submitReview(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ReviewApi->submitReview: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = swagger_client.ReviewApi()
body = {
  "summary" : "Sample review submission",
  "value" : {
    "chatId" : "chat-67890",
    "reviewScore" : 4.5,
    "reviewText" : "Great assistance, very helpful!",
    "userId" : "user-54321"
  }
} # ReviewRequest | Review details submitted by the user

try: 
    # Submit a review
    api_response = api_instance.submit_review(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReviewApi->submitReview: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - Review submitted successfully

Status: 400 -