Skip to content

Commit

Permalink
Remove unused variable and fix GPT4V_ENDPOINT URL
Browse files Browse the repository at this point in the history
  • Loading branch information
heblasco committed Mar 6, 2024
1 parent d893f2d commit 04ada90
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/AIHub/Controllers/ImageAnalyzerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class ImageAnalyzerController : Controller
private string AOAIsubscriptionKey;
private string storageconnstring;
private string AOAIDeploymentName;
private string gpt4Vision;
private readonly BlobContainerClient containerClient;
private readonly IEnumerable<BlobItem> blobs;
private Uri sasUri;
Expand All @@ -30,7 +29,6 @@ public ImageAnalyzerController(IConfiguration config, IHttpClientFactory clientF
containerClient = blobServiceClient.GetBlobContainerClient(config.GetValue<string>("Storage:ContainerName"));
sasUri = containerClient.GenerateSasUri(Azure.Storage.Sas.BlobContainerSasPermissions.Read, DateTimeOffset.UtcNow.AddHours(1));
AOAIDeploymentName = config.GetValue<string>("ImageAnalyzer:DeploymentName") ?? throw new ArgumentNullException("DeploymentName");
gpt4Vision = config.GetValue<string>("ImageAnalyzer:GPT4Vision") ?? throw new ArgumentNullException("GPT4Vision");
// Obtain the blobs list in the container
blobs = containerClient.GetBlobs();
httpClient = clientFactory.CreateClient();
Expand All @@ -45,7 +43,7 @@ public IActionResult ImageAnalyzer()
[HttpPost]
public async Task<IActionResult> DenseCaptionImage(string image_url, string prompt)
{
string GPT4V_ENDPOINT = $"{AOAIendpoint }openai/deployments/{AOAIDeploymentName}/extensions/chat/completions?api-version=2023-07-01-preview";
string GPT4V_ENDPOINT = $"{AOAIendpoint}openai/deployments/{AOAIDeploymentName}/extensions/chat/completions?api-version=2023-07-01-preview";
image_url = image_url + sasUri.Query;

using (httpClient = new HttpClient())
Expand Down

0 comments on commit 04ada90

Please sign in to comment.