-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicSubmit.cs
More file actions
25 lines (22 loc) · 840 Bytes
/
BasicSubmit.cs
File metadata and controls
25 lines (22 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using System.Text.Json.Nodes;
using Axme.Sdk;
var client = new AxmeClient(new AxmeClientConfig
{
ApiKey = Environment.GetEnvironmentVariable("AXME_API_KEY") ?? "",
BaseUrl = Environment.GetEnvironmentVariable("AXME_BASE_URL"),
});
var created = await client.CreateIntentAsync(new JsonObject
{
["intent_type"] = "intent.demo.v1",
["correlation_id"] = Guid.NewGuid().ToString(),
["to_agent"] = "agent://acme-corp/production/target",
["payload"] = new JsonObject { ["task"] = "hello-from-dotnet" },
});
var current = await client.GetIntentAsync(created["intent_id"]?.ToString() ?? "");
var intent = current["intent"]?.AsObject();
var status = intent?["status"]?.ToString()
?? intent?["lifecycle_status"]?.ToString()
?? current["status"]?.ToString()
?? "UNKNOWN";
Console.WriteLine(status);