mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 13:41:38 +00:00
25 lines
789 B
C#
25 lines
789 B
C#
|
|
using AIStudio.Tools.Rust;
|
|||
|
|
|
|||
|
|
namespace AIStudio.Tools.Services;
|
|||
|
|
|
|||
|
|
public sealed partial class RustService
|
|||
|
|
{
|
|||
|
|
public async Task<QdrantInfo> GetQdrantInfo()
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(45));
|
|||
|
|
var response = await this.http.GetFromJsonAsync<QdrantInfo>("/system/qdrant/info", this.jsonRustSerializerOptions, cts.Token);
|
|||
|
|
return response;
|
|||
|
|
}
|
|||
|
|
catch (Exception e)
|
|||
|
|
{
|
|||
|
|
if(this.logger is not null)
|
|||
|
|
this.logger.LogError(e, "Error while fetching Qdrant info from Rust service.");
|
|||
|
|
else
|
|||
|
|
Console.WriteLine($"Error while fetching Qdrant info from Rust service: '{e}'.");
|
|||
|
|
|
|||
|
|
return default;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|