mirror of
https://github.com/fbarrca/obsidian-inlineAI.git
synced 2026-07-22 11:50:24 +00:00
Reinitialize ChatApiManagermessage queue based on settings toggle
This commit is contained in:
parent
d2bd638b4e
commit
171994ccef
1 changed files with 6 additions and 0 deletions
|
|
@ -44,6 +44,12 @@ export class ChatApiManager {
|
|||
*/
|
||||
private initializeChatClient(settings: InlineAISettings): ChatOpenAI | ChatOllama | ChatGoogleGenerativeAI | null {
|
||||
try {
|
||||
if (settings.messageHistory) {
|
||||
this.messageHistory = new MessageQueue<HistoryMessage>(MESSAGE_HISTORY_LIMIT);
|
||||
} else {
|
||||
this.messageHistory = new MessageQueue<HistoryMessage>(0);
|
||||
}
|
||||
|
||||
switch (settings.provider) {
|
||||
case "openai":
|
||||
if (!settings.apiKey) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue