processPortal
Get a chat completion from a portal
This endpoint processes a chat interaction within a specified portal. It can handle both streaming and non-streaming requests based on the input parameters. For demo purposes, use the portal ID "LZS15".
/portal/{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/portal/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PortalApi;
import java.io.File;
import java.util.*;
public class PortalApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
PortalApi apiInstance = new PortalApi();
GetPortalRequest body = {
"summary" : "Demo request",
"value" : {
"variables" : {
"animal" : "aardvark"
},
"chatId" : null,
"messages" : [ ],
"stream" : false,
"userId" : "demo-user-123",
"consolidateStream" : false
}
}; // GetPortalRequest | Payload containing the chat details and parameters for processing
String id = id_example; // String | Unique identifier for the portal. Use "LZS15" for demo testing.
try {
GetPortalResponse result = apiInstance.processPortal(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PortalApi#processPortal");
e.printStackTrace();
}
}
}
import io.swagger.client.api.PortalApi;
public class PortalApiExample {
public static void main(String[] args) {
PortalApi apiInstance = new PortalApi();
GetPortalRequest body = {
"summary" : "Demo request",
"value" : {
"variables" : {
"animal" : "aardvark"
},
"chatId" : null,
"messages" : [ ],
"stream" : false,
"userId" : "demo-user-123",
"consolidateStream" : false
}
}; // GetPortalRequest | Payload containing the chat details and parameters for processing
String id = id_example; // String | Unique identifier for the portal. Use "LZS15" for demo testing.
try {
GetPortalResponse result = apiInstance.processPortal(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PortalApi#processPortal");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
GetPortalRequest *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 portal. Use "LZS15" for demo testing.
PortalApi *apiInstance = [[PortalApi alloc] init];
// Get a chat completion from a portal
[apiInstance processPortalWith:body
id:id
completionHandler: ^(GetPortalResponse 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.PortalApi()
var body = {
"summary" : "Demo request",
"value" : {
"variables" : {
"animal" : "aardvark"
},
"chatId" : null,
"messages" : [ ],
"stream" : false,
"userId" : "demo-user-123",
"consolidateStream" : false
}
}; // {{GetPortalRequest}} Payload containing the chat details and parameters for processing
var id = id_example; // {{String}} Unique identifier for the portal. 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.processPortal(bodyid, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class processPortalExample
{
public void main()
{
var apiInstance = new PortalApi();
var body = new GetPortalRequest(); // GetPortalRequest | Payload containing the chat details and parameters for processing
var id = id_example; // String | Unique identifier for the portal. Use "LZS15" for demo testing.
try
{
// Get a chat completion from a portal
GetPortalResponse result = apiInstance.processPortal(body, id);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PortalApi.processPortal: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiPortalApi();
$body = {
"summary" : "Demo request",
"value" : {
"variables" : {
"animal" : "aardvark"
},
"chatId" : null,
"messages" : [ ],
"stream" : false,
"userId" : "demo-user-123",
"consolidateStream" : false
}
}; // GetPortalRequest | Payload containing the chat details and parameters for processing
$id = id_example; // String | Unique identifier for the portal. Use "LZS15" for demo testing.
try {
$result = $api_instance->processPortal($body, $id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PortalApi->processPortal: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PortalApi;
my $api_instance = WWW::SwaggerClient::PortalApi->new();
my $body = WWW::SwaggerClient::Object::GetPortalRequest->new(); # GetPortalRequest | Payload containing the chat details and parameters for processing
my $id = id_example; # String | Unique identifier for the portal. Use "LZS15" for demo testing.
eval {
my $result = $api_instance->processPortal(body => $body, id => $id);
print Dumper($result);
};
if ($@) {
warn "Exception when calling PortalApi->processPortal: $@\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.PortalApi()
body = {
"summary" : "Demo request",
"value" : {
"variables" : {
"animal" : "aardvark"
},
"chatId" : null,
"messages" : [ ],
"stream" : false,
"userId" : "demo-user-123",
"consolidateStream" : false
}
} # GetPortalRequest | Payload containing the chat details and parameters for processing
id = id_example # String | Unique identifier for the portal. Use "LZS15" for demo testing.
try:
# Get a chat completion from a portal
api_response = api_instance.process_portal(body, id)
pprint(api_response)
except ApiException as e:
print("Exception when calling PortalApi->processPortal: %s\n" % e)
Parameters
Path parameters
Name | Description |
---|---|
id* |
String
Unique identifier for the portal. Use "LZS15" for demo testing.
Required
|
Body parameters
Name | Description |
---|---|
body * |