{
"Prompt": "my text",
"Index": "my_index",
"Model": "test1",
"History": [{
"Type": "System",
"Prompt": "some text"
}, {
"Type": "User",
"Prompt": "some text"
}, {
"Type": "Assistant",
"Prompt": "some text"
}
]
}
------------------------------------
{
"IsError": false,
"Error": null,
"Result": {
"Prompt": "the_prompt",
"Index": "my_index",
"Model": "test1",
"History": [{
"Type": "System",
"Prompt": "some text"
}, {
"Type": "User",
"Prompt": "some text"
}, {
"Type": "Assistant",
"Prompt": "some text"
}, {
"Type": "User",
"Prompt": "some text"
}, {
"Type": "Assistant",
"Prompt": "prompt result"
}
]
}
}
var client = new HttpClient(); var request = new HttpRequestMessage(); request.RequestUri = new Uri("http://localhost:8000/api/v1/bot/ChatBot-Widget"); request.Method = HttpMethod.Post; request.Headers.Add("Accept", "*/*"); request.Headers.Add("User-Agent", "Thunder Client (https://www.thunderclient.com)"); var bodyString = "{ \"question\": \"your_own_query\"}"; var content = new StringContent(bodyString, Encoding.UTF8, "application/json"); request.Content = content; var response = await client.SendAsync(request); var result = await response.Content.ReadAsStringAsync(); Console.WriteLine(result);