Fixed embedding mismatch
This commit is contained in:
@@ -34,7 +34,7 @@ public class ApplicationDbContext : IdentityDbContext<IdentityUser>
|
||||
else
|
||||
{
|
||||
entity.Property(r => r.Embedding)
|
||||
.HasColumnType("vector(1536)");
|
||||
.HasColumnType("vector(768)");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ using Seasoned.Backend.Data;
|
||||
namespace Seasoned.Backend.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20260318201722_InitialCreateWith768Vector")]
|
||||
partial class InitialCreateWith768Vector
|
||||
[Migration("20260318220841_FixEmbeddingDimensions")]
|
||||
partial class FixEmbeddingDimensions
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -9,7 +9,7 @@ using Pgvector;
|
||||
namespace Seasoned.Backend.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialCreateWith768Vector : Migration
|
||||
public partial class FixEmbeddingDimensions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
@@ -40,10 +40,8 @@ public class RecipeService : IRecipeService
|
||||
{
|
||||
return new RecipeResponseDto { Title = "Error: No image provided" };
|
||||
}
|
||||
|
||||
var googleAI = new GoogleAI(_apiKey);
|
||||
|
||||
var model = googleAI.GenerativeModel("gemini-3.1-flash-lite-preview");
|
||||
var model = _googleAI.GenerativeModel("gemini-3.1-flash-lite-preview");
|
||||
|
||||
using var ms = new MemoryStream();
|
||||
await image.CopyToAsync(ms);
|
||||
@@ -100,8 +98,7 @@ public class RecipeService : IRecipeService
|
||||
|
||||
public async Task<ChefConsultResponseDto> ConsultChefAsync(string userPrompt)
|
||||
{
|
||||
var googleAI = new GoogleAI(_apiKey);
|
||||
var model = googleAI.GenerativeModel("gemini-3.1-flash-lite-preview");
|
||||
var model = _googleAI.GenerativeModel("gemini-3.1-flash-lite-preview");
|
||||
|
||||
var systemPrompt = @"You are the 'Seasoned' Head Chef, a master of real-world culinary arts.
|
||||
You operate a professional kitchen and only provide advice that can be used in a real kitchen.
|
||||
|
||||
Reference in New Issue
Block a user