From 6cda9ceddb4c9686e2466d6a0fd08296b961232c Mon Sep 17 00:00:00 2001 From: Johan Date: Mon, 6 Apr 2026 21:44:25 +0200 Subject: [PATCH] started on new link agnet with tools --- .gitignore | 64 +++++++++++++ ask_linkding.py | 91 ++++++++++++++++++ link_agent.py | 241 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 396 insertions(+) create mode 100644 .gitignore create mode 100644 ask_linkding.py create mode 100644 link_agent.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b1bba61 --- /dev/null +++ b/.gitignore @@ -0,0 +1,64 @@ +#Ignore thumbnails created by Windows +Thumbs.db +#Ignore files built by Visual Studio +*.user +*.aps +*.pch +*.vspscc +*_i.c +*_p.c +*.ncb +*.suo +*.bak +*.cache +*.ilk +*.log +[Bb]in +[Dd]ebug*/ +*.sbr +obj/ +[Rr]elease*/ +_ReSharper*/ +.klocwork +.vs +[Dd]ebug + +#General build files +*.obj +*.tmp +*.o +*.d +*.exe + +#default log +out.txt + +#input files +*.ngc + +#Python +*.pyc + +#emacs saves +*~ +\#* + +#test-bench builds +[Ll]ib +*_tests + +#\.vscode #migth be good to save settings, but it is also a bit of a mess +build/ + +#drawio backups +*.bkp +*.dtmp + +\scans + +# Environment variables (secrets) +.env +.env.local + +# virtual environments +venv/ \ No newline at end of file diff --git a/ask_linkding.py b/ask_linkding.py new file mode 100644 index 0000000..bd243ac --- /dev/null +++ b/ask_linkding.py @@ -0,0 +1,91 @@ +#pip install langgraph langchain langchain-community langchain-ollama + +import requests, json, re, string +from html.parser import HTMLParser + +class MyHTMLParser(HTMLParser): + def __init__(self): + super().__init__() + self.skip_content = False # Skip content inside