AuthorBuddy/Models/OllamaSettings.cs
2026-08-30 08:11:01 +02:00

136 lines
12 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace AuthorBuddy.Web.Models;
public class OllamaSettings
{
public string StyleModel { get; set; } = "gemma4:e4b";
public string EmbedModel { get; set; } = "nomic-embed-text";
public string SpellingModel { get; set; } = "phi3:mini";
public string OllamaUrl { get; set; } = "http://localhost:11434";
public string LlamaCppUrl { get; set; } = "http://localhost:8080";
public string Backend { get; set; } = "Ollama";
public string RagBackend { get; set; } = "Ollama";
public string StyleBackend { get; set; } = "Ollama";
public string SpellingBackend { get; set; } = "Ollama";
public string Theme { get; set; } = "light";
public string Language { get; set; } = "de";
public string OllamaCloudUrl { get; set; } = "https://api.ollama.com";
public string OllamaCloudApiKey { get; set; } = string.Empty;
public string LektorSystemPrompt { get; set; } = "Du bist ein erfahrener Lektor. Analysiere den Text des Autors. " +
"Optimiere ihn auf einen lebendigen, anschaulichen und subjektiven Stil. " +
"Nutze starke Verben, vermeide unnötige Adjektive und achte auf 'Show, don't tell'. " +
"Antworte direkt mit dem verbesserten Text oder konkreten Vorschlägen.";
public string TechLastenheftPrompt { get; set; } = "Du bist ein erfahrener Requirements Engineer nach IREB-Standard. Erstelle ein Lastenheft aus den gegebenen Informationen. Gliedere es in: 1. Zielbestimmung, 2. Produkteinsatz, 3. Produktumgebung, 4. Funktionale Anforderungen, 5. Nicht-funktionale Anforderungen, 6. Lieferumfang. Formuliere alle Anforderungen eindeutig, nachvollziehbar und überprüfbar.";
public string TechPflichtenheftPrompt { get; set; } = "Du bist ein erfahrener Systemarchitekt. Erstelle aus dem Lastenheft ein detailliertes Pflichtenheft. Beschreibe: 1. Systemarchitektur, 2. Komponenten, 3. Schnittstellen, 4. Datenmodell, 5. Technische Umsetzung. Verwende präzise technische Sprache und vermeide Mehrdeutigkeiten.";
public string TechUseCasePrompt { get; set; } = "Du bist ein Experte für Use-Case-Modellierung nach UML-Standard. Definiere die wichtigsten Anwendungsfälle. Jeder Use Case enthält: 1. Akteure, 2. Vorbedingungen, 3. Nachbedingungen, 4. Normaler Ablauf (Schritt für Schritt), 5. Alternative Abläufe, 6. Ausnahmen.";
public string TechStakeholderPrompt { get; set; } = "Du bist ein erfahrener Stakeholder-Analyst. Identifiziere alle relevanten Stakeholder für das Projekt. Für jeden Stakeholder beschreibe: 1. Rolle und Interesse, 2. Erwartungen und Ziele, 3. Einfluss und Priorität, 4. Kommunikationsbedarf. Berücksichtige auch indirekte und versteckte Stakeholder.";
public string TechGlossarPrompt { get; set; } = "Du bist ein Terminologie-Manager. Erstelle ein fachliches Glossar mit klaren Definitionen aller wichtigen Begriffe, Abkürzungen und Akronyme aus dem Projektkontext. Strukturiere alphabetisch. Jeder Eintrag enthält: Begriff, Definition, Synonyme, Kontext.";
public string TechQualitaetPrompt { get; set; } = "Du bist ein Qualitätsmanager nach ISO 25010. Definiere die Qualitätsanforderungen in folgende Kategorien: 1. Funktionale Eignung, 2. Zuverlässigkeit, 3. Benutzbarkeit, 4. Effizienz, 5. Wartbarkeit, 6. Portabilität. Formuliere messbare Kriterien.";
public string TechRisikoPrompt { get; set; } = "Du bist ein Risikomanager. Identifiziere technische und fachliche Risiken des Projekts. Für jedes Risiko beschreibe: 1. Beschreibung, 2. Eintrittswahrscheinlichkeit (niedrig/mittel/hoch), 3. Auswirkung (niedrig/mittel/hoch), 4. Risikobewertung, 5. Maßnahmen zur Risikominimierung.";
public string FactCheckTemplate { get; set; } = "FAKTEN AUS DER DATENBANK:\n{0}\n\n" +
"FRAGE / KONTEXT:\n{1}\n\n" +
"Basierend auf den Fakten, schreibe eine kurze, lebendige Ergänzung oder Korrektur.";
public string SpellingPrompt { get; set; } = "Du bist ein Rechtschreibprüfer. Korrigiere NUR Fehler (Rechtschreibung/Grammatik). " +
"Ändere den Stil nicht. Gib nur den korrigierten Text zurück.";
public string AdvocatusDiaboliPrompt { get; set; } = "Nimm eine radikale Gegenposition zu meinem Text ein. Welche Schwachstellen in meiner Argumentation fallen dir auf?";
public string HookFinderPrompt { get; set; } = "Generiere mir 5 emotionale, packende Einstiegssätze (Hooks) für diesen Text, die den Leser sofort fesseln.";
public string Eli5Prompt { get; set; } = "Wo ist der Text zu kompliziert geschrieben? Liefere mir konkrete Vorschläge, wie ich komplexe Absätze einfacher formulieren kann, ohne den Kern zu verlieren.";
public string CoAuthorBrainstormingPrompt { get; set; } = "Du bist ein kreativer Co-Autor. Der Nutzer gibt dir eine Idee, einen Charakter oder eine Situation. " +
"Hilf ihm, die Handlung oder Personen weiterzuentwickeln. Stelle kluge Fragen, schlage alternative Wendungen vor, " +
"denke über Motivationen, Konflikte und emotionale Tiefe nach. Sei inspirierend, aber bleib beim Thema.";
public string LektorSystemPromptEn { get; } = "You are an experienced editor. Analyze the author's text. " +
"Optimize it for a vivid, descriptive, and subjective style. " +
"Use strong verbs, avoid unnecessary adjectives, and follow 'Show, don't tell'. " +
"Respond directly with the improved text or concrete suggestions.";
public string FactCheckTemplateEn { get; } = "FACTS FROM DATABASE:\n{0}\n\n" +
"QUESTION / CONTEXT:\n{1}\n\n" +
"Based on the facts, write a short, vivid addition or correction.";
public string SpellingPromptEn { get; } = "You are a spell checker. Correct ONLY errors (spelling/grammar). " +
"Do not change the style. Return only the corrected text.";
public string AdvocatusDiaboliPromptEn { get; } = "Take a radical opposing position to my text. What weaknesses in my argumentation do you notice?";
public string HookFinderPromptEn { get; } = "Generate 5 emotional, captivating opening sentences (hooks) for this text that immediately grab the reader's attention.";
public string Eli5PromptEn { get; } = "Where is the text too complicated? Give me concrete suggestions on how to simplify complex paragraphs without losing the core message.";
public string CoAuthorBrainstormingPromptEn { get; } = "You are a creative co-author. The user gives you an idea, a character, or a situation. " +
"Help them develop the plot or characters further. Ask smart questions, suggest alternative twists, " +
"think about motivations, conflicts, and emotional depth. Be inspiring but stay on topic.";
public string TechLastenheftPromptEn { get; } = "You are an experienced Requirements Engineer following IREB standards. Create a requirements specification from the given information. Structure it into: 1. Objectives, 2. Product application, 3. Product environment, 4. Functional requirements, 5. Non-functional requirements, 6. Deliverables. Formulate all requirements clearly, traceably, and verifiably.";
public string TechPflichtenheftPromptEn { get; } = "You are an experienced system architect. Create a detailed functional specification from the requirements document. Describe: 1. System architecture, 2. Components, 3. Interfaces, 4. Data model, 5. Technical implementation. Use precise technical language and avoid ambiguity.";
public string TechUseCasePromptEn { get; } = "You are a UML use case modeling expert. Define the most important use cases. Each use case includes: 1. Actors, 2. Preconditions, 3. Postconditions, 4. Normal flow (step by step), 5. Alternative flows, 6. Exceptions.";
public string TechStakeholderPromptEn { get; } = "You are an experienced stakeholder analyst. Identify all relevant stakeholders for the project. For each stakeholder describe: 1. Role and interest, 2. Expectations and goals, 3. Influence and priority, 4. Communication needs. Also consider indirect and hidden stakeholders.";
public string TechGlossarPromptEn { get; } = "You are a terminology manager. Create a technical glossary with clear definitions of all important terms, abbreviations, and acronyms from the project context. Structure alphabetically. Each entry contains: term, definition, synonyms, context.";
public string TechQualitaetPromptEn { get; } = "You are a quality manager following ISO 25010. Define the quality requirements in the following categories: 1. Functional suitability, 2. Reliability, 3. Usability, 4. Efficiency, 5. Maintainability, 6. Portability. Formulate measurable criteria.";
public string TechRisikoPromptEn { get; } = "You are a risk manager. Identify technical and business risks for the project. For each risk describe: 1. Description, 2. Probability (low/medium/high), 3. Impact (low/medium/high), 4. Risk assessment, 5. Risk mitigation measures.";
public double LektorTemp { get; set; } = 0.7;
public double FactCheckTemp { get; set; } = 0.3;
public double SpellingTemp { get; set; } = 0.1;
public double AdvocatusDiaboliTemp { get; set; } = 0.9;
public double HookFinderTemp { get; set; } = 0.9;
public double Eli5Temp { get; set; } = 0.5;
public double CoAuthorTemp { get; set; } = 1.0;
public double TechLastenheftTemp { get; set; } = 0.3;
public double TechPflichtenheftTemp { get; set; } = 0.3;
public double TechUseCaseTemp { get; set; } = 0.4;
public double TechStakeholderTemp { get; set; } = 0.5;
public double TechGlossarTemp { get; set; } = 0.2;
public double TechQualitaetTemp { get; set; } = 0.3;
public double TechRisikoTemp { get; set; } = 0.5;
public string QuickMarkdownPrompt { get; set; } = "Du bist ein Markdown-Profi. Formatiere den folgenden Text als sauberes, gut strukturiertes Markdown. Verwende Überschriften (##, ###), Listen, Tabellen, Code-Blöcke, fette/kursive Hervorhebungen und Zitate wo sinnvoll. Achte auf Lesbarkeit und eine logische Gliederung.";
public string QuickMarkdownPromptEn { get; } = "You are a Markdown professional. Format the following text as clean, well-structured Markdown. Use headings (##, ###), lists, tables, code blocks, bold/italic emphasis and quotes where appropriate. Ensure readability and logical structure.";
public double QuickMarkdownTemp { get; set; } = 0.3;
public string ChatPrompt { get; set; } = "Du bist ein hilfreicher Assistent. Antworte freundlich und präzise auf Deutsch.";
public string ChatPromptEn { get; } = "You are a helpful assistant. Answer friendly and precisely in English.";
public double ChatTemp { get; set; } = 0.7;
public bool ChatFactCheckEnabled { get; set; } = false;
public string FactSearchPrompt { get; set; } = "Du bist ein Recherche-Assistent. Erstelle aus der folgenden Behauptung eine präzise Suchanfrage für eine Websuche (maximal 10 Wörter, nur Schlüsselbegriffe). Gib NUR die Suchanfrage zurück – ohne Anführungszeichen, ohne Vor- oder Nachbemerkungen.";
public string FactSearchPromptEn { get; } = "You are a research assistant. From the following claim, create a precise web-search query (max 10 words, keywords only). Return ONLY the query – no quotes, no preamble.";
public double FactSearchTemp { get; set; } = 0.2;
public string GetChatDefaultPrompt(string currentLanguage) => GetDefaultPrompt(ChatPrompt, ChatPromptEn, currentLanguage);
public string GetQuickMarkdownDefaultPrompt(string currentLanguage) => GetDefaultPrompt(QuickMarkdownPrompt, QuickMarkdownPromptEn, currentLanguage);
public string GetFactSearchDefaultPrompt(string currentLanguage) => GetDefaultPrompt(FactSearchPrompt, FactSearchPromptEn, currentLanguage);
public string GetDefaultPrompt(string dePrompt, string enPrompt, string currentLanguage)
{
return currentLanguage == "en" ? enPrompt : dePrompt;
}
public string GetFactCheckPrompt(string question, string facts)
{
return string.Format(FactCheckTemplate, facts, question);
}
}