SimpleChatTC:Tools: Pick proxy server address from document[gMe]
This commit is contained in:
parent
9b55775e8a
commit
04644761e6
|
|
@ -1035,6 +1035,7 @@ class Me {
|
|||
//"frequency_penalty": 1.2,
|
||||
//"presence_penalty": 1.2,
|
||||
};
|
||||
this.proxyUrl = "http://127.0.0.1:3128"
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -115,7 +115,8 @@ let fetchweburlraw_meta = {
|
|||
*/
|
||||
function fetchweburlraw_run(toolcallid, toolname, obj) {
|
||||
if (gToolsWorker.onmessage != null) {
|
||||
let newUrl = `http://127.0.0.1:3128/urlraw?url=${encodeURIComponent(obj.url)}`
|
||||
// @ts-ignore
|
||||
let newUrl = `${document['gMe'].proxyUrl}/urlraw?url=${encodeURIComponent(obj.url)}`
|
||||
fetch(newUrl).then(resp => {
|
||||
if (!resp.ok) {
|
||||
throw new Error(`${resp.status}:${resp.statusText}`);
|
||||
|
|
@ -165,7 +166,8 @@ let fetchweburltext_meta = {
|
|||
*/
|
||||
function fetchweburltext_run(toolcallid, toolname, obj) {
|
||||
if (gToolsWorker.onmessage != null) {
|
||||
let newUrl = `http://127.0.0.1:3128/urltext?url=${encodeURIComponent(obj.url)}`
|
||||
// @ts-ignore
|
||||
let newUrl = `${document['gMe'].proxyUrl}/urltext?url=${encodeURIComponent(obj.url)}`
|
||||
fetch(newUrl).then(resp => {
|
||||
if (!resp.ok) {
|
||||
throw new Error(`${resp.status}:${resp.statusText}`);
|
||||
|
|
|
|||
Loading…
Reference in New Issue