C#C
C#2y ago
10 replies
TJacken

Template system for chat gpt ASP.NET Core

Hi all, I'm creating application when user can create template where he can prompt chat gpt, each template has tags for example I can have two tags $username (every user can have same tag with different value) and $question. So template looks like this:

User:
username: {{ $username }}
question: {{ $question }}
Assistant:

when I render this prompt it will look something like this:

User:
username: TJacken
question: Who is American president?
Assistant:

"username" tag value is something what I need to preserve, "question" is something what will change for each request.

I need advice is this table setup correct? Should I create third table with many-to-many relationship where I would hold template_id, tag_id and tag_value? Or there is better approach to this problem?

Need to create tables with EF Core this is not problem, I just need to know I'm on the good track 🙂
image.png
Was this page helpful?