Skip to main content
Version: Current

Bots.GetBotsAsync

Description​

The API gets the details of all the Assistant Buddies from the connected AI Command Center.

Signature [C#]​

Task<List<BotInfo>> GetBotsAsync();

Properties​

Output​

PropertyDescription
List<BotInfo>Returns the details of all the Assistant Buddies

Remarks​

Use GetBotsAsync API to return all available Assistant Buddies information from the AI Command Center.

Example​

C#
public async Task GetAssistantBuddies()
{
IControlRoomContext context = LoginControlRoom();
try
{
var assistantBuddies = await context.Bots.GetBotsAsync();
foreach (BotInfo botInfo in assistantBuddies)
Console.WriteLine("BotName: " + botInfo.BotName);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}

See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.