Class DownstreamAPIService
- Namespace
 - FoundationaLLM.Common.Services.API
 
- Assembly
 - FoundationaLLM.Common.dll
 
Contains methods for interacting with the downstream API.
public class DownstreamAPIService : IDownstreamAPIService
  - Inheritance
 - 
      
      DownstreamAPIService
 
- Implements
 
- Inherited Members
 
- Extension Methods
 
Constructors
DownstreamAPIService(string, IOrchestrationContext, IHttpClientFactoryService, ILogger<DownstreamAPIService>)
Contains methods for interacting with the downstream API.
public DownstreamAPIService(string downstreamHttpClientName, IOrchestrationContext callContext, IHttpClientFactoryService httpClientFactoryService, ILogger<DownstreamAPIService> logger)
  Parameters
downstreamHttpClientNamestringThe name of the downstream HTTP client.
callContextIOrchestrationContextStores context information extracted from the current HTTP request. This information is primarily used to inject HTTP headers into downstream HTTP calls.
httpClientFactoryServiceIHttpClientFactoryServiceThe HTTP client factory service.
loggerILogger<DownstreamAPIService>The ILogger used for logging.
Properties
APIName
The name of the downstream API.
public string APIName { get; }
  Property Value
Methods
GetCompletion(string, CompletionRequest)
Gets a completion from the downstream API.
public Task<CompletionResponse> GetCompletion(string instanceId, CompletionRequest completionRequest)
  Parameters
instanceIdstringThe FoundationaLLM instance id.
completionRequestCompletionRequestThe completion request containing the user prompt and message history.
Returns
- Task<CompletionResponse>
 The completion response.
GetCompletionOperationStatus(string, string)
Gets the status of a completion operation.
public Task<LongRunningOperation> GetCompletionOperationStatus(string instanceId, string operationId)
  Parameters
instanceIdstringThe FoundationaLLM instance id.
operationIdstringThe OperationId for which to retrieve the status.
Returns
- Task<LongRunningOperation>
 Returns an LongRunningOperation object containing the OperationId and Status.
StartCompletionOperation(string, CompletionRequest)
Begins a completion operation.
public Task<LongRunningOperation> StartCompletionOperation(string instanceId, CompletionRequest completionRequest)
  Parameters
instanceIdstringThe FoundationaLLM instance id.
completionRequestCompletionRequestThe completion request containing the user prompt and message history.
Returns
- Task<LongRunningOperation>
 Returns an LongRunningOperation object containing the OperationId and Status.