Commit Graph

8867 Commits

Author SHA1 Message Date
Bartosz Taudul
13eca84926 Use the user language. 2025-07-12 11:50:01 +02:00
Bartosz Taudul
80f678c28a Replace spaces in wikipedia page queries with underscores. 2025-07-12 11:50:01 +02:00
Bartosz Taudul
e293f87a8a Adapt the wikipedia page cut-off to the available context size. 2025-07-12 11:50:01 +02:00
Bartosz Taudul
31afd9dbca Url encode wikipedia search queries. 2025-07-12 11:50:01 +02:00
Bartosz Taudul
4f49635c42 Further system prompt refinement. 2025-07-12 11:50:01 +02:00
Bartosz Taudul
b2f3e6b681 The models like to group separate wikipedia query terms.
Some search examples:
1. Tracy Profiler
2. "Tracy Profiler" "C++"
3. "Tracy Profiler"
2025-07-12 11:50:01 +02:00
Bartosz Taudul
40fed7dd6f Update system prompt with new rules. 2025-07-12 11:50:01 +02:00
Bartosz Taudul
8a6a6d8132 Merge wikipedia query terms with '+' in code, not in LLM. 2025-07-12 11:50:01 +02:00
Bartosz Taudul
116881ae81 Remove stray \r characters from the LLM responses. 2025-07-12 11:50:01 +02:00
Bartosz Taudul
50886ac16e Wikipedia search + article retrieval. 2025-07-12 11:50:00 +02:00
Bartosz Taudul
b0a36cb8e8 Use correct parameter for setting context size. 2025-07-12 11:50:00 +02:00
Bartosz Taudul
a8dd0ca232 Add Latin Extended A/B to font. 2025-07-12 11:50:00 +02:00
Bartosz Taudul
b54e36df29 Display context usage. 2025-07-12 11:50:00 +02:00
Bartosz Taudul
e60e30ddf1 Don't persist tree node open state between chats. 2025-07-12 11:50:00 +02:00
Bartosz Taudul
b163d97e65 Fix setting context size. 2025-07-12 11:50:00 +02:00
Bartosz Taudul
f65302984e Remove html2md, remove access to web for LLM. 2025-07-12 11:50:00 +02:00
Bartosz Taudul
8b100ff11d Use custom tool handling.
The ollama tool_calls do not preserve the context of why the tool was
called. The feature as it is right now doesn't seem to be designed for
the LLM to make queries, but rather to act as an agent that is supposed
to call some functions that will directly provide their output to the
user.

Instead, let's encode the tool calling protocol in the system prompt.
2025-07-12 11:50:00 +02:00
Bartosz Taudul
0d3e183540 Display tool responses in chat. 2025-07-12 11:49:59 +02:00
Bartosz Taudul
05f7019f30 Chat will have system prompt. 2025-07-12 11:49:59 +02:00
Bartosz Taudul
2e61fbac78 Expand system prompt. 2025-07-12 11:49:59 +02:00
Bartosz Taudul
4ad9e05814 Convert html to markdown. 2025-07-12 11:49:59 +02:00
Bartosz Taudul
f5ea5ffce1 Display tool call arguments. 2025-07-12 11:49:59 +02:00
Bartosz Taudul
dc8c106454 Implement fetching web pages. 2025-07-12 11:49:59 +02:00
Bartosz Taudul
3a60926f65 Link with libcurl. 2025-07-12 11:49:59 +02:00
Bartosz Taudul
9202ce277d Respond to tool calls. 2025-07-12 11:49:59 +02:00
Bartosz Taudul
b4763c7500 Pass messages to SendMessage() as const ref, not rvalue. 2025-07-12 11:49:58 +02:00
Bartosz Taudul
78257553c7 Allow disabling tools use. 2025-07-12 11:49:58 +02:00
Bartosz Taudul
4c46cc4deb Push available tools list to ollama. 2025-07-12 11:49:58 +02:00
Bartosz Taudul
7eedbe130e Prepare ollama request in an explicit way. 2025-07-12 11:49:58 +02:00
Bartosz Taudul
3414773f18 Keep system prompt unembedded. 2025-07-12 11:49:58 +02:00
Bartosz Taudul
c8dbe33a3c Move LLM system prompt to an external file. 2025-07-12 11:49:58 +02:00
Bartosz Taudul
cc0aa73527 Add embed utilities. 2025-07-12 11:49:58 +02:00
Bartosz Taudul
8006ae9e30 Build embed tool. 2025-07-12 11:49:58 +02:00
Bartosz Taudul
8fd1530c8f Rework context size handling.
The user now specifies max context size to be used for all models.
2025-07-12 11:49:57 +02:00
Bartosz Taudul
74b6e481bb Add spacing between chat messages. 2025-07-12 11:49:57 +02:00
Bartosz Taudul
10decca063 Fix chat input focus. 2025-07-12 11:49:57 +02:00
Bartosz Taudul
b901544fb4 Draw ellipsis when waiting for ollama reply (loading model, parsing prompt, etc.) 2025-07-12 11:49:57 +02:00
Bartosz Taudul
1590d3196b Don't wait for streaming to end when exiting. 2025-07-12 11:49:57 +02:00
Bartosz Taudul
dedc9259c1 Add basic system prompt. 2025-07-12 11:49:57 +02:00
Bartosz Taudul
e8578668d4 Add support for basic markdown features. 2025-07-12 11:49:57 +02:00
Bartosz Taudul
2bf627061e Add support for printing code blocks. 2025-07-12 11:49:57 +02:00
Bartosz Taudul
b982515774 Use string references instead of copies. 2025-07-12 11:49:56 +02:00
Bartosz Taudul
60230c2d7e Split chat responses into lines for easier parsing. 2025-07-12 11:49:56 +02:00
Bartosz Taudul
cfd3260ea0 Count chat lines. 2025-07-12 11:49:56 +02:00
Bartosz Taudul
3a60a67c95 Explicitly check for assistant role. 2025-07-12 11:49:56 +02:00
Bartosz Taudul
2ad2fa0b4a Get role string only once. 2025-07-12 11:49:56 +02:00
Bartosz Taudul
1ebe85d24f Always show scroll bar in chat window. 2025-07-12 11:49:56 +02:00
Bartosz Taudul
ef230b08f3 Don't display the "thinking" unless asked for. 2025-07-12 11:49:56 +02:00
Bartosz Taudul
b90e0fa467 Adjust colors. 2025-07-12 11:49:56 +02:00
Bartosz Taudul
18a220d4db Support displaying ollama error messages. 2025-07-12 11:49:56 +02:00