Skip to main content

AiServicesClient

Namespace: Meshmakers.Octo.Sdk.ServiceClient.AiServices

REST client for the OctoMesh AI Adapter. Covers the tenant-scoped enable / disable lifecycle and the credential endpoints; session and quota operations live behind the SignalR hub and are not projected to the SDK client.

public class AiServicesClient : ServiceClient, IServiceClient, IAiServicesClient

Inheritance Object → ServiceClient → AiServicesClient
Implements IServiceClient, IAiServicesClient

Properties​

Options​

Returns the options for configuration of the client proxy.

public ServiceClientOptions Options { get; }

Property Value​

ServiceClientOptions

AccessToken​

public IServiceClientAccessToken AccessToken { get; }

Property Value​

IServiceClientAccessToken

ServiceUri​

public Uri ServiceUri { get; }

Property Value​

Uri

Constructors​

AiServicesClient(IOptions<AiServiceClientOptions>, IAiServiceClientAccessToken)​

Constructor.

public AiServicesClient(IOptions<AiServiceClientOptions> serviceClientOptions, IAiServiceClientAccessToken accessToken)

Parameters​

serviceClientOptions IOptions<AiServiceClientOptions>
Options for configuration of the client proxy.

accessToken IAiServiceClientAccessToken
The access token management object.

AiServicesClient(AiServiceClientOptions, IAiServiceClientAccessToken)​

Constructor.

public AiServicesClient(AiServiceClientOptions serviceClientOptions, IAiServiceClientAccessToken accessToken)

Parameters​

serviceClientOptions AiServiceClientOptions
Options for configuration of the client proxy.

accessToken IAiServiceClientAccessToken
The access token management object.

Methods​

BuildServiceUri()​

protected Uri BuildServiceUri()

Returns​

Uri

Remarks:

🔴 Tenant-scoped only since stage 3 of AB#5060. This used to fall back to the literal system segment when AiServiceClientOptions.TenantId was blank, and EnableAsync / DisableAsync then sent their tenant as ?tenantId=. The service's tenant gate reads the route value, so that shape was invisible to it. Both the fallback here and the System actions behind it are gone; this client now behaves like the Communication, Reporting and StreamData clients did after AB#4287 and requires a tenant.

The fallback was already unreachable from every caller: EnableAsync validates its tenantId argument, and octo-cli passes the very option that decided the fallback — so a blank tenant threw before a request was built rather than producing a System call.

EnableAsync(String)​

public Task EnableAsync(string tenantId)

Parameters​

tenantId String

Returns​

Task

Remarks:

tenantId is validated but does not select the target: the tenant comes from AiServiceClientOptions.TenantId via the route segment. Every caller passes that same option today. Enabling a different tenant than the client is configured for would need the per-call URL shape BotServicesClient uses — and deliberately does not exist here, because enable / disable is a capability toggle that belongs to the tenant's own administrator, not to a parent administering it.

DisableAsync(String)​

public Task DisableAsync(string tenantId)

Parameters​

tenantId String

Returns​

Task

Remarks:

See AiServicesClient.EnableAsync(String) on why the argument does not select the target.

RedeemTicketAsync(String, String, String, String, DateTime, DateTime)​

public Task<CredentialsStatusDto> RedeemTicketAsync(string tenantId, string code, string accessToken, string refreshToken, DateTime accessExpiresAt, DateTime refreshExpiresAt)

Parameters​

tenantId String

code String

accessToken String

refreshToken String

accessExpiresAt DateTime

refreshExpiresAt DateTime

Returns​

Task<CredentialsStatusDto>

GetCredentialsStatusAsync()​

public Task<CredentialsStatusDto> GetCredentialsStatusAsync()

Returns​

Task<CredentialsStatusDto>

RevokeCredentialsAsync()​

public Task<CredentialsStatusDto> RevokeCredentialsAsync()

Returns​

Task<CredentialsStatusDto>