Commit Graph

7379 Commits

Author SHA1 Message Date
hanishkvc fc26e47222 SimpleChatTC:ShowObjPropsInfo: Use sections to indicate relations
Also create a top level div wrt whole. And allow class to be
specified for the same as well as the top level legend, optionally
2025-12-04 19:41:39 +05:30
hanishkvc 24ba85026e SimpleChatTC:ShowInfo: Make logic recursive, avoid JSON.stringify 2025-12-04 19:41:39 +05:30
hanishkvc 34b2beea1a SimpleChatTC:ShowInfo: Create and use common automated info show
Also fetch info from ai-server, and place path and ctx size into
current Me instance and include in show info.
2025-12-04 19:41:39 +05:30
hanishkvc 2a94cb3786 SimpleChatTC:Fetch:Proxy URL rename and in settings 2025-12-04 19:41:39 +05:30
hanishkvc 98d43fac7f SimpleChatTC:WebFetch: Try confirm simpleproxy before enabling 2025-12-04 19:41:39 +05:30
hanishkvc a6aa563a18 SimpleChatTC:WebFetch: Check for the specific proxy paths 2025-12-04 19:41:39 +05:30
hanishkvc 80dbbb89a5 SimpleChatTC:WebFetch: Enable only if something at proxyUrl
NOTE: not a robust check, just tries to establish a http connection
for now and doesnt really check if it is the specific proxy srvr
of interest or not.
2025-12-04 19:41:39 +05:30
hanishkvc fa0a6919cb SimpleChatTC: Update/Cleanup readme 2025-12-04 19:41:39 +05:30
hanishkvc 8ca77e455a SimpleChatTC:NonStreaming: Update oneshot mode wrt tool calls
Take care of the possibility of content not being there as well as
take care of retrieving the tool calls for further processing.

With this tool calls should work in non streaming mode also
2025-12-04 19:41:39 +05:30
hanishkvc 3e0cf2a2df SimpleChatTC:ObjPropsEdit: Obj within Obj aware fRefiner
Use same to set a placeholder for Authorization entry in headers
2025-12-04 19:41:39 +05:30
hanishkvc f874c69983 SimpleChatTC:UiShowObjPropsEdit allow refining 2025-12-04 19:41:39 +05:30
hanishkvc 6253c717b3 SimpleChatTC:Trappable UiShowObjPropsEdit for custom handling
Use it to handle apiEP and iRecentUserMsgCnt in more user friendly
way, where they get a selection to choose from.
2025-12-04 19:41:39 +05:30
hanishkvc 3718a39c06 SimpleChatTC:Use generic obj props edit for settings in general
Bring more user controllable properties into this new settings ui
2025-12-04 19:41:39 +05:30
hanishkvc 756b128539 SimpleChatTC:UI:ObjPropEdits handle objects, use for gMe 2025-12-04 19:41:39 +05:30
hanishkvc b771e42dc1 SimpleChatTC:UI:Common helper to edit obj members of few types
Make the previously relatively generic flow wrt apiRequestOptions
settings into a fully generic reusable by others flow.

Rather had stopped short of it, when previously moved onto other
things at that time.
2025-12-04 19:41:39 +05:30
hanishkvc 6e5b532313 SimpleChatTC:UI: el_get/el_set to avoid warnings 2025-12-04 19:41:39 +05:30
hanishkvc 04644761e6 SimpleChatTC:Tools: Pick proxy server address from document[gMe] 2025-12-04 19:41:39 +05:30
hanishkvc 9b55775e8a SimpleChatTC:WebFetch: Update readme to reflect the new names 2025-12-04 19:41:39 +05:30
hanishkvc 42f91df261 SimpleChatTC:WebFetch:Trap Non Ok status and raise error
So that the same error path is used for logical error wrt http req
also, without needing a different path for it.

Dont forget to return the resp text/json/..., so that the contents
are passed along the promise then chain
2025-12-04 19:41:39 +05:30
hanishkvc d04c8cd38d SimpleChatTC:SimpleProxy: Ensure CORS related headers sent always
Add a new send headers common helper and use the same wrt the
overridden send_error as well as do_OPTIONS

This ensures that if there is any error during proxy opertions,
the send_error propogates to the fetch from any browser properly
without browser intercepting it with a CORS error
2025-12-04 19:41:39 +05:30
hanishkvc c2fb0cd241 SimpleChatTC:WebFetch: Cleanup the names and descriptions a bit 2025-12-04 19:41:39 +05:30
hanishkvc 73a144c44d SimpleChatTC:SimpleProxy:HtmlParser more generic and flexible
also now track header, footer and nav so that they arent captured
2025-12-04 19:41:39 +05:30
hanishkvc cd226e8dae SimpleChatTC: Update readme wrt web fetch and related simple proxy 2025-12-04 19:41:39 +05:30
hanishkvc 8b950fd348 SimpleChatTC:WebFetch:UrlEnc url2fetch b4Passing toProxy asQuery
Ensures that if the url being requested as any query strings in
them then things dont get messed up, when the url to get inc its
query is extracted from the proxy request's query string
2025-12-04 19:41:39 +05:30
hanishkvc 9ff2c596ee SimpleChatTC:SimpleProxy:Options just in case 2025-12-04 19:41:39 +05:30
hanishkvc 9c7d6cc0e4 SimpleChatTC:WebUrlText:Update name and desc to see if prefered 2025-12-04 19:41:39 +05:30
hanishkvc bf63b8f45a SimpleChatTC:SimpleProxy:UrlText: Slightly better trimming
First identify lines which have only whitespace and replace them
with lines with only newline char in them.

Next strip out adjacent lines, if they have only newlines
2025-12-04 19:41:39 +05:30
hanishkvc 266e825c68 SimpleChatTC:SimpleProxy:UrlText: Try strip empty lines some what 2025-12-04 19:41:39 +05:30
hanishkvc 82ab08ec1a SimpleChatTC:WebUrl FetchStrip through simple proxy 2025-12-04 19:41:39 +05:30
hanishkvc b46bbc542a SimpleChatTC:SimpleProxy:UrlText: Avoid style blocks also 2025-12-04 19:41:39 +05:30
hanishkvc f493e1af59 SimpleChatTC:SimpleProxy:UrlText: Capture body except for scripts 2025-12-04 19:41:39 +05:30
hanishkvc 45b05df21b SimpleChatTC:SimpleProxy: Switch to html.parser
As html can be malformed, xml ElementTree XMLParser cant handle
the same properly, so switch to the HtmlParser helper class that is
provided by python and try extend it.

Currently a minimal skeleton to just start it out, which captures
only the body contents.
2025-12-04 19:41:39 +05:30
hanishkvc d5f4183f7c SimpleChatTC:SimpleProxy: ElementTree, No _UrlopenRet
As _UrlopenRet not exposed for use outside urllib, so decode and
encode the data.

Add skeleton to try get the html/xml tree top elements
2025-12-04 19:41:39 +05:30
hanishkvc 6537559360 SimpleChatTC:SimpleProxy:Common UrlReq helper for UrlRaw & UrlText
Declare the result of UrlReq as a DataClass, so that one doesnt
goof up wrt updating and accessing members.

Duplicate UrlRaw into UrlText, need to add Text extracting from
html next for UrlText
2025-12-04 19:41:39 +05:30
hanishkvc e600e62e86 SimpleChatTC:SimpleProxy: Cleanup few messages 2025-12-04 19:41:39 +05:30
hanishkvc c25b1968cd SimpleChatTC:WebFetch: Update to use internal SimpleProxy.py 2025-12-04 19:41:39 +05:30
hanishkvc 3bab4de0e8 SimpleChatTC:SimpleProxy:UrlRaw: Fixup basic oversight wrt 1st go 2025-12-04 19:41:39 +05:30
hanishkvc 73ef9f7d46 SimpleChatTC:SimpleProxy:implement handle_urlraw
A basic go at it
2025-12-04 19:41:39 +05:30
hanishkvc 73054a5832 SimpleChatTC:SimpleProxy: Extract and check path, route to handlers 2025-12-04 19:41:39 +05:30
hanishkvc c99788e290 SimpleChatTC:SimpleProxy: Cleanup for basic run 2025-12-04 19:41:39 +05:30
hanishkvc 80fd065993 SimpleChatTC:SimpleProxy: Start server, Show requested path 2025-12-04 19:41:39 +05:30
hanishkvc 05c0ade8be SimpleChatTC:SimpleProxy:Process args --port 2025-12-04 19:41:39 +05:30
hanishkvc 8fc74ef923 SimpleChatTC:WebFetchThroughProxy:Initial go creating request 2025-12-04 19:41:39 +05:30
hanishkvc 09ce19a95a SimpleChatTC: update readme wrt promise related trapping 2025-12-04 19:41:39 +05:30
hanishkvc f0a3886d1e SimpleChatTC:Ensure fetch's promise chain is also trapped
Dont forget to map members of got entity from fetch to things
from saved original promise, bcas remember what is got is a promise.

also

add some comments around certain decisions and needed exploration
2025-12-04 19:41:39 +05:30
hanishkvc 77d3e43cb4 SimpleChatTC: Allow await in generated code that will be evald 2025-12-04 19:41:39 +05:30
hanishkvc 92e5b2133e SimpleChatTC:Promises: trap normal fetch (dont care await or not) 2025-12-04 19:41:39 +05:30
hanishkvc 0241b7b469 SimpleChatTC:TrapPromise: log the trapping
also possible refinement wrt trapping, if needed, added as comment

all or allSettled to use or not is the question.

whether to wait for a round trip through the related event loop or
not is also a question.
2025-12-04 19:41:39 +05:30
hanishkvc 3d661793ef SimpleChatTC:ChatMessageEx: 1st go at trying to track promises 2025-12-04 19:41:39 +05:30
hanishkvc 7dbbc46390 SimpleChatTC:ChatMessageEx: Better tool result extractor 2025-12-04 19:41:39 +05:30