Job.SubmitJobV2Async
Description
This API submits the job for execution in the AI Command Center and returns Task<JobInfo>
Signature [C#]
Task<JobInfo> SubmitJobV2Async(Dictionary<string, object> inputArgs, int processId, string logLevel = "Information", int? botId = null, bool isAssistanBuddyJob = false, string initiatorName = "", int? initiatorType = null);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
inputArgs | Dictionary<string, object> | Required | Specify the job input arguments. |
processId | int | Required | Specify the ProcessId to execute the job. |
botId | int? | Optional; null | Specify the bot Id to execute the job. |
logLevel | string | Optional; "Information" | Specify the job log level. |
isAssistanBuddyJob | bool | Optional; false | Specify the value that indicates whether the AssistantBuddy job is submitted. |
initiatorName | string | Optional; "" | Specify the job's initiator name. |
initiatorType | int? | Optional; null | Specify the initiator type of the job. |
Output
| Property | Description |
|---|---|
| Task<JobInfo> | Returns the information of a current job. |
Remarks
Use SubmitJobV2Async API to submit a job for execution based on specified Assistant or Smart Buddy Id and other job details from the connected AI Command Center.
Example
C#
public async Task SubmitJob()
{
IControlRoomContext context = LoginControlRoom();
try
{
int processId = 1;
int botId = 1;
string logLevel = "Information";
bool isAssistantBuddyJob = false;
string username = "tester";
Dictionary<string, object> inputArgs = new Dictionary<string, object>();
// Add entries whose names and types match the process input arguments.
JobInfo jobInfo = await context.Jobs.SubmitJobV2Async(inputArgs, processId, logLevel, botId, isAssistantBuddyJob, username);
Console.WriteLine("JobId: " + jobInfo.JobId + ", Output: " + jobInfo.Output);
}
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.