Table of Contents

Class UserProfileService

Namespace
FoundationaLLM.Common.Services.Users
Assembly
FoundationaLLM.Common.dll

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

public class UserProfileService : IUserProfileService
Inheritance
UserProfileService
Implements
Inherited Members
Extension Methods

Constructors

UserProfileService(IAzureCosmosDBService, ILogger<UserProfileService>, IOrchestrationContext)

Initializes a new instance of the UserProfileService class.

public UserProfileService(IAzureCosmosDBService cosmosDBService, ILogger<UserProfileService> logger, IOrchestrationContext callContext)

Parameters

cosmosDBService IAzureCosmosDBService

The Azure Cosmos DB service that contains user profiles.

logger ILogger<UserProfileService>

The logging interface used to log under the UserProfileService type name.

callContext IOrchestrationContext

Contains contextual data for the calling service.

Methods

AddAgent(string, string)

Adds an agent to the user's profile.

public Task AddAgent(string instanceId, string agentObjectId)

Parameters

instanceId string

The FoundationaLLM instance identifier.

agentObjectId string

The object identifier of the agent to add.

Returns

Task

GetUserProfileAsync(string)

Returns the user profile of the signed in user.

public Task<UserProfile?> GetUserProfileAsync(string instanceId)

Parameters

instanceId string

The instance ID.

Returns

Task<UserProfile>

Exceptions

InvalidOperationException

GetUserProfileForUserAsync(string, string)

Returns the user profile of the specified user.

public Task<UserProfile?> GetUserProfileForUserAsync(string instanceId, string upn)

Parameters

instanceId string

The instance ID.

upn string

The user principal name of the user for whom to return the user profile.

Returns

Task<UserProfile>

RemoveAgent(string, string)

Removes an agent to the user's profile.

public Task RemoveAgent(string instanceId, string agentObjectId)

Parameters

instanceId string

The FoundationaLLM instance identifier.

agentObjectId string

The object identifier of the agent to remove.

Returns

Task

UpsertUserProfileAsync(string, UserProfile)

Inserts or updates a user profile.

public Task UpsertUserProfileAsync(string instanceId, UserProfile userProfile)

Parameters

instanceId string

The instance ID.

userProfile UserProfile

The user profile to upsert.

Returns

Task

Exceptions

InvalidOperationException