Skip to content

Commit

Permalink
Fix issue with resource loading the AzureOpenAI resource provider
Browse files Browse the repository at this point in the history
  • Loading branch information
ciprianjichici committed Sep 20, 2024
1 parent b9b3b8e commit 3a4d273
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System.Collections.Concurrent;
using System.Text;
using System.Text.Json;

namespace FoundationaLLM.AIModel.ResourceProviders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ protected override async Task<object> ExecuteActionAsync(
protected override async Task<T> GetResourceAsyncInternal<T>(ResourcePath resourcePath, UnifiedUserIdentity userIdentity, ResourceProviderLoadOptions? options = null) =>
resourcePath.ResourceTypeName switch
{
AzureOpenAIResourceTypeNames.AssistantUserContexts => (await LoadResource<T>(
resourcePath.MainResourceId!))!,
AzureOpenAIResourceTypeNames.FilesContent => ((await LoadFileContent(
resourcePath.ResourceTypeInstances[0].ResourceId!,
resourcePath.ResourceTypeInstances[1].ResourceId!)) as T)!,
AzureOpenAIResourceTypeNames.FileUserContexts => ((await LoadFileUserContext(resourcePath.ResourceTypeInstances[0].ResourceId!)) as T)!,
resourcePath.MainResourceId!,
resourcePath.ResourceId!)) as T)!,
AzureOpenAIResourceTypeNames.FileUserContexts => ((await LoadFileUserContext(resourcePath.MainResourceId!)) as T)!,
_ => throw new ResourceProviderException(
$"The {resourcePath.MainResourceTypeName} resource type is not supported by the {_name} resource provider.")
};
Expand Down

0 comments on commit 3a4d273

Please sign in to comment.