asking claude optional permission. see #558
This commit is contained in:
parent
b7315bf810
commit
e94aeac45b
2 changed files with 11 additions and 0 deletions
|
|
@ -1696,5 +1696,9 @@
|
||||||
"Anthropic_System_Prompt_Info": {
|
"Anthropic_System_Prompt_Info": {
|
||||||
"message": "You can improve Claude performance by using a System Prompt to give it a role. This technique, known as role prompting, is the most powerful way to use system prompts with Claude. The right role can turn Claude from a general assistant into your virtual domain expert.",
|
"message": "You can improve Claude performance by using a System Prompt to give it a role. This technique, known as role prompting, is the most powerful way to use system prompts with Claude. The right role can turn Claude from a general assistant into your virtual domain expert.",
|
||||||
"description": ""
|
"description": ""
|
||||||
|
},
|
||||||
|
"Optional_Permission_Denied_Model_Fetching": {
|
||||||
|
"message": "You have denied the optional permission needed to fetch models for this integration.",
|
||||||
|
"description": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -787,6 +787,13 @@ export async function injectConnectionUI({
|
||||||
apiKey: document.getElementById("anthropic_api_key").value,
|
apiKey: document.getElementById("anthropic_api_key").value,
|
||||||
version: document.getElementById("anthropic_version").value,
|
version: document.getElementById("anthropic_version").value,
|
||||||
});
|
});
|
||||||
|
let granted = await messenger.permissions.request({ origins: ["https://*.anthropic.com/*"] });
|
||||||
|
if(!granted){
|
||||||
|
document.getElementById('anthropic_model_fetch_loading').style.display = 'none';
|
||||||
|
taLog.warn("Claude API web permission denied");
|
||||||
|
alert(browser.i18n.getMessage("Optional_Permission_Denied_Model_Fetching"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
anthropic.fetchModels().then((data) => {
|
anthropic.fetchModels().then((data) => {
|
||||||
if(!data.ok){
|
if(!data.ok){
|
||||||
let errorDetail;
|
let errorDetail;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue