Skip to content

Commit

Permalink
Add German to SupportedLanguage.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
phmatray committed May 31, 2023
1 parent 3243c3b commit ec87be2
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SalesPitch est une application de génération de pitch de vente utilisant OpenA
## Fonctionnalités

* Interagit avec OpenAI GPT-3.5 pour générer des pitchs de vente
* Prend en charge plusieurs langues (Français et Anglais)
* Prend en charge plusieurs langues (Français, Anglais, Allemand et Espagnol)
* Comprend plusieurs cadres de pitch de vente
* AIDA (Attention, Interest, Desire, Action)
* PAS (Problem-Agitate-Solve)
Expand Down
1 change: 1 addition & 0 deletions src/SalesPitch/Commands/SalesPitchCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ private static SupportedLanguage AskLanguage()
SupportedLanguage.English => "English",
SupportedLanguage.French => "Français",
SupportedLanguage.Spanish => "Español",
SupportedLanguage.German => "Deutsch",
_ => throw new ArgumentOutOfRangeException(nameof(x), x, null)
}));

Expand Down
1 change: 1 addition & 0 deletions src/SalesPitch/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
registrations.AddSingleton<EnglishLanguageService>();
registrations.AddSingleton<FrenchLanguageService>();
registrations.AddSingleton<SpanishLanguageService>();
registrations.AddSingleton<GermanLanguageService>();
registrations.AddSingleton<SpectreLanguageServiceFactory>();
registrations.AddOpenAIService();
var registrar = new SalesPitch.Infrastructure.TypeRegistrar(registrations);
Expand Down
3 changes: 2 additions & 1 deletion src/SalesPitch/Services/Language/EnglishLanguageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ public string LanguageMarkup(SupportedLanguage? language)
=> language switch
{
SupportedLanguage.English => "English",
SupportedLanguage.French => "French",
SupportedLanguage.French => "French",
SupportedLanguage.Spanish => "Spanish",
SupportedLanguage.German => "German",
_ => throw new ArgumentOutOfRangeException(nameof(language), language, null)
};

Expand Down
1 change: 1 addition & 0 deletions src/SalesPitch/Services/Language/FrenchLanguageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public string LanguageMarkup(SupportedLanguage? language)
SupportedLanguage.English => "Anglais",
SupportedLanguage.French => "Français",
SupportedLanguage.Spanish => "Espagnol",
SupportedLanguage.German => "Allemand",
_ => throw new ArgumentOutOfRangeException(nameof(language), language, null)
};

Expand Down
136 changes: 136 additions & 0 deletions src/SalesPitch/Services/Language/GermanLanguageService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
using SalesPitch.Commands;

namespace SalesPitch.Services.Language;

public class GermanLanguageService : ILanguageService
{
public string GetChatGPTUserPrompt(SalesPitchSettings settings)
{
return $"""
Verfasse ein Verkaufsargument für das folgende Produkt mit dem Verkaufsrahmen {settings.Framework}.
Betone die Probleme und Vorteile.
Formuliere das Verkaufsargument so, dass es dem Publikum präsentiert werden kann, mit Aufmerksamkeit erregenden Überschriften während des gesamten Arguments,
füge keine Anweisungen hinzu.
Ich möchte, dass es druckfertig ist.

Produktname : {settings.Product}
Preis : {settings.Price}
Eigenschaften : {settings.Features}
Vorteile : {settings.Benefits}
""";
}

public string GetChatGPTSetupSystemMessage()
=> "Du agierst als Texter mit 20 Jahren Erfahrung im Verkauf. "
+ "Deine Aufgabe ist es, ein Verkaufsargument für ein Produkt zu verfassen.";

public string TableSettingKey()
=> "Einstellung";

public string TableSettingValue()
=> "Wert";

public string SalesPitchFrameworkMarkup(SalesPitchFramework? framework)
=> framework switch
{
SalesPitchFramework.AIDA
=> $"{framework} (Aufmerksamkeit, Interesse, Verlangen, Aktion)",
SalesPitchFramework.PAS
=> $"{framework} (Problem-Agitation-Lösung)",
SalesPitchFramework.USP
=> $"{framework} (Einzigartiges Verkaufsversprechen)",
SalesPitchFramework.FeaturesBenefits
=> $"{framework} (Eigenschaften-Vorteile)",
SalesPitchFramework.Storytelling
=> $"{framework} (Geschichtenerzählen)",
SalesPitchFramework.WIIFM
=> $"{framework} (Was ist für mich drin?)",
SalesPitchFramework.Youtility
=> $"{framework} (Youtility)",
SalesPitchFramework.FAB
=> $"{framework} (Eigenschaften, Vorteile, Nutzen)",
SalesPitchFramework.HHE
=> $"{framework} (Überschrift, Haken, Empathie)",
SalesPitchFramework.SUSPENSE
=> $"{framework} (Überraschung, Originalität, spezifische Details, Versprechen, Aufregung, Neuheit, Geschichte)",
_ => throw new ArgumentOutOfRangeException(nameof(framework), framework, null)
};

public string SalesPitchFrameworkPrompt()
=> "Wählen Sie einen Verkaufsrahmen:";

public string SalesPitchFrameworkSetting()
=> "Verkaufsrahmen";

public string LanguageSetting()
=> "Sprache";

public string LanguageMarkup(SupportedLanguage? language)
=> language switch
{
SupportedLanguage.English => "Englisch",
SupportedLanguage.German => "Deutsch",
SupportedLanguage.French => "Französisch",
SupportedLanguage.Spanish => "Spanisch",
_ => throw new ArgumentOutOfRangeException(nameof(language), language, null)
};

public string UseDemoDataSetting()
=> "Demodaten";

public string UseDemoDataPrompt()
=> "Demodaten verwenden?";

public string UseDemoDataMarkup(bool isDemo)
=> isDemo
? "Ja"
: "Nein";

public string ProductSetting()
=> "Produktname";

public string ProductPrompt()
=> "Wie lautet der Name des Produkts?";

public string ProductNotValid()
=> "Der Produktname muss angegeben werden.";

public string ProductDemo()
=> "Microsoft Power BI Premium";

public string PriceSetting()
=> "Preis";

public string PricePrompt()
=> "Wie viel kostet das Produkt?";

public string PriceNotValid()
=> "Der Preis des Produkts muss angegeben werden.";

public string PriceDemo()
=> "16,90 € pro Benutzer/Monat";

public string FeaturesSetting()
=> "Eigenschaften";

public string FeaturesPrompt()
=> "Was sind die Eigenschaften des Produkts?";

public string FeaturesNotValid()
=> "Die Eigenschaften des Produkts müssen angegeben werden.";

public string FeaturesDemo()
=> "Verschiedene Datenquellen, Erstellung interaktiver Berichte, Benutzerdefinierte Dashboards, Teilen und Zusammenarbeit, Integration mit anderen Microsoft-Diensten, Echtzeit-Datenaktualisierung, Datensicherheit und -verwaltung";

public string BenefitsSetting()
=> "Vorteile";

public string BenefitsPrompt()
=> "Was sind die Vorteile des Produkts?";

public string BenefitsNotValid()
=> "Die Vorteile des Produkts müssen angegeben werden.";

public string BenefitsDemo()
=> "Informierte Entscheidungsfindung, Erhöhte Produktivität, Zugänglichkeit, Flexibilität, Skalierbarkeit, Kontinuierliche Verbesserung";
}
1 change: 1 addition & 0 deletions src/SalesPitch/Services/Language/SpanishLanguageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public string LanguageMarkup(SupportedLanguage? language)
SupportedLanguage.English => "Inglés",
SupportedLanguage.French => "Francés",
SupportedLanguage.Spanish => "Español",
SupportedLanguage.German => "Alemán",
_ => throw new ArgumentOutOfRangeException(nameof(language), language, null)
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public ILanguageService GetLanguageService(SupportedLanguage? language)
.GetService(typeof(FrenchLanguageService)) as ILanguageService,
SupportedLanguage.Spanish => _serviceProvider
.GetService(typeof(SpanishLanguageService)) as ILanguageService,
SupportedLanguage.German => _serviceProvider
.GetService(typeof(GermanLanguageService)) as ILanguageService,
_ => throw new InvalidOperationException($"Unsupported language: {language}")
}
?? throw new InvalidOperationException($"Language service not found for language: {language}");
Expand Down
3 changes: 2 additions & 1 deletion src/SalesPitch/Services/Language/SupportedLanguage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public enum SupportedLanguage
{
English,
French,
Spanish
Spanish,
German
}

0 comments on commit ec87be2

Please sign in to comment.