Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

move memory collection from env to config #172

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using Azure.Storage.Blobs;
using GBB.Miyagi.RecommendationService.config;
using GBB.Miyagi.RecommendationService.Models;
using GBB.Miyagi.RecommendationService.Utils;
using Microsoft.AspNetCore.Mvc;
using Microsoft.SemanticKernel.Memory;
using Microsoft.SemanticKernel.Text;
using ConsoleLogger = GBB.Miyagi.RecommendationService.Utils.ConsoleLogger;

namespace GBB.Miyagi.RecommendationService.Controllers;

Expand All @@ -18,6 +19,7 @@ public class MemoryController : ControllerBase
private const int MaxTokensPerLine = 60;
private readonly BlobServiceClient _blobServiceClient;
private readonly ISemanticTextMemory _memory;
private readonly KernelSettings _kernelSettings = KernelSettings.LoadSettings();

public MemoryController(ISemanticTextMemory memory, BlobServiceClient blobServiceClient)
{
Expand Down Expand Up @@ -78,7 +80,7 @@ public async Task<IActionResult> SaveDatasetAsync([FromBody] DatasetInfo dataset
}

// Chunk, generate embeddings, and persist to vectordb
var memoryCollectionName = Env.Var("MEMORY_COLLECTION");
var memoryCollectionName = _kernelSettings.CollectionName;
log.LogInformation("Saving dataset {DataSetName} to memory collection {MemoryCollectionName}",
datasetInfo.DataSetName, memoryCollectionName);

Expand Down