Skip to content

Commit

Permalink
Refactor GeminiApi to include user name in system instruction for imp…
Browse files Browse the repository at this point in the history
…roved context
  • Loading branch information
allenhutchison committed Nov 2, 2024
1 parent 62d3335 commit ebda2b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ export class GeminiApi {
constructor(plugin: ObsidianGemini) {
this.plugin = plugin;
console.log("Initializing Gemini API with model:", this.plugin.settings.modelName);
const systemInstruction = this.plugin.settings.systemPrompt + ` My name is ${this.plugin.settings.userName}.`;
this.gemini = new GoogleGenerativeAI(this.plugin.settings.apiKey);
this.model = this.gemini.getGenerativeModel({
model: this.plugin.settings.modelName,
systemInstruction: this.plugin.settings.systemPrompt,
systemInstruction: systemInstruction,
});
}

Expand Down

0 comments on commit ebda2b1

Please sign in to comment.