more logs added. see #143
This commit is contained in:
parent
b00f1858f3
commit
b57375b46b
2 changed files with 3 additions and 3 deletions
|
|
@ -93,7 +93,7 @@ switch (llm) {
|
||||||
messageInput.setModel(prefs_api.ollama_model);
|
messageInput.setModel(prefs_api.ollama_model);
|
||||||
messagesArea.setLLMName("Ollama Local");
|
messagesArea.setLLMName("Ollama Local");
|
||||||
worker.postMessage({ type: 'init', ollama_host: prefs_api.ollama_host, ollama_model: prefs_api.ollama_model, i18nStrings: i18nStrings});
|
worker.postMessage({ type: 'init', ollama_host: prefs_api.ollama_host, ollama_model: prefs_api.ollama_model, i18nStrings: i18nStrings});
|
||||||
console.log("(>>>>>> [ThunderAI] Ollama init done.");
|
console.log(">>>>>> [ThunderAI] Ollama init done.");
|
||||||
try{
|
try{
|
||||||
messagesArea.appendUserMessage(browser.i18n.getMessage("ollama_api_connecting") + " \"" + prefs_api.ollama_host + "\" " +browser.i18n.getMessage("AndModel") + " \"" + prefs_api.ollama_model + "\"...", "info");
|
messagesArea.appendUserMessage(browser.i18n.getMessage("ollama_api_connecting") + " \"" + prefs_api.ollama_host + "\" " +browser.i18n.getMessage("AndModel") + " \"" + prefs_api.ollama_model + "\"...", "info");
|
||||||
}catch(e){
|
}catch(e){
|
||||||
|
|
@ -142,7 +142,7 @@ worker.onmessage = function(event) {
|
||||||
|
|
||||||
// handling commands from the backgound page
|
// handling commands from the backgound page
|
||||||
browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||||
//console.log(">>>>>>>>>>>>> controller.js onMessage: " + JSON.stringify(message));
|
console.log(">>>>>>>>>>>>> controller.js onMessage: " + JSON.stringify(message));
|
||||||
switch (message.command) {
|
switch (message.command) {
|
||||||
case "api_send":
|
case "api_send":
|
||||||
//send the received prompt to the llm api
|
//send the received prompt to the llm api
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,7 @@ async function openChatGPT(promptText, action, curr_tabId, prompt_name = '', do_
|
||||||
await browser.tabs.sendMessage(createdTab3.id, { command: "api_error", error: browser.i18n.getMessage('ollama_empty_model')});
|
await browser.tabs.sendMessage(createdTab3.id, { command: "api_error", error: browser.i18n.getMessage('ollama_empty_model')});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log(">>>>>> [ThunderAI] Ollama API about to send message to createdTab3.id: " + createdTab3.id);
|
||||||
await browser.tabs.sendMessage(createdTab3.id, { command: "api_send", prompt: promptText, action: action, tabId: curr_tabId, mailMessageId: mailMessageId3, do_custom_text: do_custom_text});
|
await browser.tabs.sendMessage(createdTab3.id, { command: "api_send", prompt: promptText, action: action, tabId: curr_tabId, mailMessageId: mailMessageId3, do_custom_text: do_custom_text});
|
||||||
taLog.log('[Ollama API] Connection succeded!');
|
taLog.log('[Ollama API] Connection succeded!');
|
||||||
browser.runtime.onMessage.removeListener(listener3);
|
browser.runtime.onMessage.removeListener(listener3);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue