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