Skip to content

Commit

Permalink
rename model settings to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Demeter29 committed Oct 3, 2024
1 parent 22a6987 commit f612348
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion public/configWindow/actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<li class="active"><a href="actions.html">Actions</a></li>
<li><a href="summarization.html">Summarization</a></li>
<li><a href="prompts.html">Prompts</a></li>
<li><a href="modelSettings.html">Model Settings</a></li>
<li><a href="settings.html">ettings</a></li>
<li><a href="system.html">System</a></li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/configWindow/connection.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<li><a href="actions.html">Actions</a></li>
<li><a href="summarization.html">Summarization</a></li>
<li><a href="prompts.html">Prompts</a></li>
<li><a href="modelSettings.html">Model Settings</a></li>
<li><a href="settings.html">Settings</a></li>
<li><a href="system.html">System</a></li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/configWindow/prompts.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<li><a href="actions.html">Actions</a></li>
<li><a href="summarization.html">Summarization</a></li>
<li class="active"><a href="prompts.html">Prompts</a></li>
<li ><a href="modelSettings.html">Model Settings</a></li>
<li ><a href="settings.html">Settings</a></li>
<li><a href="system.html">System</a></li>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<li><a href="connection.html">Connection</a></li>
<li><a href="actions.html">Actions</a></li>
<li><a href="summarization.html">Summarization</a></li>
<li><a href="prompts.html">Promptis</a></li>
<li class="active"><a href="modelSettings.html">Model Settings</a></li>
<li><a href="prompts.html">Prompts</a></li>
<li class="active"><a href="settings.html">Settings</a></li>
<li><a href="system.html">System</a></li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/configWindow/summarization.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<li><a href="actions.html">Actions</a></li>
<li class="active"><a href="summarization.html">Summarization</a></li>
<li><a href="prompts.html">Prompts</a></li>
<li><a href="modelSettings.html">Model Settings</a></li>
<li><a href="settings.html">Settings</a></li>
<li><a href="system.html">System</a></li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/configWindow/system.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<li><a href="actions.html">Actions</a></li>
<li><a href="summarization.html">Summarization</a></li>
<li><a href="prompts.html">Prompts</a></li>
<li><a href="modelSettings.html">Model Settings</a></li>
<li><a href="settings.html">Settings</a></li>
<li class="active"><a href="system.html">System</a></li>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/main/conversation/Conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {OpenAI} from 'openai';
import { Config } from '../../shared/Config.js';
import { ApiConnection, Connection, Parameters } from '../../shared/apiConnection.js';
import { checkActions } from './checkActions.js';
import { convertChatToText, buildChatPrompt, buildSummarizeChatPrompt , buildResummarizeChatPrompt} from './promptBuilder.js';
import { convertChatToText, buildChatPrompt, buildSummarizeChatPrompt , buildResummarizeChatPrompt, convertChatToTextNoNames} from './promptBuilder.js';
import { cleanMessageContent } from './messageCleaner.js';
import { summarize } from './summarize.js';
import fs from 'fs';
Expand Down Expand Up @@ -189,7 +189,7 @@ export class Conversation{
this.currentSummary = await this.summarizationApiConnection.complete(buildResummarizeChatPrompt(this, messagesToSummarize), false, {});
}
else{
this.currentSummary = await this.summarizationApiConnection.complete(convertChatToText(buildResummarizeChatPrompt(this, messagesToSummarize), this.config, this.gameData.aiName), false, {});
this.currentSummary = await this.summarizationApiConnection.complete(convertChatToTextNoNames(buildResummarizeChatPrompt(this, messagesToSummarize), this.config), false, {});
}

console.log("after current summary: "+this.currentSummary)
Expand Down
13 changes: 13 additions & 0 deletions src/main/conversation/promptBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ export function convertChatToText(chat: Message[], config: Config, aiName: strin
return output;
}

export function convertChatToTextNoNames(messages: Message[], config: Config): string{
let output: string = "";
for(let msg of messages){
if(msg.role === "user"){
output+=config.inputSequence+"\n";
}
output += msg.content+"\n";
}

output+=config.outputSequence+"\n";
return output;
}

export function buildChatPrompt(conv: Conversation): Message[]{
let chatPrompt: Message[] = [];

Expand Down
4 changes: 2 additions & 2 deletions src/main/conversation/summarize.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Conversation } from "./Conversation";
import { buildSummarizeChatPrompt, convertChatToText} from "./promptBuilder";
import { buildSummarizeChatPrompt, convertChatToTextNoNames} from "./promptBuilder";


export async function summarize(conv: Conversation): Promise<string>{
Expand All @@ -10,7 +10,7 @@ export async function summarize(conv: Conversation): Promise<string>{
})
}
else{
summarization = await conv.summarizationApiConnection.complete(convertChatToText(buildSummarizeChatPrompt(conv), conv.config, conv.gameData.aiName), false, {
summarization = await conv.summarizationApiConnection.complete(convertChatToTextNoNames(buildSummarizeChatPrompt(conv), conv.config), false, {
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/windows/ChatWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class ChatWindow{

this.interval = setInterval(()=>{
let win = ActiveWindow.getActiveWindow();
console.log(win.title)
// console.log(win.title)

if(win.title === "Crusader Kings III" || win.title === "Voices of the Court - Chat"){
OverlayController.activateOverlay();
Expand Down

0 comments on commit f612348

Please sign in to comment.