Bots.CreateBotAsync
Description
Creates a new Assistant Buddy inside the connected AI Command Center with the provided details
Signature [C#]
Task<BotInfo> CreateBotAsync(NewBotInfo botInfo);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
botInfo | NewBotInfo | Required | Details to create new bot of type NewBotInfo |
Output
| Property | Description |
|---|---|
| BotInfo | Returns newly created bot details. |
Remarks
Use the CreateBotAsync API to create a new Bot (Assistant Buddy) inside the connected AI Command Center.
Example
C#
public async Task CreateAssistantBuddy()
{
IControlRoomContext context = LoginControlRoom();
try
{
NewBotInfo newBotInfo = new NewBotInfo()
{
BotGuid = Guid.NewGuid().ToString("N"),
BotName = "IB-166",
Machine = "IB-166",
MachineKey = "8KL4-2E5E-C4CE-F826-3E79-0F5F-8BF6-B32A",
UserName = "tester",
ExecStatus = 1,
AppId = (int)AppName.AssistantBuddy
};
BotInfo botInfo = await context.Bots.CreateBotAsync(newBotInfo);
System.Console.WriteLine("Bot Name is " + 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.