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, IEnumerable<IResourceProviderService>)
Initializes a new instance of the UserProfileService class.
public UserProfileService(IAzureCosmosDBService cosmosDBService, ILogger<UserProfileService> logger, IOrchestrationContext callContext, IEnumerable<IResourceProviderService> resourceProviderServices)
Parameters
cosmosDBServiceIAzureCosmosDBServiceThe Azure Cosmos DB service that contains user profiles.
loggerILogger<UserProfileService>The logging interface used to log under the UserProfileService type name.
callContextIOrchestrationContextContains contextual data for the calling service.
resourceProviderServicesIEnumerable<IResourceProviderService>The collection of IResourceProviderService services.
Methods
AddAgentToUserProfileAsync(string, string)
Adds an agent to the user's profile.
public Task AddAgentToUserProfileAsync(string instanceId, string agentObjectId)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
agentObjectIdstringThe object identifier of the agent to add.
Returns
GetUserDataAsync(string)
Returns the user data of the signed in user.
public Task<UserData?> GetUserDataAsync(string instanceId)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
Returns
Exceptions
GetUserProfileAsync(string, List<ResourceProviderGetResult<AgentBase>>?)
Returns the user profile of the signed in user.
public Task<UserProfile?> GetUserProfileAsync(string instanceId, List<ResourceProviderGetResult<AgentBase>>? agents = null)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
agentsList<ResourceProviderGetResult<AgentBase>>The list of agents the signed in user has permission to use.
Returns
Remarks
The agents parameter is provided when the caller seeks to avoid
reloading the list of agents the user has permission to use. It is the responsibility
of the caller to ensure the list is accurate.
Exceptions
GetUserProfileForUserAsync(string, string)
Returns the user profile of the specified user.
public Task<UserProfile?> GetUserProfileForUserAsync(string instanceId, string upn)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
upnstringThe user principal name of the user for whom to return the user profile.
Returns
RemoveAgentFromUserProfileAsync(string, string)
Removes an agent to the user's profile.
public Task RemoveAgentFromUserProfileAsync(string instanceId, string agentObjectId)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
agentObjectIdstringThe object identifier of the agent to remove.
Returns
UpsertUserDataAsync(string, UserData)
Inserts or updates a user data object.
public Task UpsertUserDataAsync(string instanceId, UserData userData)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
userDataUserDataThe user data object to upsert.
Returns
Exceptions
UpsertUserProfileAsync(string, UserProfile)
Inserts or updates a user profile.
public Task UpsertUserProfileAsync(string instanceId, UserProfile userProfile)
Parameters
instanceIdstringThe FoundationaLLM instance identifier.
userProfileUserProfileThe user profile to upsert.