SimpleChatTC:Fetch:Proxy URL rename and in settings

This commit is contained in:
hanishkvc 2025-10-20 21:01:23 +05:30
parent 98d43fac7f
commit 2a94cb3786
2 changed files with 6 additions and 6 deletions

View File

@ -1044,7 +1044,7 @@ class Me {
//"frequency_penalty": 1.2,
//"presence_penalty": 1.2,
};
this.proxyUrl = "http://127.0.0.1:3128"
this.toolFetchProxyUrl = "http://127.0.0.1:3128"
}
/**
@ -1121,7 +1121,7 @@ class Me {
* @param {HTMLDivElement} elDiv
*/
show_settings(elDiv) {
ui.ui_show_obj_props_edit(elDiv, this, ["baseURL", "headers", "bStream", "bTools", "apiRequestOptions", "TRAPME-apiEP", "TRAPME-iRecentUserMsgCnt", "bTrimGarbage", "bCompletionFreshChatAlways", "bCompletionInsertStandardRolePrefix"], "Settings", (prop, elProp)=>{
ui.ui_show_obj_props_edit(elDiv, this, ["baseURL", "headers", "bStream", "bTools", "apiRequestOptions", "TRAPME-apiEP", "TRAPME-iRecentUserMsgCnt", "toolFetchProxyUrl", "bTrimGarbage", "bCompletionFreshChatAlways", "bCompletionInsertStandardRolePrefix"], "Settings", (prop, elProp)=>{
if (prop == "headers:Authorization") {
// @ts-ignore
elProp.placeholder = "Bearer OPENAI_API_KEY";

View File

@ -116,7 +116,7 @@ let fetchweburlraw_meta = {
function fetchweburlraw_run(toolcallid, toolname, obj) {
if (gToolsWorker.onmessage != null) {
// @ts-ignore
let newUrl = `${document['gMe'].proxyUrl}/urlraw?url=${encodeURIComponent(obj.url)}`
let newUrl = `${document['gMe'].toolFetchProxyUrl}/urlraw?url=${encodeURIComponent(obj.url)}`
fetch(newUrl).then(resp => {
if (!resp.ok) {
throw new Error(`${resp.status}:${resp.statusText}`);
@ -138,7 +138,7 @@ function fetchweburlraw_run(toolcallid, toolname, obj) {
*/
async function fetchweburlraw_setup(tcs) {
// @ts-ignore
let got = await fetch(`${document["gMe"].proxyUrl}/aum?url=jambudweepe.multiverse.987654321123456789`).then(resp=>{
let got = await fetch(`${document["gMe"].toolFetchProxyUrl}/aum?url=jambudweepe.multiverse.987654321123456789`).then(resp=>{
if (resp.statusText != 'bharatavarshe') {
console.log("WARN:ToolJS:FetchWebUrlRaw:Dont forget to run the bundled local.tools/simpleproxy.py to enable me")
return
@ -190,7 +190,7 @@ let fetchweburltext_meta = {
function fetchweburltext_run(toolcallid, toolname, obj) {
if (gToolsWorker.onmessage != null) {
// @ts-ignore
let newUrl = `${document['gMe'].proxyUrl}/urltext?url=${encodeURIComponent(obj.url)}`
let newUrl = `${document['gMe'].toolFetchProxyUrl}/urltext?url=${encodeURIComponent(obj.url)}`
fetch(newUrl).then(resp => {
if (!resp.ok) {
throw new Error(`${resp.status}:${resp.statusText}`);
@ -212,7 +212,7 @@ function fetchweburltext_run(toolcallid, toolname, obj) {
*/
async function fetchweburltext_setup(tcs) {
// @ts-ignore
let got = await fetch(`${document["gMe"].proxyUrl}/aum?url=jambudweepe.akashaganga.multiverse.987654321123456789`).then(resp=>{
let got = await fetch(`${document["gMe"].toolFetchProxyUrl}/aum?url=jambudweepe.akashaganga.multiverse.987654321123456789`).then(resp=>{
if (resp.statusText != 'bharatavarshe') {
console.log("WARN:ToolJS:FetchWebUrlText:Dont forget to run the bundled local.tools/simpleproxy.py to enable me")
return