SimpleChatTC: Update readme wrt web fetch and related simple proxy

This commit is contained in:
hanishkvc 2025-10-17 05:36:43 +05:30
parent 8b950fd348
commit cd226e8dae
1 changed files with 9 additions and 6 deletions

View File

@ -334,16 +334,21 @@ The following tools/functions are currently provided by default
* simple_calculator - which can solve simple arithmatic expressions * simple_calculator - which can solve simple arithmatic expressions
* run_javascript_function_code - which can be used to run some javascript code in the browser * run_javascript_function_code - which can be used to run some javascript code in the browser
context. context.
* web_url_fetch - fetch requested url through a proxy server
* web_url_fetch_strip_htmltags_and_some_useless - fetch requested url through a proxy server
and also try strip the html respose of html tags and also head, script & style blocks.
Currently the generated code / expression is run through a simple minded eval inside a web worker Currently the generated code / expression is run through a simple minded eval inside a web worker
mechanism. Use of WebWorker helps avoid exposing browser global scope to the generated code directly. mechanism. Use of WebWorker helps avoid exposing browser global scope to the generated code directly.
However any shared web worker scope isnt isolated. Either way always remember to cross check the tool However any shared web worker scope isnt isolated. Either way always remember to cross check the tool
requests and generated responses when using tool calling. requests and generated responses when using tool calling.
May add web_url_fetch and family works along with a corresponding simple local web proxy/caching server logic
* web_fetch along with a corresponding simple local web proxy/caching server logic that can bypass that can bypass the CORS restrictions applied if trying to directly fetch from the browser js runtime
the CORS restrictions applied if trying to directly fetch from the browser js runtime environment. environment. Depending on the path specified on the proxy server, if urltext, it additionally tries
Inturn maybe with a white list of allowed sites to access or so. to convert html content into equivalent text to some extent. May add support for white list of allowed
sites to access or so.
* tools/server/public_simplechat/local.tools/simpleproxy.py
#### Extending with new tools #### Extending with new tools
@ -394,8 +399,6 @@ get incorporated in result sent to ai engine on the server side.
#### ToDo #### ToDo
WebFetch and Local web proxy/caching server
Is the promise land trap deep enough, need to think through and explore around this once later. Is the promise land trap deep enough, need to think through and explore around this once later.
Trap error responses. Trap error responses.