Class AzureContainerAppsCustomContainerService
- Namespace
- FoundationaLLM.Context.Services
- Assembly
- FoundationaLLM.ContextEngine.dll
Provides a code session service that uses Azure Container Apps Dynamic Sessions to execute code.
public class AzureContainerAppsCustomContainerService : AzureContainerAppsServiceBase, ICodeSessionProviderService
- Inheritance
-
AzureContainerAppsCustomContainerService
- Implements
- Inherited Members
- Extension Methods
Constructors
AzureContainerAppsCustomContainerService(IHttpClientFactory, IOptions<AzureContainerAppsCustomContainerServiceSettings>, ILogger<AzureContainerAppsCodeInterpreterService>)
Provides a code session service that uses Azure Container Apps Dynamic Sessions to execute code.
public AzureContainerAppsCustomContainerService(IHttpClientFactory httpClientFactory, IOptions<AzureContainerAppsCustomContainerServiceSettings> options, ILogger<AzureContainerAppsCodeInterpreterService> logger)
Parameters
httpClientFactoryIHttpClientFactoryThe factory used to create HttpClient instances.
optionsIOptions<AzureContainerAppsCustomContainerServiceSettings>The options for the Azure Container Apps code execution service.
loggerILogger<AzureContainerAppsCodeInterpreterService>The logger used for logging.
Properties
ProviderName
Gets the name of the code session provider.
public string ProviderName { get; }
Property Value
Methods
CreateCodeSession(string, string, string, string, string, UnifiedUserIdentity)
Creates a new code session.
public Task<CreateCodeSessionResponse> CreateCodeSession(string instanceId, string agentName, string conversationId, string context, string language, UnifiedUserIdentity userIdentity)
Parameters
instanceIdstringThe unique identifier of the FoundationaLLM instance.
agentNamestringThe name of the agent for which the code execution session is created.
conversationIdstringThe unique identifier of the conversation.
contextstringThe context in which the code execution session is created. This is usually the name of the agent tool, but it is not limited to that.
languagestringThe code session programing language.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing the user identity information.
Returns
- Task<CreateCodeSessionResponse>
A CreateCodeSessionResponse object with the properties of the code execution session.
DeleteCodeSessionFileStoreItems(string, string)
Deletes all files from a code session.
public Task DeleteCodeSessionFileStoreItems(string codeSessionId, string endpoint)
Parameters
codeSessionIdstringThe identifier of the code session.
endpointstringThe endpoint of the code session service.
Returns
DownloadFileFromCodeSession(string, string, string, string)
Downloads a file from a code session.
public Task<Stream?> DownloadFileFromCodeSession(string codeSessionId, string endpoint, string fileName, string filePath)
Parameters
codeSessionIdstringThe identifier of the code session.
endpointstringThe endpoint of the code session service.
fileNamestringThe name of the file to download.
filePathstringThe path to the file to download.
Returns
ExecuteCodeInCodeSession(string, string, string)
Executes code in a code session.
public Task<CodeSessionCodeExecuteResponse> ExecuteCodeInCodeSession(string codeSessionId, string endpoint, string codeToExecute)
Parameters
codeSessionIdstringThe identifier of the code session.
endpointstringThe endpoint of the code session service.
codeToExecutestringThe code to execute.
Returns
- Task<CodeSessionCodeExecuteResponse>
The result of the code execution including standard and error outputs.
GetCodeSessionFileStoreItems(string, string)
Lists files from a code session.
public Task<List<CodeSessionFileStoreItem>> GetCodeSessionFileStoreItems(string codeSessionId, string endpoint)
Parameters
codeSessionIdstringThe identifier of the code session.
endpointstringThe endpoint of the code session service.
Returns
- Task<List<CodeSessionFileStoreItem>>
The list of file paths from the code session.
UploadFileToCodeSession(string, string, string, Stream)
Uploads a file to a code execution session.
public Task<bool> UploadFileToCodeSession(string codeSessionId, string endpoint, string fileName, Stream fileContent)
Parameters
codeSessionIdstringThe identifier of the code session.
endpointstringThe endpoint of the code session service.
fileNamestringThe name of the file to upload.
fileContentStreamThe stream containing the binary content of the file to upload.