diff --git a/tools/server/public_simplechat/docs/changelog.md b/tools/server/public_simplechat/docs/changelog.md index 66bdffa20f..747803d6bc 100644 --- a/tools/server/public_simplechat/docs/changelog.md +++ b/tools/server/public_simplechat/docs/changelog.md @@ -300,11 +300,11 @@ Chat Session specific settings * the user can change the default behaviour of tools being disabled and sliding window of 1 * program restart will reset these back to the default * Ui module cleanup to avoid duplicated/unneeded boiler plates, including using updated jsdoc annotations -* A simple minded basic Markdown to Html logic with support for - * headings +* A simple minded basic Markdown to Html logic with support for below to some extent + * headings, horiz line, * lists (ordered, unordered, intermixed at diff leves) - * tables - * fenced code blocks + * tables, fenced code blocks, blockquotes +* Rename fetch_web_url_raw to fetch_url_raw, avoids confusion and matchs semantic of access to local and web. ## ToDo diff --git a/tools/server/public_simplechat/docs/details.md b/tools/server/public_simplechat/docs/details.md index 42023e3ade..2a702dfbb4 100644 --- a/tools/server/public_simplechat/docs/details.md +++ b/tools/server/public_simplechat/docs/details.md @@ -510,7 +510,7 @@ Either way always remember to cross check tool requests and generated responses ##### using bundled simpleproxy.py (helps bypass browser cors restriction, ...) -* fetch_web_url_raw - fetch contents of the requested url through a proxy server +* fetch_url_raw - fetch contents of the requested url through a proxy server * fetch_html_text - fetch text parts of the html content from the requested url through a proxy server. Related logic tries to strip html response of html tags and also head, script, style, header,footer, @@ -577,7 +577,7 @@ In future it can be further extended to help with other relatively simple yet us fetch_rss and so. * for now fetch_rss can be indirectly achieved using - * fetch_web_url_raw or better still + * fetch_url_raw or better still * xmlfiltered and its tagDropREs #### Extending with new tools diff --git a/tools/server/public_simplechat/readme.md b/tools/server/public_simplechat/readme.md index ec578f1c6c..99707d5dff 100644 --- a/tools/server/public_simplechat/readme.md +++ b/tools/server/public_simplechat/readme.md @@ -97,7 +97,7 @@ A lightweight simple minded ai chat client with a web front-end that supports mu - data_store brings in browser IndexedDB based persistant key/value storage across sessions - in collaboration with included python based simpleproxy.py, these additional tool calls are supported - - `search_web_text`, `fetch_web_url_raw`, `fetch_html_text`, `fetch_pdf_as_text`, `fetch_xml_filtered` + - `search_web_text`, `fetch_url_raw`, `fetch_html_text`, `fetch_pdf_as_text`, `fetch_xml_filtered` - these built‑in tool calls (via SimpleProxy) help fetch PDFs, HTML, XML or perform web search - PDF tool also returns an outline with numbering, if available - result is truncated to `iResultMaxDataLength` (default 128 kB) diff --git a/tools/server/public_simplechat/toolweb.mjs b/tools/server/public_simplechat/toolweb.mjs index 1e02f22daa..3933489923 100644 --- a/tools/server/public_simplechat/toolweb.mjs +++ b/tools/server/public_simplechat/toolweb.mjs @@ -1,6 +1,6 @@ //@ts-check // ALERT - Simple Stupid flow - Using from a discardable VM is better -// Helpers to handle tools/functions calling related to web access, pdf, etal +// Helpers to handle tools/functions calling related to local/web access, pdf, etal // which work in sync with the bundled simpleproxy.py server logic. // Uses the js specific web worker path. // by Humans for All @@ -100,21 +100,21 @@ async function proxyserver_tc_setup(tag, chatId, tcPath, tcName, tcsData, tcs) { // -// Fetch Web Url Raw +// Fetch Url Raw // -let fetchweburlraw_meta = { +let fetchurlraw_meta = { "type": "function", "function": { - "name": "fetch_web_url_raw", - "description": "Fetch the requested web url through a proxy server and return the got content as is, in few seconds", + "name": "fetch_url_raw", + "description": "Fetch contents of the requested url (local file path / web based) through a proxy server and return the got content as is, in few seconds. Mainly useful for getting textual non binary contents", "parameters": { "type": "object", "properties": { "url":{ "type":"string", - "description":"url of the web page to fetch from the internet" + "description":"url of the local file / web content to fetch" } }, "required": ["url"] @@ -124,7 +124,7 @@ let fetchweburlraw_meta = { /** - * Implementation of the fetch web url raw logic. + * Implementation of the fetch url raw logic. * Expects a simple minded proxy server to be running locally * * listening on a configured port * * expecting http requests @@ -136,22 +136,22 @@ let fetchweburlraw_meta = { * @param {string} toolname * @param {any} obj */ -function fetchweburlraw_run(chatid, toolcallid, toolname, obj) { +function fetchurlraw_run(chatid, toolcallid, toolname, obj) { // maybe filter out any key other than 'url' in obj return proxyserver_get_anyargs(chatid, toolcallid, toolname, obj, 'urlraw'); } /** - * Setup fetch_web_url_raw for tool calling + * Setup fetch_url_raw for tool calling * NOTE: Currently the logic is setup for the bundled simpleproxy.py * @param {mToolsMgr.TCSwitch} tcs * @param {string} chatId */ -async function fetchweburlraw_setup(tcs, chatId) { - return proxyserver_tc_setup('FetchWebUrlRaw', chatId, 'urlraw', 'fetch_web_url_raw', { - "handler": fetchweburlraw_run, - "meta": fetchweburlraw_meta, +async function fetchurlraw_setup(tcs, chatId) { + return proxyserver_tc_setup('FetchUrlRaw', chatId, 'urlraw', 'fetch_url_raw', { + "handler": fetchurlraw_run, + "meta": fetchurlraw_meta, "result": "" }, tcs); } @@ -437,7 +437,7 @@ export async function setup(chatId) { * @type {mToolsMgr.TCSwitch} tcs */ let tc_switch = {} - await fetchweburlraw_setup(tc_switch, chatId) + await fetchurlraw_setup(tc_switch, chatId) await fetchhtmltext_setup(tc_switch, chatId) await searchwebtext_setup(tc_switch, chatId) await fetchpdftext_setup(tc_switch, chatId)